-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
rustc: patch the path to llvm-strip instead of using /usr/bin/strip
on darwin
#362388
Conversation
/usr/bin/strip
on darwin
substituteInPlace compiler/rustc_codegen_ssa/src/back/link.rs \ | ||
--replace-fail \ | ||
'let stripcmd = if cfg!(target_os = "macos") { "/usr/bin/strip" } else { "strip" };' \ | ||
'let stripcmd = "${lib.getExe' llvmPackages.llvm "llvm-strip"}";' |
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.
Shouldn't this be llvmShared, so we don't end up referencing multiple LLVMs?
(Would appreciate input from somebody who understands all the LLVMs involved here better than me.)
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.
could we punt on understanding the LLVMs and just use ${lib.getExe' stdenv.cc "strip"}
?
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.
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.
could we punt on understanding the LLVMs and just use
${lib.getExe' stdenv.cc "strip"}
?
eh, maybe that is even worse due to the symlinks. disregard.
4f6016c
to
e2a54e9
Compare
e2a54e9
to
464187c
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.
LGTM. on staging-next
built rustc & cargo outside sandbox on aarch64-darwin and then built ruff
in sandbox = relaxed;
and built fine.
$ nix-store --query -R /nix/store/swy0zgm75f6385njibppbplsxqb8x9f6-rustc-1.83.0
/nix/store/1w5wdysl1sqnwxaa6j4j4llss93jfn5z-libiconv-107
/nix/store/1k3h865wpr3fzi1mp0j8lndnmmcdr4wr-libxml2-2.13.4
/nix/store/icai2b2bh2rrlhlhnasansdr0p1p7am6-zlib-1.3.1
/nix/store/s17z21xw3p164z0nlgd4v7h4jlr30sjq-libffi-3.4.6
/nix/store/x6xs2b06am37bx45xr59qi14bbws8s34-libcxx-19.1.4
/nix/store/7b9pbhkcqsww1miks3zql7qnqid38qa7-llvm-19.1.4-lib
/nix/store/ggbsv8vxj759k624wi6xvw1yfhi8j59k-bash-5.2p37
/nix/store/px76sq9i5mx39g17bsaj379yhqhdz9w7-llvm-19.1.4
/nix/store/swy0zgm75f6385njibppbplsxqb8x9f6-rustc-1.83.0
I'll optimistically merge already. |
Things done
Rust calls hardcoded
/usr/bin/strip
on darwin.This leads to build failures in the sandbox.
Instead, hardcode the path to our own
llvm-strip
binary.cc @alyssais @reckenrode @Havvy
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.