Commit Graph

247 Commits

Author SHA1 Message Date
Matthew Bauer
3777a4af76 bazel: pass -stdlibc=libc++ correctly
Fixes #93787
2020-08-26 15:52:38 -05:00
zowoq
a83a88db05 buildGoPackage: remove platform.all from packages 2020-08-15 19:34:47 -07:00
Wael Nasreddine
866eedcb69
bazel_3: use less resources when building Bazel (#95214)
Limit the resources Bazel is allowed to use during the build to 1/2 the
available RAM and 3/4 the available CPU cores. This should help avoid
overwhelming the build machine.
2020-08-12 10:47:01 -07:00
Profpatsch
595afc2c3f bazel: use installShellCompletion for completions 2020-07-17 15:38:49 +02:00
Profpatsch
a06fda4c5d bazel: add fish completions
bazel 3.3 adds a first version of completions for fish shell.

Tested manually whether fish is able to load the completions.
2020-07-17 15:38:49 +02:00
Profpatsch
2ba87b6e79 bazel: use install for completions
Preserving existing behavior: the bash completion was not executable,
the zsh completion was; according to lukegb the fish completion does
not have to be executable.
2020-07-17 15:38:49 +02:00
Claudio Bley
cda852a528 bazel: 3.3.0 -> 3.3.1 2020-07-01 23:23:33 +02:00
Claudio Bley
388038ff98 bazel-buildtools: 3.2.1 -> 3.3.0 2020-06-24 17:02:23 +02:00
Claudio Bley
21a21a4224 bazel: 3.2.0 -> 3.3.0 2020-06-23 15:29:38 +02:00
Claudio Bley
9836a30422 bazel-buildtools: 3.2.0 -> 3.2.1 2020-06-17 11:11:41 +02:00
Claudio Bley
cd712e625e bazel-buildtools: 2.2.1 -> 3.2.0 2020-06-03 09:37:32 +02:00
Claudio Bley
7172514b72 bazel: 3.1.0 -> 3.2.0 2020-05-29 15:22:35 +02:00
Claudio Bley
1c5386fa1d bazel: Make bazel_3 the default version
* drop bazel_2
* update hashes of fetch derivations that use `buildBazelPackage`
2020-05-29 08:52:17 +02:00
Claudio Bley
c456288170 bazel_3: init at 3.1.0 2020-05-29 08:52:17 +02:00
Matthew Bauer
2a8d05627b build-bazel-package: switch hash mode to “flat”
flat hashes can be substituted through hashed-mirrors, while recursive
hashes can’t. This is especially important for Bazel since the bazel
fetch dependencies can come from multiple different methods (git,
http, ftp, etc.). To do this, we create tar archives from the
output/external directory, which is then extracted to build. All of
the Bazel hashes are all updated.
2020-05-09 13:33:26 -05:00
Mario Rodas
0d995eb6c4
bazel-buildtools: 1.0.0 -> 2.2.1 2020-04-10 04:20:00 -05:00
Michael Reilly
84cf00f980
treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
Mike Sperber
677b2d818e
bazel_0_26: fix linker flags for darwin (#84614)
Same as done for bazel_0_29 in d1ee615f1c:
2020-04-08 18:48:40 -04:00
Profpatsch
955b44b3bd bazel_1: fix test paths 2020-04-08 17:50:32 +02:00
Profpatsch
e8b19c09a5 bazel_2: fix test paths
They did not survive the move into the subdirectory.
2020-04-08 17:50:32 +02:00
John Ericson
6bf6ec8a96 Merge remote-tracking branch 'upstream/master' into consistent-bazel-ref 2020-04-01 16:16:30 -04:00
John Ericson
6f94f8fd3f bazel-*: Consistently self reference
Using `bazel_self` for self-references makes managing bazel versions
easier: their less risk of changing defaults or copy pasted code for no
versions leading to incorrect self-references.
2020-04-01 16:16:26 -04:00
John Ericson
1fa310549c Merge remote-tracking branch 'upstream/master' into add-tensorflow-2 2020-03-30 13:59:16 +00:00
John Ericson
d4de62dedd bazel_0_29: init at 0.29.1
Needed for Tensorflow 2.1
2020-03-30 04:30:40 +00:00
Andreas Rammhold
d7673d7889 bazel_0: init at 0.26.0
(cherry picked from commit 1c0de27df3)
2020-03-25 11:32:39 -04:00
Janne Heß
cfe8e0e1ad pkgs/bazel*: Fix path to update-srcDeps.py
Otherwise, the -small channel fails on the tarball output.

(cherry picked from commit 0723bf3b72)
2020-03-25 11:27:15 -04:00
Michael Lingelbach
3fab55793d Add bazel 1.2.1
(cherry picked from commit 1c4f22a5da)
2020-03-25 11:27:14 -04:00
Andreas Rammhold
1c0de27df3
bazel_0: init at 0.26.0 2020-03-04 16:41:17 +01:00
Andreas Rammhold
4c00e6f654 bazel-remote: fix fixed output derivation hash 2020-03-03 14:35:24 +01:00
Andreas Rammhold
846f300511
Merge pull request #80953 from andir/bazel-poison
buildBazelPackage: poison all the fixed output derivations
2020-03-03 10:39:05 +01:00
Andreas Rammhold
0ff376c03f
bazel-remote: update fixed output hash 2020-03-03 01:12:27 +01:00
Janne Heß
0723bf3b72 pkgs/bazel*: Fix path to update-srcDeps.py
Otherwise, the -small channel fails on the tarball output.
2020-03-02 13:11:14 +01:00
Michael Lingelbach
1c4f22a5da Add bazel 1.2.1 2020-03-02 09:08:47 +01:00
Joao Neves
95c91cebf1 bazel: output correct binary name
From Bazel 2.0.0 onwards, Bazel looks for a binary named
`bazel-${version}-${os_arch}` if the project root contains a
`.bazelversion` file or the USE_BAZEL_VERSION environment
variable is set.

This change ensures we output a binary with the correct name
for the current version and OS/arch combination.
2020-02-28 12:21:22 +01:00
Joao Neves
dd413d4c2d bazel: 2.0.0 -> 2.1.0 2020-02-28 12:21:22 +01:00
Daiderd Jordan
e4af779056
Merge pull request #80635 from marsam/fix-bazel-darwin
bazel: fix build on darwin
2020-02-22 08:52:58 +01:00
Mario Rodas
572a6672d0
bazel-buildtools: add marsam to maintainers 2020-02-20 04:21:00 -05:00
Mario Rodas
d1ee615f1c
bazel: fix linker flags for darwin 2020-02-20 04:20:00 -05:00
Mario Rodas
3dd0593020
bazel-buildtools: 0.29.0 -> 1.0.0 2020-02-20 04:20:00 -05:00
Mario Rodas
2e651faa3c
bazel-remote: 2020-01-29 -> 1.0.0 2020-02-14 04:20:00 -05:00
Uri Baghin
10d1a04b02 bazel-deps: remove 2020-02-04 12:35:47 +11:00
Uri Baghin
3dc9c1b885 bazel-remote: 2019-01-12 -> 2020-01-29 2020-02-04 02:26:15 +01:00
Danju Visvanathan
0a6551f48c bazel: 1.2.1 -> 2.0.0 (#76851)
* bazel: 1.2.1 -> 2.0.0

* .
2020-01-07 17:24:54 +01:00
Guillaume Bouchard
4fdea7312e bazel: bazelRC path set by a patch
In bazel source code change in the future, patch will fail and we'll
detect the regression sooner.
2019-12-05 11:45:36 +01:00
Guillaume Bouchard
1ce0375b2f bazel: close #70911 by conditionally loading system wide configuration
Some system may setup global informations (such as bazel cache location)
in /etc/bazel.bazelrc
2019-12-05 11:17:13 +01:00
Guillaume Bouchard
0cffa85d57 bazel: remove wrapProgram and move it to system configuration
This way, custom configurations are all at the same place. Also, user
may override these settings using the command line.
2019-12-05 11:16:47 +01:00
Guillaume Bouchard
5b9e350fd4 bazel: move configuration file to a proper nix store entry
Easier to read and maintain
2019-12-05 11:02:37 +01:00
Guillaume Bouchard
c0a6fc4a56 bazel: add file and zip in the test runner env
`file` and `zip` are needed for some bazel test and by default the test
runner take these binaries from the current `PATH` which may not contain
them
2019-12-04 12:59:32 +01:00
Guillaume Bouchard
20752ba4f7 bazel: improve strict action env context
- Bazel strict action env set a default PATH to
`/bin/:/usr/bin:/usr/local/bin`. This was previously changed to disable
this behavior to improve hermeticity. However the previous change was
only removing `/bin:/usr/bin`, keeping `/usr/local/bin`, this commit
also remove this entry.
2019-12-04 12:59:32 +01:00
Wael M. Nasreddine
97656e9589
bazel: 1.2.0 -> 1.2.1 2019-11-27 15:36:24 -08:00
Wael M. Nasreddine
48478a1b6e
bazel: 1.1.0 -> 1.2.0 2019-11-25 11:19:14 -08:00
Profpatsch
fbd06addb3 bazel: exclude tests.shebang from running on darwin 2019-10-24 12:16:20 +02:00
Danju Visvanathan
76af684141 bazel: 1.0 -> 1.1 2019-10-22 14:18:12 +11:00
Florian Klink
0fd1df74be bazel_0_4: remove
bazel_0_4 fails to build since 2018-04-29, so clearly nobody is using
it.
2019-10-14 18:33:17 +02:00
Andreas Herrmann
1f3187c1b2 bazel: Comment on python versions. 2019-10-11 21:44:28 +02:00
Andreas Herrmann
1987d86007 bazel: shebang-test: Test for all bin/env ...
Fail on any form of `bin/env ...` shebang.
2019-10-11 21:44:28 +02:00
Andreas Herrmann
f6572b4e64 bazel: patch #!/usr/bin/env bash
To point to the custom bash instead of `/nix/store.../bin/env bash`.
2019-10-11 21:44:28 +02:00
Andreas Herrmann
d132d47199 bazel: shebang-test: pass bazel dir in Nix 2019-10-11 21:44:28 +02:00
Andreas Herrmann
7429acdea1 bazel: Test that all shebangs are patched correctly 2019-10-11 21:44:28 +02:00
Florian Klink
a0380cbfe9 bazel: fix build on macosx 2019-10-11 21:41:23 +02:00
Guillaume Bouchard
7e5b2e74b7 bazel: 0.29 -> 1.0 2019-10-11 21:41:23 +02:00
Uri Baghin
b8ab4451b5 bazel-buildtools: 0.28.0 -> 0.29.0 2019-09-11 15:17:07 +10:00
Vladimír Čunát
4aad2947f8
Merge branch 'master' into staging-next 2019-09-04 11:00:56 +02:00
Guillaume Bouchard
67904dccbb bazel: 0.28.1 -> 0.29.0
- Upgraded dependencies
  - dependencies script upgraded to take into account new WORKSPACE
    rules
- Tests now depends on the `distdir`

Runtime bazel now also depends on the `distdir` setting which appears
in the global configuration file. This increases the bazel closure
size by 85 MO for stuffs which can normally be downloaded at runtime
by bazel. However, any invocation of `buildBazelPackage` (such as in
`bazel-watcher`) may fail in nix sandbox if theses files are not
available at runtime.

If this overhead is too important, we may later evolve to a finer
grained solution, where buildBazelPackage declares the list of
necessary dependencies.
2019-09-03 13:12:53 +02:00
Frederik Rietdijk
ad1d58c622 Merge staging-next into staging 2019-08-31 10:04:20 +02:00
Frederik Rietdijk
fc74ba8291 Merge master into staging-next 2019-08-31 09:50:38 +02:00
Andreas Herrmann
1bf70fd2f1 bazel: cctools runtime dependency on darwin (#66724)
The bazel build patches paths like `/usr/bin/install_name_tool` to refer
to `${cctools}/bin/install_name_tool` instead. If the corresponding
runtime dependency is not denoted, then darwin users can encounter "file
not found" errors, e.g. when they fetch bazel from a binary cache and
don't have `cctools` in their own nix store.
2019-08-30 22:35:33 -06:00
volth
35d68ef143 treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
volth
c814d72b51 treewide: name -> pname 2019-08-17 10:54:38 +00:00
Frederik Rietdijk
fe9a3e3e63 Merge staging-next into staging 2019-08-17 09:39:23 +02:00
Andreas Herrmann
f426173e30 bazel: Fix python stub template
The shebang in the python stub template was incorrectly patched to
```
<store-path>/bin/env python
```
instead of
```
<store-path>/bin/python
```

The reason was that `patchShebangs` was called with `--replace` which is
an unknown argument.
```
patching script interpreter paths in src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt --replace /usr/bin/env python /nix/store/w7gsq8v86hni4ynaqgwwlnlny115ylng-python3-3.7.4/bin/python
find: unknown predicate `--replace'
```

Using `substituteInPlace` instead resolves that issue.

The wrong shebang caused failures of `py_binary` targets due to `python`
not being in `PATH` in certain circumstances.
2019-08-16 18:55:45 +02:00
volth
46420bbaa3 treewide: name -> pname (easy cases) (#66585)
treewide replacement of

stdenv.mkDerivation rec {
  name = "*-${version}";
  version = "*";

to pname
2019-08-15 13:41:18 +01:00
Wael Nasreddine
b3668d68a2
bazel: 0.28.0 -> 0.28.1 (#66402) 2019-08-09 17:30:06 -07:00
Nikolay Amiantov
a956694aba buildBazelPackage: clear markers
Turns out markers are non-deterministic after all and even our patching still
doesn't solve this problem completely. For example (tensorflow deps, this is a
complete diff so actual dependencies don't differ):

30509c30509
< bc527ff00916b15caee38793bca8f294c748df4a256de55c5199281be0489e73  result/@bazel_skylib.marker
---
> 4e0303e815c78df1e43d4b88dfe65e73046e0c6157fb10aa9a4e8b910113cd9c  result/@bazel_skylib.marker
31045c31045
< fa13d04b2316214c3b4008b52546c2d5b633e006f6f019d597bb3f9745bacf7b  result/@bazel_toolchains.marker
---
> b36174bf5535e5157801b6de30c35ee03a03fe57766306393c3d65dd65cbebf4  result/@bazel_toolchains.marker
31144c31144
< b0ce4a3ac29ac22528336dd3a54b5b7af9ecc43bef2a2630713c1981a5cbbb51  result/@build_bazel_rules_swift.marker
---
> 7492528068ec4f8e7ace2ecf8f933ec4e1b2235bd7426ce6f70177919f1cd05e  result/@build_bazel_rules_swift.marker
36245c36245
< be2993536a8233d63251b664caf35b1e7cd57d194ab2a39a293876c232d6bbd0  result/@io_bazel_rules_closure.marker
---
> b6655cc3f2c78525e5a724d8a4e93b1e7f09f1e09fc817d231109e7f39103e88  result/@io_bazel_rules_closure.marker
36329c36329
< 087bc674c9509dfe157400d111db4a13eeb45fc76aeccd490cee9aad6771ecad  result/@io_bazel_rules_docker.marker
---
> f920ec07315ec71e800b05cd22b2a341c0a80807c6e335ee81739b13c532b422  result/@io_bazel_rules_docker.marker
79544d79543
< 85893a05a817036c61f6cd9f8247757baa1654f473c494ce4fc5253c2bbd2790  result/@platforms.marker

And here's an example of differences:

$ cat result-a/@bazel_skylib.marker
7dc7472d37424ba5ec6a5532765bc911
$MANAGED
cat result-b/@bazel_skylib.marker
a8f3f577798201157128e8e9934c4705
$MANAGED

Instead of trying to patch these markers further we now completely clear them.
Nix hacks for ignoring markers are restored and expanded so that we don't even
attempt to parse the marker.
2019-07-31 11:28:06 +03:00
Nikolay Amiantov
7b828532b9 bazel-deps: 2019-02-01 -> 2019-07-11, mark as broken
Also drop preInstall cleanup for dependencies. The reason is while it's more
thorough than default cleanup in buildBazelPackage if such a problem happens we
should fix buildBazelPackage instead. Perhaps even move this (awesome!) snippet
there but it's very slow-running so we'd rather attempt to fix it in other
ways.

Anyway after an update at least .deps build, checked with `nix-build -A --check`.
2019-07-25 17:40:46 +02:00
Nikolay Amiantov
969aec30b6 bazel-remote: mark as broken 2019-07-25 17:40:46 +02:00
Profpatsch
fdee6f4fae bazel: disable dm-sonnet downstream test 2019-07-25 13:27:45 +02:00
Profpatsch
63e0b8b3f9 bazel: execute dm-sonnet test only on linux 2019-07-25 13:27:45 +02:00
Timo Kaufmann
e7e70b7073 bazel: add fixed output test case
Feels like a horrible hack, but it should make sure that downstream
hashes are preserved between bazel versions.
2019-07-25 13:27:45 +02:00
Lefteris Kritikos
6d25177ca8 bazel-buildtools: 0.22.0 -> 0.28.0 2019-07-24 18:57:52 +02:00
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