summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReno Dakota <paparodeo@proton.me>2024-12-30 10:37:55 +0000
committerReno Dakota <paparodeo@proton.me>2024-12-30 10:37:55 +0000
commit2546152ca025c7f3d22fd1e3c2eb85e96fa61093 (patch)
tree1517e7f530b06dec2a69b56099d9ce21375805b8
parentpython312Packages.mypy: fix test with Python 3.12.7 (diff)
downloadnixpkgs-2546152ca025c7f3d22fd1e3c2eb85e96fa61093.tar.gz
rustfmt-nightly: add -headerpad_max_install_names x64 darwin
fix failing install_name_tool not having enough space to write the path into the binary > error: install_name_tool: changing install names or rpaths can't be redone for: /nix/store/.../git-rustfmt (for architecture x86_64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)
-rw-r--r--pkgs/development/compilers/rust/rustfmt.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/development/compilers/rust/rustfmt.nix b/pkgs/development/compilers/rust/rustfmt.nix
index bf41bcc2f018..8f9d83d548c3 100644
--- a/pkgs/development/compilers/rust/rustfmt.nix
+++ b/pkgs/development/compilers/rust/rustfmt.nix
@@ -33,6 +33,11 @@ rustPlatform.buildRustPackage rec {
install_name_tool -add_rpath "${rustc.unwrapped}/lib" "$out/bin/git-rustfmt"
'';
+ env = lib.optionalAttrs (asNightly && stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
+ # give install_name_tool enough space so preFixup doesn't fail
+ NIX_LDFLAGS = "-headerpad_max_install_names";
+ };
+
# As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler
RUSTC_BOOTSTRAP = 1;