Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include musl libc Release Binaries #3417

Open
looked-at-me opened this issue May 2, 2020 · 12 comments
Open

Include musl libc Release Binaries #3417

looked-at-me opened this issue May 2, 2020 · 12 comments

Comments

@looked-at-me
Copy link
Contributor

On systems that use musl libc, the glibc binaries won't run. So it would be convenient, especially for scripts, to have a ldc2 binary built and released with musl libc. This would save anyone that needs to use ldc2 on a musl libc system from having to build the musl libc ldc2 binary themselves.

@kinke
Copy link
Member

kinke commented May 2, 2020

This would be a manageable CI addition if it weren't for the fact that we'd need a musl-LLVM for linking too, so another CI addition to our LLVM repo.

@looked-at-me
Copy link
Contributor Author

@kinke

A bit unrelated, but cross compilation should work right with an mtriple? Using dub:

dub build --arch="x86_64-linux-musl" --compiler=ldc2

It does pass the mtriple to the ldc2 commands, but it still links against glibc. I do have the development libraries for musl. Do I need to do anything extra to link against musl?

@kinke
Copy link
Member

kinke commented May 7, 2020

Yeah, you'll need cross-compiled druntime/Phobos too and tell LDC to use the musl-gcc/clang for linking. See https://wiki.dlang.org/Cross-compiling_with_LDC.

@PetarKirov
Copy link
Contributor

Here's a crazy idea: can ldc actually be a proxy script that invokes ldc-build-runtime in case it can't find druntime and phobos build for the target triple? An of course, if it finds them, it forwards all args to the actual ldc binary?

@kinke
Copy link
Member

kinke commented May 8, 2020

The example cmdlines in https://wiki.dlang.org/Building_LDC_runtime_libraries indicate that that's not really an option IMO. Once we have something like an ldc-add-target tool which downloads & extracts a prebuilt archive and sets up ldc2.conf, we're in very good shape I'd say.

@looked-at-me
Copy link
Contributor Author

If I were to add CI to create the binaries, what would be your preference is where to put it? I looked at the travis script and it is already quite large. The easiest way would be to use a docker image, but then it might be faster to compile just by cross compiling, but then testing... I've just been using the prebuilt LLVM binaries so I'd also need to look into your custom LLVM repo.

Once we have something like an ldc-add-target tool which downloads & extracts a prebuilt archive and sets up ldc2.conf, we're in very good shape I'd say.

That sounds incredibly useful. Is it already being worked on?

@kinke
Copy link
Member

kinke commented May 9, 2020

Travis is too slow, the only feasible option is Azure Pipelines, which generates all packages (LLVM + LDC) except for the AArch64 Linux ones. LLVM would be a prerequisite (our fork is needed to enable Android cross-compilation etc.) and would thus need to be handled first.
See https://github.com/ldc-developers/llvm-project/blob/ldc-release/10.x/azure-pipelines.yml and https://github.com/ldc-developers/llvm-project/blob/ldc-release/10.x/.azure-pipelines/posix.yml (and the log to get a better understanding).

Is it already being worked on?

See #3345 (comment).

@Geod24
Copy link
Contributor

Geod24 commented May 27, 2020

@kinke : You might also want to consider Github as a CI, given it's quite fast, well integrated, easy to set up, and you don't use it yet.

@kinke
Copy link
Member

kinke commented May 27, 2020

I've already dismissed that one, as there's no real advantage over Azure Pipelines AFAICT (but e.g. only half as many CPU cores for the Mac machines).

@InnotSagg
Copy link

Alpine package still 1.20, add musl release Binaries will be help a lot for alpine users.
https://pkgs.alpinelinux.org/package/edge/community/x86_64/ldc

@kassane
Copy link
Contributor

kassane commented Jul 11, 2024

@JohanEngelen ,
Since #4650. Any chance to add linux-musl binary in CI & final releases?

@JohanEngelen
Copy link
Member

@JohanEngelen , Since #4650. Any chance to add linux-musl binary in CI & final releases?

Yes. working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants