-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat(build): enable Linux musl builds #483
Conversation
ef17288
to
5dc9b4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we not need to setup musl-tools? i thought github's images didn't include those...
cargo-dist/src/backend/ci/github.rs
Outdated
install_sh | ||
targets: &[&String], | ||
) -> String { | ||
if runner == GITHUB_LINUX_RUNNER && targets.contains(&&"x86_64-unknown-linux-musl".to_owned()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe axoproject has a const for this target triple we can use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, but everywhere else in the file we're just inlining the triples. I figure we should be consistent.
I'm as surprised as you are! But you can see the build succeeded without installing it. I was able to confirm locally; so long as build-essential is installed, I can |
5dc9b4f
to
f212bfd
Compare
It might be worth checking a bigger project that might be pulling in transitive C deps, in case the issues only pop up when gcc gets used in anger -- oranda for instance. |
following @Gankra's comment- i also think this feature is a really good candidate for a publicly advertised prerelease. we can also message folks who have requested this! |
f212bfd
to
18d7514
Compare
Boo, turns out oranda does need it. Adjusted the build to make sure we install it. |
18d7514
to
5e21e0e
Compare
if target.ends_with("linux-musl") | ||
&& self.inner.tools.cargo.host_target.ends_with("linux-gnu") | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, any particular motivation to dropping the "target != host_target" check? (Not sure if it would ever trip, but would it ever be wrong..?)
I was thinking we might want to simplify this + macos down to just "always run rustup if we're not building for host", but that might be too far..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just figure that since this check implicitly contains that check, there's no reason to add the extra conditional.
5e21e0e
to
79487e7
Compare
79487e7
to
ce4a417
Compare
Could you explicitly enable |
@bjorn3 gonna pull this comment out into an issue so we don't miss it! |
This adds support for musl builds on Linux. This currently supports x86_64 but not aarch64, as with glibc. Sample successful build: https://github.com/mistydemeo/cargodisttest/actions/runs/6540051759/job/17759406467 A few notes:
rustup
, which means musl is statically linked instead of dynamically linked like some musl-based distros prefer.Fixes #75.