TL;DR: Could someone please suggest the correct way to make the tiny change Comparing NixOS:master...Smaug123:aarch-signing · NixOS/nixpkgs · GitHub , which is my non-working attempt?
Why I’m making this change: I’m building a flake (A flake.lock from my machine · Smaug123/lean4@f3723b6 · GitHub) on Monterey, Apple Silicon, and getting the following log:
> ld: warning: directory not found for option '-L/nix/store/smpng2rrp1dfnik729h4gg917mm0y4ws-leanc/lib/lean'
> libc++abi: terminating with uncaught exception of type std::runtime_error: Failed to spawn codesign_allocate: No such file or directory
> /nix/store/apxhw055i0z86i3m27xn81w0qg2ssp1q-post-link-sign-hook: line 2: 83986 Abort trap: 6 CODESIGN_ALLOCATE=codesign_allocate /nix/store/hr987fj9ib6v70mmi9jiw5iykkc0zi2f-sigtool-0.1.2/bin/codesign -f -s - "$linkerOutput"
> clang-11: error: linker command failed with exit code 134 (use -v to see invocation)
This error appears to come from nixpkgs/darwin-packages.nix at 283d622397539f196416657da9dc804a4ca89846 · Smaug123/nixpkgs · GitHub .
I believe the root cause is that codesign_allocate
is not on the path, and that the correct fix is to refer to it explicitly within the store. There’s a few of it floating around my store (one example being /nix/store/380ds19rqnzkq8s7hvykxgz96fcsnk6z-cctools-binutils-darwin-949.0.1/bin/codesign_allocate
).
I’ve produced Comparing NixOS:master...Smaug123:aarch-signing · NixOS/nixpkgs · GitHub as an attempt to fix this, but it doesn’t work: a run of nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
results in an enormous stack trace which starts as follows:
error: value is a string while a set was expected
at /Users/patrick/.cache/nixpkgs-review/rev-b737b8f4416ee50654ff6fe8ce9b780855aa0755-1/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix:20:7:
19| mv $out/lib/libiconv.dylib $out/lib/libiconv-nocharset.dylib
20| ${stdenv.cc.bintools.targetPrefix}install_name_tool -id $out/lib/libiconv-nocharset.dylib $out/lib/libiconv-nocharset.dylib
| ^
21|
… while evaluating the attribute 'cc.bintools.targetPrefix'
at /Users/patrick/.cache/nixpkgs-review/rev-b737b8f4416ee50654ff6fe8ce9b780855aa0755-1/nixpkgs/pkgs/stdenv/generic/default.nix:168:14:
167|
168| inherit cc hasCC;
| ^
169| }
At this point I’m simply lost. Can anyone help?