Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/stdenv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,15 @@ installcheck</command>.</para>
in the derivation to enable install checks.</para></listitem>
</varlistentry>

<varlistentry>
<term><varname>noErrorBuildTop</varname></term>
<listitem><para>Allow outputs to capture references to the build
directory. Normally, all outputs are scanned for references to
the build directory and the build aborted if any are found. Such
references are most likely accidental and may make the build
non-reproducible.</para></listitem>
</varlistentry>

<varlistentry>
<term><varname>preInstallCheck</varname></term>
<listitem><para>Hook executed at the start of the installCheck
Expand Down
10 changes: 10 additions & 0 deletions pkgs/stdenv/generic/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,16 @@ installCheckPhase() {
$makeFlags "${makeFlagsArray[@]}" \
$installCheckFlags "${installCheckFlagsArray[@]}" ${installCheckTarget:-installcheck}

if [ -z "$noErrorBuildTop" -a "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_BUILD_TOP" ]; then
for output in $outputs; do
if grep -qr $NIX_BUILD_TOP ${!output} ; then
echo "ERROR: found reference to build path $NIX_BUILD_TOP in the following files"
grep -lr $NIX_BUILD_TOP ${!output}
exit 1
fi
done
done

runHook postInstallCheck
}

Expand Down