Commit Graph

117 Commits

Author SHA1 Message Date
Nikolay Amiantov
4dad0ae560 buildBazelPackage: cleanup hacks and enforce them for all builds
Timestamp verification skip is no longer needed (not sure why). Generally we
better off always using the environment hack for all packages because that
ensures all NIX_* flags are correctly applied.

One possible improvement in future is to filter only NIX_* variables to
passthru in Bazel.
2019-07-17 10:40:38 +03:00
Wael Nasreddine
c4813515ca
bazel: drop absolute Python path (#64903)
Without this Bazel always picks Python 3 which breaks Python 2 packages.
Strangely enough just dropping this patch works, with all `bazel.tests`
passing.
2019-07-16 20:17:27 -07:00
Guillaume Bouchard
950da6263f bazel: 0.27.0 -> 0.28.0 2019-07-16 17:43:18 +02:00
Nikolay Amiantov
bd98f3521c bazel: drop absolute Python path
Without this Bazel always picks Python 3 which breaks Python 2 packages.
Strangely enough just dropping this patch works, with all `bazel.tests`
passing.
2019-07-16 15:40:03 +03:00
Guillaume Bouchard
d363da72cc bazel: Use --distdir for prefetched repositories
--distdir is now used in the installCheckPhase for prefetched
  repositories. That's simpler, more robust and easier to extend in
  the future.

Note that `name` argument of fetchurl was removed because it changed
the basename of the generated file and bazel uses this basename for
its cache behavior.
2019-07-12 22:32:01 +02:00
Wael Nasreddine
7f69cab8a6
bazel: add a test asserting java and java proto (#63927) 2019-07-01 21:18:02 -07:00
Wael Nasreddine
c49b7f64d1
bazel: fix the compilation of .proto on Darwin (#63879)
On Darwin, the last argument to GCC is coming up as an empty string.
This is breaking the build of proto_library targets. However, I was not
able to reproduce with the example cpp project[0].

This commit patches the cc_wrapper of Bazel that gets installed on
Darwin to remove the last argument if it's an empty string. This is
not a probem on Linux.

[0]: https://github.com/bazelbuild/examples/tree/master/cpp-tutorial/stage3
2019-06-29 11:07:21 -07:00
Guillaume Bouchard
d086d45952 Fix source url for java tools on darwin 2019-06-24 11:41:43 +02:00
Guillaume Bouchard
27d4ce7ce0 bazel: Full switch to python3 2019-06-22 21:46:50 +02:00
Guillaume Bouchard
7fed6eabcf bazel: restore installCheckPhase
All the dependencies of this phase are prefetched and provided to the
bazel environment using --override_repository.
2019-06-22 21:46:50 +02:00
Guillaume Bouchard
ba327a54b6 bazel: 0.26.1 -> 0.27.0
- Fixs for newly introduced bin/bash hardcoded reference
- Bazel now references `remote_java_tools_xxx` which contains prebuilt
  binaries. We prefetch them, fix them, and force bazel to use the
  fixed repository.

It also closes #63096
2019-06-22 21:46:50 +02:00
Profpatsch
8ce4463d4a bazel: add update script to update srcDeps from WORKSPACE file 2019-06-18 17:47:01 +02:00
volth
f3282c8d1e treewide: remove unused variables (#63177)
* treewide: remove unused variables

* making ofborg happy
2019-06-16 19:59:05 +00:00
Wael Nasreddine
bad7bc44db bazel: fix nix-hacks.patch with the latest version of Bazel (#63052)
* bazel: add a failing test for nix-hacks

* fix the patch
2019-06-13 16:12:37 +02:00
Wael M. Nasreddine
f41667a774 bazel: 0.26.0 -> 0.26.1 2019-06-12 18:35:51 +02:00
Profpatsch
5d238e45de bazel: run the tests on all supported platforms 2019-06-12 14:09:42 +02:00
Profpatsch
629c050b5d bazel.tests: prebuild the bazel self-extraction to speed up test
Factor out the common parts of tests & cache the bazel
self-extraction (ugh) to a common store path.
2019-06-12 14:09:42 +02:00
Profpatsch
44f97b56d9 bazel: move the python test to py_binary
`py_test` tries to download unnecessary dependencies at runtime. We
can just as well run it to check the assertion.

Upstream issue: https://github.com/bazelbuild/bazel/issues/8575
2019-06-12 14:09:42 +02:00
Greg Roodt
dd2a0f6c4a bazel: 0.24.0 -> 0.26.0 2019-06-12 14:09:42 +02:00
Matthew Bauer
81a9b46ee8 bazel: use llvm6 on darwin
https://hydra.nixos.org/build/92942635
2019-05-07 19:43:46 -04:00
Daiderd Jordan
2e2ab461b7
Merge pull request #58147 from groodt/greg/bazel-0.23.2
bazel: 0.22.0 -> 0.24.0
2019-04-02 08:38:39 +02:00
Greg Roodt
d019fd8c8a bazel: 0.22.0 -> 0.24.0 2019-03-31 13:46:53 +11:00
Silvan Mosberger
555734eded bazel: Fix PATH escaping 2019-03-29 20:31:04 +01:00
Uri Baghin
130d987ab1 bazel-remote: init at 2019-01-12 2019-03-11 11:10:59 +01:00
Aaron Bull Schaefer
1b3b781d60 bazel-buildtools: unstable -> 0.22.0 2019-03-07 20:37:23 -08:00
Jörg Thalheim
dadc7eb329
treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
2019-02-26 14:10:49 +00:00
Carlos Morera de la Chica
9c406336f1 bazel: fix bash completion 2019-02-18 11:34:35 +01:00
Uri Baghin
2b2854e522 bazel-deps: 2018-11-01 -> 2019-02-01 2019-02-01 17:30:36 +11:00
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