Merge pull request #106954 from r-burns/randomseed

[staging] stdenv: trim random seed to avoid reference cycles
This commit is contained in:
Andreas Rammhold
2021-01-02 11:01:34 +01:00
committed by GitHub

View File

@@ -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
)"