-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
rustup: addressing a series of issues encountered while using Rust's self-contained ld.lld
#314268
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
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 |
|---|---|---|
|
|
@@ -48,7 +48,12 @@ rustPlatform.buildRustPackage rec { | |
| checkFeatures = [ ]; | ||
|
|
||
| patches = lib.optionals stdenv.isLinux [ | ||
| (runCommand "0001-dynamically-patchelf-binaries.patch" { CC = stdenv.cc; patchelf = patchelf; libPath = "$ORIGIN/../lib:${libPath}"; } '' | ||
| (runCommand "0001-dynamically-patchelf-binaries.patch" | ||
| { | ||
| CC = stdenv.cc; | ||
| patchelf = patchelf; | ||
| libPath = "${libPath}"; | ||
| } '' | ||
| export dynamicLinker=$(cat $CC/nix-support/dynamic-linker) | ||
| substitute ${./0001-dynamically-patchelf-binaries.patch} $out \ | ||
| --subst-var patchelf \ | ||
|
|
@@ -96,8 +101,23 @@ rustPlatform.buildRustPackage rec { | |
| # Note: fish completion script is not supported. | ||
| $out/bin/rustup completions bash cargo > "$out/share/bash-completion/completions/cargo" | ||
| $out/bin/rustup completions zsh cargo > "$out/share/zsh/site-functions/_cargo" | ||
|
|
||
| # add a wrapper script for ld.lld | ||
| mkdir -p $out/nix-support | ||
| substituteAll ${../../../../../pkgs/build-support/wrapper-common/utils.bash} $out/nix-support/utils.bash | ||
| substituteAll ${../../../../../pkgs/build-support/bintools-wrapper/add-flags.sh} $out/nix-support/add-flags.sh | ||
| substituteAll ${../../../../../pkgs/build-support/bintools-wrapper/add-hardening.sh} $out/nix-support/add-hardening.sh | ||
| export prog='$PROG' | ||
| export use_response_file_by_default=0 | ||
| substituteAll ${../../../../../pkgs/build-support/bintools-wrapper/ld-wrapper.sh} $out/nix-support/ld-wrapper.sh | ||
| chmod +x $out/nix-support/ld-wrapper.sh | ||
| ''; | ||
|
|
||
| env = lib.optionalAttrs (pname == "rustup") { | ||
| inherit (stdenv.cc.bintools) expandResponseParams shell suffixSalt wrapperName coreutils_bin; | ||
| hardening_unsupported_flags = ""; | ||
| }; | ||
|
Member
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. I wonder if we could make a better regression test here, given the growing complexity of machinery that gets added here? If we cannot make it pure, even a self-contained test script would be nice i.e. based on the example project that you already provided.
Contributor
Author
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. Sure, we do need a test case. I plan to add an internal test case for the rustup project in a subsequent PR. |
||
|
|
||
| meta = with lib; { | ||
| description = "The Rust toolchain installer"; | ||
| homepage = "https://www.rustup.rs/"; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.