New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bazel: 0.4.5 -> 0.5.3 #27861
bazel: 0.4.5 -> 0.5.3 #27861
Conversation
@sigma, thanks for your PR! By analyzing the history of the files in this pull request, we identified @izuk, @IreneKnapp and @benley to be potential reviewers. |
postPatch = '' | ||
makeWrapper "${bash}/bin/bash" "$out/bin/bash" --argv0 '$0' --prefix PATH : ${coreutils}/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make sense to hide this $out/bin/bash
somewhere other than $out
, which might otherwise cause confusion when using buildEnv
and friends (since a certain other package also contains a bin/bash
😄)
I think we should also keep the old version, for the time being; I tried applying this to my branch where I'm building Envoy (#27629), but I get this failure with 0.5.3:
|
To address @copumpkin's point, I'd suggest doing something like this: diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix
index dcdc55f0ae..84ca80f5f4 100644
--- a/pkgs/development/tools/build-managers/bazel/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/default.nix
@@ -1,8 +1,23 @@
-{ stdenv, fetchurl, jdk, zip, unzip, bash, makeWrapper, which }:
+{ stdenv, fetchurl, jdk, zip, unzip, bash, makeWrapper, which, coreutils, symlinkJoin }:
+
+let
+ bashEnv =
+ symlinkJoin {
+ name = "bazel-bash-env";
+ paths = [ coreutils ];
+ buildInputs = [ makeWrapper ];
+ postBuild = ''
+ makeWrapper "${bash}/bin/bash" "$out/bin/bash" \
+ --argv0 '$0' \
+ --prefix PATH : "$out/bin"
+ '';
+ };
+
+in
stdenv.mkDerivation rec {
- version = "0.4.5";
+ version = "0.5.3";
meta = with stdenv.lib; {
homepage = http://github.com/bazelbuild/bazel/;
@@ -16,14 +31,15 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-dist.zip";
- sha256 = "0asmq3kxnl4326zhgh13mvcrc8jvmiswjj4ymrq0943q4vj7nwrb";
+ sha256 = "0csk3jzi3dvs24y9cmhlsbjyfv5pqddnqqkx3ywza58b1a4cbdbn";
};
sourceRoot = ".";
+ # bazel expects bash to find coreutils when starting from an empty environment
postPatch = ''
for f in $(grep -l -r '#!/bin/bash'); do
- substituteInPlace "$f" --replace '#!/bin/bash' '#!${bash}/bin/bash'
+ substituteInPlace "$f" --replace '#!/bin/bash' '#!'${bashEnv}/bin/bash
done
for f in \
src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java \
@@ -31,7 +47,7 @@ stdenv.mkDerivation rec {
src/main/java/com/google/devtools/build/lib/bazel/rules/sh/BazelShRuleClasses.java \
src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java \
; do
- substituteInPlace "$f" --replace /bin/bash ${bash}/bin/bash
+ substituteInPlace "$f" --replace /bin/bash ${bashEnv}/bin/bash
done
'';
|
FYI I think bazel 0.5.3 has some known issues; 0.5.4 should be out pretty soon to fix things |
Motivation for this change
Things done
Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers.
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)