Skip to content

Commit d4a8bab

Browse files
committed
judy: revert Darwin reproducibility fixes
It was already reproducible: the only reason it seemed not to be was due to a quirk of how `--rebuild` works on macOS. Since the implementation of the Nix sandbox on macOS is unable to change the meaning of paths, when rebuilding a derivation, it can't be done at the same path as the original. Instead, the rebuild occurs with a different output path, and the output is scanned for instances of that path so that they can be replaced with the correct one afterwards (ala ca-derivations). Unfortunately, macOS's codesigning system seems to include the hash of the signed binary as part of its signature, including any incorrect paths it contains. This results in the binaries still being different after the path replacement step has occured. The reason to go out of our way to revert this is that the workaround to avoid including the output path in any binaries includes replacing the install name of judy with `@rpath/*` rather than its absolute path, which breaks at least one dependency that doesn't add it to RPATH (gtkwave), and possibly others. To confirm that it's reproducible: ``` drv=$(nix eval .#judy --apply "pkg: (pkg.overrideAttrs { __REBUILD = true; }).drvPath" --raw) out=$(nix derivation show "$drv" | jq -r ".[].outputs.out.path") nix build "$drv^*" --no-link cp -r "$out" rebuild-1 nix store delete "$out" --option keep-outputs false nix build "$drv^*" --no-link cp -r "$out" rebuild-2 diff -r rebuild-1 rebuild-2 ```
1 parent 959931a commit d4a8bab

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

pkgs/by-name/ju/judy/package.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ stdenv.mkDerivation rec {
2323
./fix-source-date.patch
2424
];
2525

26-
# fixes non-determinism between builds on macos
27-
preConfigure = lib.optional stdenv.hostPlatform.isDarwin ''
28-
export LDFLAGS="$LDFLAGS -Wl,-no_uuid -Wl,-install_name,@rpath/libJudy.1.dylib"
29-
'';
30-
3126
# Disable parallel builds as manpages lack some dependencies:
3227
# ../tool/jhton ext/JudyHS_funcs_3.htm | grep -v '^[ ]*$' | sed -e 's/\.C//' > man/man3/JudyHS_funcs
3328
# make[2]: *** No rule to make target 'man/man3/JSLD', needed by 'all-am'. Stop.

0 commit comments

Comments
 (0)