about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorMathieu Boespflug <mboes@tweag.net>2018-06-25 12:46:19 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-06-25 12:46:19 +0200
commit06eeb0d158829287bb26e01b6ffcf44955c876e1 (patch)
tree2333efba62730307a7cfa99d20fcf25c7f0f00df /pkgs/development
parentbe9240bfd613c4515de84072147ba90cb5056ea2 (diff)
downloadnixlib-06eeb0d158829287bb26e01b6ffcf44955c876e1.tar
nixlib-06eeb0d158829287bb26e01b6ffcf44955c876e1.tar.gz
nixlib-06eeb0d158829287bb26e01b6ffcf44955c876e1.tar.bz2
nixlib-06eeb0d158829287bb26e01b6ffcf44955c876e1.tar.lz
nixlib-06eeb0d158829287bb26e01b6ffcf44955c876e1.tar.xz
nixlib-06eeb0d158829287bb26e01b6ffcf44955c876e1.tar.zst
nixlib-06eeb0d158829287bb26e01b6ffcf44955c876e1.zip
bazel: Don't hardcode build tools (#42552)
Bazel is a build tool, much like Make and many others. Like Make, it
should be agnostic to the compiler toolchains the user brings into
scope. Bazel has special rules that encode domain specific knowledge
for how to compile a C++ program, or indeed a Java program and a few
others. But that's not to say that at runtime Bazel should assume
a specific C++ compiler or Java compiler anymore than Make does.

The main impact of this change is that packages that build with Bazel
will have to list the compilers they want in their `buildInputs` or
similar, rather than relying on the `bazel` package pulling them in
transitively.
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/tools/build-managers/bazel/default.nix3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix
index 1dac9513f948..8cb137aeda35 100644
--- a/pkgs/development/tools/build-managers/bazel/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/default.nix
@@ -114,11 +114,10 @@ stdenv.mkDerivation rec {
         examples/java-native/src/test/java/com/example/myproject:hello
   '';
 
-  # Bazel expects gcc and java to be in the path.
   installPhase = ''
     mkdir -p $out/bin
     mv output/bazel $out/bin
-    wrapProgram "$out/bin/bazel" --prefix PATH : "${lib.makeBinPath [ stdenv.cc jdk ]}"
+    wrapProgram "$out/bin/bazel" --set JAVA_HOME "${jdk}"
     mkdir -p $out/share/bash-completion/completions $out/share/zsh/site-functions
     mv output/bazel-complete.bash $out/share/bash-completion/completions/
     cp scripts/zsh_completion/_bazel $out/share/zsh/site-functions/