goBuildPackage: Add -x to the go build command if NIX_DEBUG >= 1

The -x go option prints all intermediate commands used by the Go
compiler. For instance, this is pretty useful to debug Go LD_FLAGS
because the used linker command is printed.
This commit is contained in:
Antoine Eiche 2018-07-17 15:19:26 +02:00
parent 12949bf84a
commit 05df6d4f62

View file

@ -151,6 +151,10 @@ go.stdenv.mkDerivation (
fi
}
if (( "''${NIX_DEBUG:-0}" >= 1 )); then
buildFlagsArray+=(-x)
fi
if [ ''${#buildFlagsArray[@]} -ne 0 ]; then
declare -p buildFlagsArray > $TMPDIR/buildFlagsArray
else