-
Notifications
You must be signed in to change notification settings - Fork 991
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 static binary on linux #1862
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,17 +60,17 @@ stages: | |
rustup_toolchain: stable | ||
target: 'x86_64-apple-darwin' | ||
linux-stable: | ||
imageName: 'ubuntu-20.04' | ||
imageName: 'rust:alpine' | ||
rustup_toolchain: stable | ||
target: 'x86_64-unknown-linux-gnu' | ||
target: 'x86_64-unknown-linux-musl' | ||
pool: | ||
vmImage: $(imageName) | ||
steps: | ||
- script: | | ||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN | ||
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" | ||
displayName: Install rust | ||
condition: ne( variables['Agent.OS'], 'Windows_NT' ) | ||
condition: eq( variables['Agent.OS'], 'Darwin' ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For Linux the official |
||
- script: | | ||
set CARGO_HOME=%USERPROFILE%\.cargo | ||
curl -sSf -o rustup-init.exe https://win.rustup.rs | ||
|
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.
that would break all the package managers, if you want to add musl, it needs to be another target, not replace the existing one.
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.
Why would it? All the distros compile it themselves, IMO the only use case for a pre-compiled binary is downloading it to some arbitrary system, which we can't make any assumptions about. So it seems to me that for Linux we should ship only static binaries.
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 would rather have both options than only one
Last time I checked musl, performance was significantly worse. It might have been fixed since then but my results were kinda similar to https://andygrove.io/2020/05/why-musl-extremely-slow/
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.
Thanks for pointing this out, I didn't know. I'll close this PR then.