Open malt3 opened 4 months ago
cc @NixOS/bazel Can we help prioritize this issue? The Bazel 7.1.* releases have a major functionality bug where remote cache uploads hang indefinitely, see: https://github.com/bazelbuild/bazel/issues/21626 and related issues.
We would normally use a custom derivation where we pass our own version = 7.2.0
into nixpkgs bazel/bazel_7/default.nix
but the bazel team upstream changed the lock file format in a minor patch version so now the tests.nix
do not pass with this strategy.
@hjkatz please see my comment containing two ideas for solving this.
The bazel vendor
command will only result in a usable vendor dir after 7.3.
So in my eyes, you have the following options:
7.2.1 is now out: https://github.com/bazelbuild/bazel/releases/tag/7.2.1
Bazel 7.3 will have a fully functional vendoring command!
Bazel 7.3 will have a fully functional vendoring command!
Released 12 hours ago https://github.com/bazelbuild/bazel/releases/tag/7.3.0
Hi, I have a WIP of Bazel 7.3 building on x86_64-linux: https://github.com/NixOS/nixpkgs/compare/master...flurie:nixpkgs:flurie/bazel_73.
Note that (for now) the target is bazel_73
.
@flurie the hero we need 🙇
Ok to walk through it a little bit:
bazel vendor
for a fixed-output derivation.VENDOR.bazel
. To enable offline builds, we need to set --repository_disable_download
, not --nofetch
. Also, for some reason py_binary
rules were building python zips, so I had to add --nobuild_python_zip
.It's still kind of messy, but I don't let mess get in the way of a PR unless there's too much of it or I don't have enough time to self-review.
More serious gaps:
buildBazelPackage
? One thing I don't know is how well bazel vendor
performs when you aren't as all-in on bzlmod as Bazel's own build.bazel vendor
is hard to use as a standard deps fetch more generally, should we consider keeping Bazel 7.3 as a separate package for now and moving forward with replacements for things that can use it? That's the only reason I have kept them separate for now.If anyone has more info about those gaps, I'll feel more comfortable putting this up for review.
:ohno:
2024-08-19 19:26:50 UTC error: hash mismatch in fixed-output derivation '/nix/store/vz0d58c3j2f1vk592k53l3z3ia3i6izf-bazel_deps.drv':
2024-08-19 19:26:50 UTC specified: sha256-acZOeHBHchotsEG51WfpgR7MGJze88xwnON/DE9IlSo=
2024-08-19 19:26:50 UTC got: sha256-+ux/l+IDIZ8VJ7l48u2iJ7DTLt8CasLPW2UH+TGk6LU=
2024-08-19 19:00:34 UTC error: hash mismatch in fixed-output derivation '/nix/store/vz0d58c3j2f1vk592k53l3z3ia3i6izf-bazel_deps.drv':
2024-08-19 19:00:34 UTC specified: sha256-acZOeHBHchotsEG51WfpgR7MGJze88xwnON/DE9IlSo=
2024-08-19 19:00:34 UTC got: sha256-QvpRBilcomdtc74OmZ5PvzZHlm21+55ayQqEk0FlIyI=
bazel vendor seems inconsistent
Good catch. The bazel mod deps
almost certainly needs to go, and that should be replaced with vendoring a version of MODULE.bazel.lock
, but the one in the repo did not work without getting updated. I vendored a copy (I believe) after making the update. I'll see if I can get the FOD to output something consistently.
I may also be doing something incorrectly since I have little experience with FODs.
@jtszalay has very kindly helped to get the build deps to a reproducible state, and we now have what should be a working derivation (for linux).
Notify maintainers
@NixOS/bazel
Note for maintainers: Please tag this issue in your PR.
Add a :+1: reaction to issues you find important.