mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
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:
parent
398f9a2335
commit
fa6c5c3dc7
@ -122,6 +122,8 @@ in stdenv.mkDerivation (fBuildAttrs // {
|
|||||||
|
|
||||||
cp -r $bazelOut/external $out
|
cp -r $bazelOut/external $out
|
||||||
|
|
||||||
|
echo '${bazel.name}' > $out/.nix-bazel-version
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -143,6 +145,14 @@ in stdenv.mkDerivation (fBuildAttrs // {
|
|||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
mkdir -p "$bazelOut"
|
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
|
cp -r $deps $bazelOut/external
|
||||||
chmod -R +w $bazelOut
|
chmod -R +w $bazelOut
|
||||||
find $bazelOut -type l | while read symlink; do
|
find $bazelOut -type l | while read symlink; do
|
||||||
|
Loading…
Reference in New Issue
Block a user