diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2021-01-02 11:01:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-02 11:01:34 +0100 |
commit | c2884c4011a9496b67ae2ccd8af126854628014b (patch) | |
tree | 5fac6558de0bd7920412e7ab8a324c3cb2735d32 /pkgs/build-support | |
parent | 3050545e41b71b0be996b634b27d3a519f3b8b13 (diff) | |
parent | 61a6d1aae2f20ca7e714480907d87c6419ef1e80 (diff) |
Merge pull request #106954 from r-burns/randomseed
[staging] stdenv: trim random seed to avoid reference cycles
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/setup-hooks/reproducible-builds.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/build-support/setup-hooks/reproducible-builds.sh b/pkgs/build-support/setup-hooks/reproducible-builds.sh index 2d8db6ff7d3c..5b01c213fe4a 100644 --- a/pkgs/build-support/setup-hooks/reproducible-builds.sh +++ b/pkgs/build-support/setup-hooks/reproducible-builds.sh @@ -1,4 +1,9 @@ # Use the last part of the out path as hash input for the build. # This should ensure that it is deterministic across rebuilds of the same # derivation and not easily collide with other builds. -export NIX_CFLAGS_COMPILE+=" -frandom-seed=${out##*/}" +# We also truncate the hash so that it cannot cause reference cycles. +export NIX_CFLAGS_COMPILE+=" -frandom-seed=$( + outbase="${out##*/}" + randomseed="${outbase:0:10}" + echo $randomseed +)" |