fix(buildGo): Use stable build ID when linking outputs
This is another step towards build reproducibility, which Go is traditionally very bad at.
This commit is contained in:
parent
8710df08c8
commit
9ea0363e6f
1 changed files with 2 additions and 2 deletions
|
@ -50,9 +50,9 @@ let
|
||||||
program = { name, srcs, deps ? [] }:
|
program = { name, srcs, deps ? [] }:
|
||||||
let uniqueDeps = allDeps deps;
|
let uniqueDeps = allDeps deps;
|
||||||
in runCommand name {} ''
|
in runCommand name {} ''
|
||||||
${go}/bin/go tool compile -o ${name}.a -trimpath=$PWD ${includeSources uniqueDeps} ${spaceOut srcs}
|
${go}/bin/go tool compile -o ${name}.a -trimpath=$PWD -trimpath=${go} ${includeSources uniqueDeps} ${spaceOut srcs}
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
${go}/bin/go tool link -o $out/bin/${name} ${includeLibs uniqueDeps} ${name}.a
|
${go}/bin/go tool link -o $out/bin/${name} -buildid nix ${includeLibs uniqueDeps} ${name}.a
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Build a Go library assembled out of the specified files.
|
# Build a Go library assembled out of the specified files.
|
||||||
|
|
Loading…
Reference in a new issue