Commit Graph

89 Commits

Author SHA1 Message Date
Félix Baylac-Jacqué
a5aca72f93 bazel: 0.21.0 -> 0.22.0 2019-01-30 14:57:32 +01:00
Philip Patsch
5c6892e1a2 bazel: fix java toolchain regression
By changing the default toolchain to JDK8, we broke the default Java
toolchain, which assumes JDK9.

Instead, set `host_java_toolchain` manually for our build of bazel,
and set `java_toolchain` to run the java tests with the build JDK as
well.

Fixes https://github.com/NixOS/nixpkgs/issues/54289
2019-01-29 14:03:54 +01:00
Robin Palotai
566539ff55 Add test and docs. 2019-01-26 22:22:34 +01:00
Robin Palotai
d3199ddaa7 Add gzip and gnutar to default bazel-bash tools. These are often used by rules, mostly due to Bazel's one-output rule. 2019-01-26 22:22:34 +01:00
Profpatsch
88fa235e63 bazel: camel-case python_bin_path 2019-01-22 21:28:24 +01:00
Philip Patsch
25cd44063f bazel: add python to the runtime closure 2019-01-22 21:28:24 +01:00
Robin Palotai
68436aec2c Add awk as a default tool for Bazel shell commands.
Apparently
e292e0452f/bazel/gflags.bzl (L8)
assumes it should be accessible. Normally we could ask them to fix, but
I would expect awk to be a commonly assumed.

The rough search
https://github.com/search?q=filename%3ABUILD+genrule+awk&type=Code
brings ~1K hits.
2019-01-19 11:07:00 +01:00
Orivej Desh
052db93d8f bazel: fix patches after #53988 2019-01-16 00:54:56 +00:00
Félix Baylac-Jacqué
57004738b1 bazel: fix python stub paths.
Since the 0.21 upgrade, the host `$PATH` is not forwarded anymore by
default to the sandboxes in charge to realize Bazel actions. This
default change broke the `py_binary` rule among other things.

Every python binary is wrapped in a stub in charge to setup the
execution environment. Currently, this stub's shebang points to a
`/usr/bin/env python` which cannot be resolved with the current
`$PATH`.
This results in breaking any build pipeline requiring the use of
python at some point. On top of the incorrect shebang, the stub
template is unable to find the actual python binary using
`SearchPath`.

This PR fixes those two things by re-writing the stub template shebang
to the actual python binary and by substituting the faulty default
python binary lookup to the right one.
2019-01-15 19:25:24 +01:00
Profpatsch
9e9fec640e bazel: 0.20.0 -> 0.21.0
0.21 removed the bundled openjdk-distribution. Instead, tries to fetch
the “right” distribution on-the-fly when building.
So we need to provide our own openjdk.

According to
https://github.com/bazelbuild/bazel/issues/6865#issuecomment-447261288
we should set `--host_javabase="@local_jdk//:jdk` if we want to do
that. This uses the jdk that is currently in the environment, which is
openjdk 8 in our case. 0.21 defaulted to a toolchain for JDK9, which
we don’t package in nixpkgs, so we use the JDK8 toolchain.

This commit also replaces the line-number-based sed invocations with
something more stable.
2019-01-10 18:46:25 +01:00
Will Dietz
7e31406886 bazel: greatly reduce time spent substituting, be smart which files
Files inspected: 2756 -> 40
Total size of inspected files: 20M -> 1016K
2019-01-10 18:46:25 +01:00
Mathieu Boespflug
53e8258a45 bazel: fix sandbox execution
Bazel runs actions in a sandbox by default on Darwin and Linux.
However, the sandboxing was always and *silently* disabled previously,
because a Bazel feature test was always failing. The feature test
involved running `/bin/true` inside a sandbox. But on NixOS,
`/bin/true` does not exist...
2018-12-20 15:18:34 +01:00
Mathieu Boespflug
6f5014e0ae bazel: 0.18.0 -> 0.20.0 2018-12-14 11:02:25 +01:00
Mathieu Boespflug
463498e3fa bazel: Don't perform the checkPhase, since it's redundant with installCheckPhase.
This change is going to be required when upgrading to Bazel 0.20.0,
because in the checkPhase we're not wrapping the Bazel binary yet to
set some necessary default arguments.
2018-12-14 11:02:25 +01:00
Profpatsch
cc6d5b34fa bazel: refactor tests a bit 2018-11-08 11:25:18 +01:00
Andy Scott
e4fbd57165 bazel: add tests for boostrap script behavior 2018-11-08 11:25:18 +01:00
Andy Scott
02b2f62d65 bazel: support tools/bazel workspace bootstrap scripts
Bazel supports per-workspace bootstrap scripts at $WORKSPACE_ROOT/
tools/bazel. This adds support for this behavior, which is needed
by many Bazel projects (OSS and private).
2018-11-08 11:25:18 +01:00
Uri Baghin
71449e70e9 bazel-deps: 2018-08-16 -> 2018-11-01 2018-11-04 20:26:07 +11:00
Uri Baghin
1c7d38bcfb bazel: 0.17.1 -> 0.18.0 2018-10-18 10:21:13 +02:00
catern
0ec21495ed bazel-buildtools: upgrade to 2018-10-11 (#48243) 2018-10-14 17:08:33 +02:00
Uri Baghin
61dbb0c74e bazel: 0.16.1 -> 0.17.1 2018-09-17 17:04:51 +02:00
Wael M. Nasreddine
d24f81b825
bazel: 0.16.0 -> 0.16.1 2018-09-10 21:34:41 -07:00
Uri Baghin
d1818ad6b1 bazel: add bazel_jdk10 variant 2018-09-10 23:33:21 +10:00
Philip Patsch
91a876e06f bazel: add upstream patch of perl replacement 2018-08-28 16:12:53 +02:00
regnat
98edb207cd bazel: 0.15.2 -> 0.16.0 2018-08-27 13:14:55 +02:00
Uri Baghin
487773fb0b bazel-deps: update to 2018-08-16 (#45499) 2018-08-23 15:45:39 +02:00
Profpatsch
ec3c3c824e bazel: substitute the perl path for bash completions 2018-08-21 20:12:23 +02:00
Profpatsch
c53e004257 bazel: distinguish darwin patches from generic patches
The '' + '' somewhere in the middle is easily missed and extremely
inelegant.

Also removes unnecessary `stdenv` qualifiers from calls to `lib`.
2018-08-21 20:12:23 +02:00
Wael M. Nasreddine
9c5b7cc5d1 bazel: patch //tools/bash/runfiles/runfiles.bash to include defaultShellPath in PATH
closes #43955
2018-08-17 10:51:03 +02:00
Uri Baghin
8c802d42ad bazel: fix darwin build on hydra 2018-08-13 08:32:27 +02:00
Uli Baum
33b71398fc bazel_0_4: mark as broken
build has failed since 2018-04-29
2018-08-07 16:53:36 +02:00
Benjamin Staffin
28e11a0b6b
bazel: fix bash completion, halve build time (#44097)
This finally fixes the build to avoid having to completely rebuild
bazel from source a second time just to generate the bash completion
script!

It also makes completion actually _work_ for bash users by
correcting the name of the installed script.
2018-07-27 14:45:43 -04:00
Benjamin Staffin
9cbe75b269
bazel: 0.15.1 -> 0.15.2 (#44094) 2018-07-27 14:43:15 -04:00
Pascal Wittmann
ba893d4e49
bazel-buildtools: add version to name
see issue #43717
2018-07-20 22:50:48 +02:00
Mathieu Boespflug
c27f686a4b bazel: Set a sensible strict action environment.
Bazel either reuses the `PATH` from the client, or sets a hardcoded
one. The former mode in problematic for build hermeticity. But the
latter is crippled on NixOS, because the hardcoded value is
`/bin:/usr/bin`. So we set the hardcoded value to match what
`customBash` provides. This has the effect of aligning the
environments for `ctx.actions.run` and `ctx.actions.run_shell`, which
were previously distinct (bug).
2018-07-19 09:51:09 +02:00
Mathieu Boespflug
5ab07a8041 bazel: make more tools available in customBash. 2018-07-19 09:51:09 +02:00
Profpatsch
75942f96b3 bazel: 0.15 -> 0.15.1 2018-07-17 10:12:39 +02:00
Mathieu Boespflug
62f3bf7509 bazel: make the build --sandbox compatible by building extra deps separately. 2018-07-17 10:12:39 +02:00
Mathieu Boespflug
d23e72ebf7 bazel: 0.13.0 -> 0.15.0
Upgrade to latest Bazel.
2018-07-17 10:12:39 +02:00
Pascal Wittmann
4a35e7ef1d
Merge pull request #43503 from volth/bazel-private-tmp
bazel: use per-user tmp directory to avoid conflict with other builders
2018-07-15 22:22:47 +02:00
volth
2a7aa43c16 bazel: use per-user tmp directory to avoid conflict with other builders 2018-07-13 23:35:28 +00:00
Profpatsch
adbd3ead27 Revert "bazel: fix darwin build on hydra" 2018-07-13 14:15:37 +02:00
Uri Baghin
ed98822350 bazel-deps: init at 2018-05-31 (#43018) 2018-07-09 22:38:45 +00:00
Uri Baghin
cd3723bd04 bazel: fix darwin build on hydra 2018-07-01 11:15:48 +10:00
Uri Baghin
6b6ccebc6f bazel: fix darwin 2018-06-26 17:58:33 +10:00
Mathieu Boespflug
06eeb0d158 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.
2018-06-25 12:46:19 +02:00
Mathieu Boespflug
6f03c349ed bazel: Set mboes as maintainer
As per #39585
2018-06-23 10:45:48 +02:00
Mathieu Boespflug
722fcfc4ea bazel: 0.12 -> 0.13 2018-06-23 10:45:43 +02:00
Uri Baghin
8bf1a5c469 bazel: fix darwin build 2018-06-13 15:32:16 +10:00
Uri Baghin
274bb96073 bazel: add darwin support 2018-06-12 23:23:51 -04:00