Skip to content

bazel_9: init at 9.0.1 - #476183

Merged
Mindavi merged 1 commit into
NixOS:masterfrom
3541:bazel-9
Apr 5, 2026
Merged

Mindavi merged 1 commit into
NixOS:masterfrom
3541:bazel-9

Conversation

@3541

@3541 3541 commented Jan 2, 2026 •

Copy link
Copy Markdown
Contributor

Bazel 9 is now released, and has a number of exciting features (for instance C++20 modules).

This is substantially similar to the Bazel 8 package, with the following differences:

  • Some patches are changed/reworked to match upstream (e.g., md5sum).
  • Some patches have been upstreamed (e.g., env_bash).
  • Bazel is now stricter about paths escaping the repository, so the way we inject libresolv for Darwin has to change. Now we leverage NIX_CFLAGS_COMPILE to wormhole it into the wrapper, rather than passing options to Bazel.

This effectively includes #464436, as generate-xml.sh fails when running tests without it.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle! labels Jan 2, 2026
@3541
3541 force-pushed the bazel-9 branch 7 times, most recently from a5fa485 to 0d4b7ff Compare January 4, 2026 05:41
@nixpkgs-ci nixpkgs-ci Bot added 2.status: merge conflict This PR has merge conflicts with the target branch and removed 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jan 10, 2026
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 10, 2026
@3541
3541 force-pushed the bazel-9 branch 2 times, most recently from 5911ec7 to ae9f664 Compare January 17, 2026 02:38
@3541 3541 changed the title bazel_9: init at 9.0.0rc3 bazel_9: init at 9.0.0rc6 Jan 17, 2026
@3541 3541 changed the title bazel_9: init at 9.0.0rc6 bazel_9: init at 9.0.0 Jan 21, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 24, 2026
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 24, 2026
@3541
3541 marked this pull request as ready for review January 24, 2026 02:50
@3541

3541 commented Jan 24, 2026

Copy link
Copy Markdown
Contributor Author

@boltzmannrain I think this is ready now. Are you able to review, please?

@nixpkgs-ci
nixpkgs-ci Bot requested a review from aherrmann January 24, 2026 03:27

@boltzmannrain boltzmannrain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now builds for me on macos with sandbox=true too 👍

@dmivankov

Copy link
Copy Markdown
Contributor

@3541 3541 changed the title bazel_9: init at 9.0.0 bazel_9: init at 9.0.1 Mar 14, 2026
@3541

3541 commented Mar 14, 2026 •

Copy link
Copy Markdown
Contributor Author

I don't really understand this compare eval failure. It seems to be trying to look up bazel_9 on a version of the repo where it does not exist (i.e., without my change). The actual evaluation/build checks seem to be going through fine.

In this command:

  nix-build nixpkgs/trusted/ci --arg nixpkgs ./nixpkgs/trusted-pinned -A eval.compare \
    --arg combinedDir ./combined \
    --arg touchedFilesJson ./touched-files.json \
    --out-link comparison

I am fairly sure that neither of these worktrees (trusted or trusted-pinned) is expected to have the PR. So how on earth does this check ever work with new packages?

@3541

3541 commented Mar 14, 2026

Copy link
Copy Markdown
Contributor Author

I guess this is #499751 in action. Can we just ignore the compare failure, if all the rest pass? I've also run the compare locally against the correct versions of nixpkgs, and it does pass.

This is almost the same as bazel_8. The differences are:
* Extra args for Darwin are passed by environment variable, since
  Bazel 9 is stricter about preventing include flags reaching outside
  the repository.
* The Java test is switched to vendor mode, to apply fixups to ijar.
* Various patch changes due to upstreaming and churn.
* --spawn_strategy=local passed for tests on Darwin, otherwise they
  fail due to nested sandboxing (this seems to be the case for bazel_8
  as well).
* --repo_contents_cache= passed for FOD generation. This is the old
  Bazel 8 default, and prevents an error because the contents cache is
  not allowed to be within the repository.
* Disabled universal binaries in protobuf on Darwin. This breaks the
  build when sandboxed.
* Patched out '/usr/bin/env bash' in generate_system_module_map.sh in
  tests, as this breaks under Darwin sandbox.
@3541

3541 commented Mar 14, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on 6829310, which should fix.

Also pulling in #489519 for consistency with bazel_8. I had already added bash, but not the comment from that PR, and python3 is new.

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Mar 16, 2026
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/2872

@hzeller

hzeller commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

@NixOS/bazel team, ready to merge ?

@3541

3541 commented Mar 29, 2026

Copy link
Copy Markdown
Contributor Author

Hmm, is there anywhere else I should follow up to get the attention of a committer? Already tried the discourse thread.

@Mindavi

Mindavi commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

I quickly checked but I trust the people that have looked closer.

@Mindavi
Mindavi added this pull request to the merge queue Apr 5, 2026
Merged via the queue into NixOS:master with commit dcf16cf Apr 5, 2026
28 of 30 checks passed
ilai-deutel pushed a commit to ilai-deutel/nixpkgs that referenced this pull request Apr 6, 2026
@3541
3541 deleted the bazel-9 branch April 6, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants