buildBazelPackage: prime fixed output derivations

All bazel fixed output derivations should be specific to the bazel
version that was used to generate them. There is not guarantee that the
build will still succeed or reproduces (without the cached fixed output)
if the fetch phase wasn't rerun with a different bazel version.

In the past bazel had been bumped but not all those packages that have
fixed outputs from bazel builds. This lead to compiling and somewhat
working TF versions that couldn't be reproduced without the cached fixed
outputs.
This commit is contained in:
Andreas Rammhold 2020-02-19 14:50:12 +01:00
parent 398f9a2335
commit fa6c5c3dc7
No known key found for this signature in database
GPG Key ID: E432E410B5E48C86

View File

@ -122,6 +122,8 @@ in stdenv.mkDerivation (fBuildAttrs // {
cp -r $bazelOut/external $out
echo '${bazel.name}' > $out/.nix-bazel-version
runHook postInstall
'';
@ -143,6 +145,14 @@ in stdenv.mkDerivation (fBuildAttrs // {
preConfigure = ''
mkdir -p "$bazelOut"
test "${bazel.name}" = "$(<$deps/.nix-bazel-version)" || {
echo "fixed output derivation was built for a different bazel version" >&2
echo " got: $(<$deps/.nix-bazel-version)" >&2
echo "expected: ${bazel.name}" >&2
exit 1
}
cp -r $deps $bazelOut/external
chmod -R +w $bazelOut
find $bazelOut -type l | while read symlink; do