Commit Graph

368 Commits

Author SHA1 Message Date
Malte Poll
b1dcea4773 bazel: use bash with fallback $PATH consisting of basic shell utils
Second iteration of this change.
First attempt did not ensure `bashWithDefaultShellUtils` is available at runtime.
2023-11-11 13:22:20 +01:00
Bjørn Forsman
7e41495103 Revert "bazel: use bash with fallback $PATH consisting of basic shell utils"
This reverts commit 3576806d7e.

It broke python311.pkgs.jaxlib, see
https://github.com/NixOS/nixpkgs/pull/265041#issuecomment-1806784693.
2023-11-11 12:34:28 +01:00
Malte Poll
3576806d7e bazel: use bash with fallback $PATH consisting of basic shell utils 2023-11-11 00:25:53 +01:00
Claudio Bley
c871ce0f51 bazel_6: Fix pythonBinPath and pythonBinPathWithNixHacks tests
The tests started to fail after the repo-wide python 3.10 -> 3.11 update.

This is caused by Bazel's py_binary rule setting the [`PYTHONSAFEPATH`][1]
environment variable, which only has an effect for Python >= 3.11.

Setting this variable avoids prepending the current working directory and the
script's directory. The current test code relied on this behavior and thus
failed with:

```
Traceback (most recent call last):
  File "/build/.cache/bazel/_bazel_build/8bcfff1c77854f2a2b07d1413b0fc106/execroot/our_workspace/bazel-out/k8-fastbuild/bin/python/bin.runfiles/our_workspace/python/bin.py", line 6, in <module>
    from lib import foo
ModuleNotFoundError: No module named 'lib'
```

See also [bazelbuild/bazel#7091][2]

[1]: https://docs.python.org/3.11/using/cmdline.html#envvar-PYTHONSAFEPATH
[2]: https://github.com/bazelbuild/bazel/issues/7091
2023-10-30 09:43:28 +01:00
Claudio Bley
932ee614a4 bazel_6: 6.3.2 -> 6.4.0 2023-10-26 08:28:19 +02:00
Claudio Bley
73654d2367 bazel_6: Remove .bazelversion file in the updater sources 2023-10-26 08:28:19 +02:00
Harsh Modi
a8f616d11c bazel_6: Add diffutils and gnupatch to initialEnvironment
Nix's version of bazel has custom patches to make bazel more hermetic when used with nix. One of those is limiting the default
environment of Bash. However, this default environment is insufficient because lots of programs rely on diff being in the path like buildifier, golangci-lint, and other things since golang diff implementations aren't very good.

Ideally we'd include "diffutils" as part of this list for rules that assume the presence of "diff" and don't allow nice knobs to configure otherwise.

Furthermore, bazel has a lot of internal facilities that utilize patch (like when downloading workspaces, we have the option of patching them), so include gnupatch as well.

Fixes #249846
2023-09-12 10:14:31 -07:00
Mario Rodas
032fef37aa bazel-remote: 2.4.2 -> 2.4.3
Diff: https://github.com/buchgr/bazel-remote/compare/v2.4.2...v2.4.3

Changelog: https://github.com/buchgr/bazel-remote/releases/tag/v2.4.3
2023-08-30 04:20:00 +00:00
Uri Baghin
2c57e8f59c
Merge pull request #251336 from marsam/update-bazel-remote
bazel-remote: 2.4.1 -> 2.4.2
2023-08-26 14:19:48 +10:00
Mario Rodas
447c5611bd bazel-buildtools: 6.3.2 -> 6.3.3
Diff: https://github.com/bazelbuild/buildtools/compare/v6.3.2...v6.3.3

Changelog: https://github.com/bazelbuild/buildtools/releases/tag/v6.3.3
2023-08-25 04:20:00 +00:00
Mario Rodas
9cd03d19e3 bazel-remote: 2.4.1 -> 2.4.2
Diff: https://github.com/buchgr/bazel-remote/compare/v2.4.1...v2.4.2

Changelog: https://github.com/buchgr/bazel-remote/releases/tag/v2.4.2
2023-08-24 04:20:00 +00:00
Uri Baghin
7a79430b0e
Merge pull request #250098 from r-ryantm/auto-update/bazel-buildtools
bazel-buildtools: 6.1.2 -> 6.3.2
2023-08-19 15:11:20 +10:00
R. Ryantm
374d4aabeb bazel-buildtools: 6.1.2 -> 6.3.2 2023-08-19 04:18:08 +00:00
Jacob Foard
af3759f264
bazel_6: 6.2.0 -> 6.3.2 2023-08-16 16:15:21 -04:00
Uri Baghin
63c7774d20
Merge pull request #245860 from dmivankov/patch-4
bazel_6: installCheckPhase .bazelversion override
2023-08-15 11:09:42 +10:00
Dmitry Ivankov
5790912514 bazel_6: installCheckPhase .bazelversion override
In case bazel dist archive includes .bazelversion (like in 5.4.1 https://github.com/bazelbuild/bazel/issues/18189 or 6.3.1rc1) running bazel commands in dist worktree will require using version specified in .bazelversion. If .bazelversion is absent there any available version will be used.

Let's make sure we don't fail installCheckPhase for dist archives that do include .bazelversion (note: bazel bootstrapping from sources not via bazel works regardless of that file, so that's only about test/check phases)
2023-08-14 10:16:17 +02:00
Dmitry Ivankov
ecbebc9e22
bazel_6: fix typo on comments
Leftover bazel_5 reference ffrom 5->6 update
2023-07-28 13:37:15 +02:00
Mario Rodas
fdac5ffcfa bazel-buildtools: 6.1.1 -> 6.1.2
Diff: https://github.com/bazelbuild/buildtools/compare/6.1.1...v6.1.2

Changelog: https://github.com/bazelbuild/buildtools/releases/tag/v6.1.2
2023-07-23 04:20:00 +00:00
R. Ryantm
7e77b37e43 bazel-remote: 2.4.0 -> 2.4.1 2023-07-02 04:36:49 +00:00
Felix Buehler
6672dde558 treewide: use optionalAttrs instead of 'else {}' 2023-06-25 11:01:34 -03:00
Dmitry Ivankov
5a14400712 bazel_6: 6.1.2 -> 6.2.0
https://github.com/bazelbuild/bazel/releases/tag/6.2.0
2023-05-12 15:33:48 +02:00
Weijia Wang
195e6dc214
Merge pull request #231437 from divanorama/bazel_6_darwin
bazel_6: fix darwin build
2023-05-12 14:18:37 +03:00
Dmitry Ivankov
cce9228342 bazel_6: fix darwin build
Since bazel 6.1.0 there was a change in `install_name_tool` invocation
on darwin: `/usr/bin/install_name_tool` -> `/usr/bin/xcrun install_name_tool`
https://github.com/bazelbuild/bazel/pull/17253

So interception of `install_name_tool` broke and build in nixpkgs became
less hermetic. It was either picking up host `xcode` or failing if
xcode isn't installed.

Let's update patching script in nixpkgs.

For errors like https://hydra.nixos.org/build/219158800/nixlog/3
```
ERROR: /private/tmp/nix-build-bazel-6.1.2.drv-0/bazel_src/examples/cpp/BUILD:13:8: Linking examples/cpp/hello-success_test failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //examples/cpp:hello-success_test)
  (cd /private/tmp/nix-build-bazel-6.1.2.drv-0/_bazel__nixbld12/bee562cde99c3bcadaa4e82f18c698fe/sandbox/processwrapper-sandbox/44/execroot/io_bazel && \
  exec env - \
    PATH=/nix/store/v6f6y9mwmqj9v1jffiy4g96ili4pj5la-python3-3.10.11/bin:/nix/store/mda7jac839k0z33n80pglkhfk3s8panz-unzip-6.0/bin:/nix/store/r9ynkgvbn9lp0x3dvrhr0dskss8wwhc2-which-2.21/bin:/nix/store/1jfsv6gcw2lzzavr3jhydzlmpy3iw9b7-zip-3.0/bin:/nix/store/w66qbvdwgpgbn3ikwyxkhpx1zwaw5rln-cctools-port-973.0.1/bin:/nix/store/99xl1hg0pvscfn7aszp0df034jnprn0j-clang-wrapper-11.1.0/bin:/nix/store/ngbj0z5mr5z7dhi0q11csq1k7rxvfcf7-clang-11.1.0/bin:/nix/store/lhbkcjmrv547plyiybfxqddlpn2l13yl-coreutils-9.1/bin:/nix/store/72fxghdpx8732zizx6jg5d74kblpz7ic-cctools-binutils-darwin-wrapper-973.0.1/bin:/nix/store/qm48dbbhmqk70hm35s9hzbmgvwd6slvs-cctools-binutils-darwin-973.0.1/bin:/nix/store/dv87q4384pyhg8f0hkw3l4lgkiqxwk94-zulu11.48.21-ca-jdk-11.0.11/bin:/nix/store/1alnbw2p2s4wfk3j52mxrbwvcrwh8c1b-bash-5.2-p15/bin:/nix/store/shzh26kvfirgl441lkv7vcw9lgylrgy7-file-5.44/bin:/nix/store/4dzdpald6db495rflbwfldvzn0vaqp7k-findutils-4.9.0/bin:/nix/store/2k3k7wg1azk8mr3393aj8xxj5pv3098r-gawk-5.2.1/bin:/nix/store/3whcyzf1r7cvjx30mfdy6h3krnvfd176-gnugrep-3.7/bin:/nix/store/8j0jryir74m945154zxw3zs17ig51v89-gnused-4.9/bin:/nix/store/0zy67qd1vd6643p0p6hw93kikz11lbml-gnutar-1.34/bin:/nix/store/79617rkc430q3rm6v4c5fs2raixq43qi-gzip-1.12/bin:/nix/store/lhbkcjmrv547plyiybfxqddlpn2l13yl-coreutils-9.1/bin:/nix/store/4dzdpald6db495rflbwfldvzn0vaqp7k-findutils-4.9.0/bin:/nix/store/6fx4a1125c3xfs7alrr0jlyh5cwkshz8-diffutils-3.9/bin:/nix/store/8j0jryir74m945154zxw3zs17ig51v89-gnused-4.9/bin:/nix/store/3whcyzf1r7cvjx30mfdy6h3krnvfd176-gnugrep-3.7/bin:/nix/store/2k3k7wg1azk8mr3393aj8xxj5pv3098r-gawk-5.2.1/bin:/nix/store/ym7jyaml2zj2x6y6mriyh6ch8z5abqr1-gnutar-1.34/bin:/nix/store/79617rkc430q3rm6v4c5fs2raixq43qi-gzip-1.12/bin:/nix/store/m8yqab399pakajchm99nq42qdcxiw1n0-bzip2-1.0.8-bin/bin:/nix/store/iiasa4fvs0d5ijj0qbj9nl7p31bznxah-gnumake-4.4.1/bin:/nix/store/1alnbw2p2s4wfk3j52mxrbwvcrwh8c1b-bash-5.2-p15/bin:/nix/store/w9x4wz6i8y7cy8hfvp5is86fyh2bh6cp-patch-2.7.6/bin:/nix/store/kx2n8m3j2pfq0v9jydav1qpdy1fd22im-xz-5.4.2-bin/bin:/nix/store/41qmp6qwwz3vvf94pccqnvcx1zdp5z9i-file-5.44/bin \
    PWD=/proc/self/cwd \
  external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-fastbuild/bin/examples/cpp/hello-success_test-2.params)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
xcode-select: error: No developer tools were found and no install could be requested (perhaps no UI is present).
If developer tools are located at a non-default location on disk, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools.
Use `xcode-select --install` to install the standalone command line developer tools, or visit http://adc.apple.com to download Xcode or the standalone command line tools installation package.
See `man xcode-select` for more details.
```
2023-05-12 11:21:37 +02:00
Dmitry Ivankov
e0d1e77c23 bazel_5: 5.4.0->5.4.1
Also update the updater script.

https://github.com/bazelbuild/bazel/releases/tag/5.4.1

- [X] recalculate fetchAttrs digest for packages built with bazel_5
2023-05-10 16:09:19 +02:00
Mario Rodas
8576682e8f bazel-buildtools: 6.1.0 -> 6.1.1
https://github.com/bazelbuild/buildtools/releases/tag/6.1.1
2023-04-26 04:20:00 +00:00
Dmitry Ivankov
389c519486 bazel_6: 6.1.1->6.1.2
All changes seem to be within bazel sources so `updater` script
doesn't produce changes to srcDeps.

https://github.com/bazelbuild/bazel/releases/tag/6.1.2
2023-04-21 13:31:42 +02:00
Mario Rodas
f1d5035a72 bazel-buildtools: 6.0.1 -> 6.1.0
https://github.com/bazelbuild/buildtools/releases/tag/6.1.0
2023-03-30 04:20:00 +00:00
Dmitry Ivankov
f320081439 bazel_6: 6.1.0 -> 6.1.1
https://github.com/bazelbuild/bazel/releases/tag/6.1.1
2023-03-21 15:59:38 +01:00
Dmitry Ivankov
be9859e899 bazel_6: 6.0.0 -> 6.1.0
Updating the updater script:
- `//external:all` -> `//external:*` to make it work with recent bazel versions

Avoiding chicken-egg problem by explicitly asking to first build previous version,
then update sources version, then use updater and previous version to update src-deps.

`bazel_self` may not necessarily build out of the box after just the sources version
bump and may depend on updater being run first, which can't run without `bazel_self`.
So listing steps to use old version to help updating to new version
2023-03-07 17:01:57 +01:00
Mario Rodas
cf87e23f92 bazel-buildtools: 5.1.0 -> 6.0.1
https://github.com/bazelbuild/buildtools/releases/tag/6.0.0
https://github.com/bazelbuild/buildtools/releases/tag/6.0.1
2023-02-08 04:20:00 +00:00
Uri Baghin
81dc5ee425 bazel_3: remove 2023-02-02 13:03:36 +11:00
Uri Baghin
ec57cb615b bazel_6: 6.0.0-pre.20220720.3 -> 6.0.0 2023-01-18 08:53:53 +11:00
R. Ryantm
c0d431caff bazel-remote: 2.3.9 -> 2.4.0 2023-01-12 08:51:03 +00:00
zowoq
ae50f0678a
Revert "bazel_6: 6.0.0-pre.20220720.3 -> 6.0.0" 2023-01-11 10:01:46 +10:00
Uri Baghin
4001c325ac
Merge pull request #206934 from alloveras/patch-2
bazel_6: 6.0.0-pre.20220720.3 -> 6.0.0
2023-01-11 10:25:22 +11:00
Dmitry Ivankov
c8bc2f2c0d bazel_5: 5.3.2 -> 5.4.0 2023-01-10 16:04:00 +01:00
Albert Lloveras
bc66db939a PR feedback 2023-01-10 20:11:59 +11:00
Dmitry Ivankov
9a82a9b524 bazel: 5.2.0 -> 5.3.2
https://blog.bazel.build/2022/08/23/bazel-5.3.html

to supersede https://github.com/NixOS/nixpkgs/pull/187943

re-reverts https://github.com/NixOS/nixpkgs/pull/199458 with more hash updates
2022-12-25 16:47:03 +01:00
Albert Lloveras
1e72427803 bazel_6: 6.0.0-pre.20220720.3 -> 6.0.0 2022-12-20 19:22:06 +11:00
Rick van Schijndel
9833d56c24 treewide: mark packages broken that never built on PLATFORM
Done with the help of https://github.com/Mindavi/nixpkgs-mark-broken
Tool is still WIP but this is one of the first results.

I manually audited the results and removed some results that were not valid.

Note that some of these packages maybe should have more constrained platforms set
instead of broken set, but I think not being perfectly correct is better than
just keep trying to build all these things and never succeeding.

Some observations:

- Some darwin builds require XCode tools
- aarch64-linux builds sometimes suffer from using gcc9
  - gcc9 is getting older and misses some new libraries/features
- Sometimes tools try to do system detection or expect some explicit settings for
  platforms that are not x86_64-linux
2022-12-13 21:40:12 +01:00
Robert Schütz
d6ecfa2b1a bazel_6: only use python3 2022-11-24 23:04:27 -08:00
Robert Schütz
6c251ae60b bazel_5: only use python3 2022-11-24 23:04:27 -08:00
Robert Schütz
c0143fbd4f bazel_4: only use python3 2022-11-24 23:04:27 -08:00
Robert Schütz
58dbe4d6de bazel_3: only use python3 2022-11-24 23:04:26 -08:00
Uri Baghin
949e592ed6
Revert "bazel: 5.2.0 -> 5.3.2" 2022-11-04 14:47:55 +11:00
Dmitry Ivankov
3e34d2674e bazel: 5.2.0 -> 5.3.2 2022-10-26 19:30:55 +02:00
Uri Baghin
7ce637bc99 bazel_5: fix sandbox 2022-09-20 14:01:39 +10:00
Dmitry Kalinkin
4922ed06b0
bazel: patch to fix for darwin sandbox 2022-09-11 12:51:48 -04:00
Uri Baghin
a6e347fb29
Merge pull request #186106 from layus/bazel-update
bazel_6: init with a WIP implem
2022-09-03 00:27:09 +10:00
Guillaume Maudoux
b4f4f49331 bazel_6: Cleanup leftover comments 2022-09-02 12:54:36 +02:00