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

Build dist-x86_64-unknown-linux-musl releases #7658

Merged
merged 1 commit into from
Feb 13, 2021
Merged

Build dist-x86_64-unknown-linux-musl releases #7658

merged 1 commit into from
Feb 13, 2021

Conversation

andylizi
Copy link
Contributor

Closes #4956.

$ ls -lh
-rwxr-xr-x    1 root     root       29.7M Feb 13 18:24 rust-analyzer-x86_64-unknown-linux-musl

$ ldd rust-analyzer-x86_64-unknown-linux-musl
        /lib/ld-musl-x86_64.so.1 (0x7f2751f13000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7f2750a78000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f2751f13000)

$ ./rust-analyzer-x86_64-unknown-linux-musl --version
rust-analyzer 63fcf65

I can do aarch64-unknown-linux-musl if it's also needed.

@lnicola
Copy link
Member

lnicola commented Feb 13, 2021

Oh, I didn't realize it was so easy to mix a container and an action 😕.

@lnicola
Copy link
Member

lnicola commented Feb 13, 2021

LGTM, thank you!

bors r+

Do you also want to add support to the Code extension? It's around here, but I'm not sure how to detect that the current distro is based on Musl (except checking /etc/os-release).

https://stackoverflow.com/a/60471114 runs ldd on a random binary, FWIW.

@bors
Copy link
Contributor

bors bot commented Feb 13, 2021

@bors bors bot merged commit 11ebbac into rust-lang:master Feb 13, 2021
@andylizi andylizi deleted the dist-linux-musl branch February 13, 2021 11:27
@lnicola
Copy link
Member

lnicola commented Feb 20, 2021

My understanding is that running Code on Alpine isn't a common thing, so I guess we can punt on the extension support.

@andylizi
Copy link
Contributor Author

Hardly anyone would want to run VS Code itself on Alpine I suppose, but it's much more common when using Dev Container which explicitly supports x86_64 Alpine. When writing Rust applications for Docker container, OpenWRT or other musl-based environments, it's much better to develop and debug in a dev container. That way one doesn't have to go through the trouble of setting up cross compilation, nor will they find their code somehow doesn't work on musl only after having finished it on their glibc machine.

But it's also true after all that the user base for musl is much smaller than glibc. Since properly detecting musl is apparently not easy, how about we add a note or something to the user manual? That way those who have need of it can easily find the information to set it up themselves, instead of being confused by an unhelpful error message like "Cannot activate rust-analyzer: bootstrap error." (which, on that note, can be improved too)

bors bot added a commit that referenced this pull request Feb 20, 2021
7729: Try to detect musl distros in the Code extension r=andylizi a=lnicola

Fixes #7658 (comment)

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
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

Successfully merging this pull request may close these issues.

Build release artifacts for Alpine
2 participants