Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel_6: Fix empty bzlmod lock file #273774

Closed
wants to merge 2 commits into from

Conversation

avdv
Copy link
Member

@avdv avdv commented Dec 12, 2023

Description of changes

This works around an issue with bootstrapping bazel from scratch, see
bazelbuild/bazel#20501

Fixes #273500

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@avdv avdv requested a review from Profpatsch as a code owner December 12, 2023 15:19
@avdv avdv force-pushed the bazel_6-rebuild-stage-bazel branch from e25e5e2 to 8d23d33 Compare December 12, 2023 16:31
@avdv avdv requested a review from a team December 13, 2023 08:04
@avdv avdv force-pushed the bazel_6-rebuild-stage-bazel branch from 8d23d33 to 54148bd Compare December 18, 2023 06:29
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-linux: 101-500 labels Dec 18, 2023
Copy link
Contributor

@uri-canva uri-canva left a comment

Choose a reason for hiding this comment

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

There's a better fix available upstream, can we use that? bazelbuild/bazel#20587

@avdv
Copy link
Member Author

avdv commented Dec 19, 2023

There's a better fix available upstream, can we use that? bazelbuild/bazel#20587

Yes, saw that and I'll update the PR.

This works around an issue with bootstrapping bazel from scratch, see
bazelbuild/bazel#20501

Fixes NixOS#273500
@avdv avdv force-pushed the bazel_6-rebuild-stage-bazel branch from 54148bd to b75fc95 Compare December 20, 2023 09:13
@avdv
Copy link
Member Author

avdv commented Dec 20, 2023

PTAL, I have incorporated the patch from bazelbuild/bazel#20612 and added a regression test adapted from #262152

@avdv avdv changed the title bazel_6: Build bazel with a real bazel binary bazel_6: Fix empty bzlmod lock file Dec 20, 2023
@avdv avdv requested a review from uri-canva December 20, 2023 10:14
@uri-canva
Copy link
Contributor

Looks like it's broken on darwin, not sure if it's preexisting or caused by the PR:

       > ERROR: /private/var/tmp/_bazel__nixbld1/e8e960336b6dc72b41250252f59936ca/external/remote_java_tools/java_tools/zlib/BUILD.bazel:18:11: Compiling java_tools/zlib/uncompr.c [for tool] failed: The include path '/nix/store/z0nnwdh4p692yvf3qgwgj3bn78w99q6y-python3-3.11.6/include' references a path outside of the execution root.
       > ERROR: /private/var/tmp/_bazel__nixbld1/e8e960336b6dc72b41250252f59936ca/external/remote_java_tools/java_tools/zlib/BUILD.bazel:18:11: Compiling java_tools/zlib/zutil.c [for tool] failed: The include path '/nix/store/z0nnwdh4p692yvf3qgwgj3bn78w99q6y-python3-3.11.6/include' references a path outside of the execution root.
       > Target //src/tools/execlog:parser_deploy.jar failed to build

It's the execlog parser though, not bazel itself, so maybe we can just stop building it.

@delroth delroth added 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Dec 21, 2023
@avdv
Copy link
Member Author

avdv commented Dec 22, 2023

It's the execlog parser though, not bazel itself, so maybe we can just stop building it.

👍 I added a commit which skips this step on darwin.

@delroth delroth removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 22, 2023
@avdv avdv force-pushed the bazel_6-rebuild-stage-bazel branch from 0cf88b7 to 5b91b1c Compare January 2, 2024 10:34
@ofborg ofborg bot requested a review from uri-canva January 2, 2024 11:14
@uri-canva
Copy link
Contributor

Doesn't seem to have worked, though I don't know why.

@uri-canva
Copy link
Contributor

Oh no I see, the build of the parser is skipped, but then the install fails since it can't find the parser.

Copy link
Contributor

@uri-canva uri-canva left a comment

Choose a reason for hiding this comment

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

Back to you, sorry.

This currently fails with:
```
       > ERROR: /private/var/tmp/_bazel__nixbld1/e8e960336b6dc72b41250252f59936ca/external/remote_java_tools/java_tools/zlib/BUILD.bazel:18:11: Compiling java_tools/zlib/uncompr.c [for tool] failed: The include path '/nix/store/z0nnwdh4p692yvf3qgwgj3bn78w99q6y-python3-3.11.6/include' references a path outside of the execution root.
       > ERROR: /private/var/tmp/_bazel__nixbld1/e8e960336b6dc72b41250252f59936ca/external/remote_java_tools/java_tools/zlib/BUILD.bazel:18:11: Compiling java_tools/zlib/zutil.c [for tool] failed: The include path '/nix/store/z0nnwdh4p692yvf3qgwgj3bn78w99q6y-python3-3.11.6/include' references a path outside of the execution root.
       > Target //src/tools/execlog:parser_deploy.jar failed to build
```
@avdv avdv force-pushed the bazel_6-rebuild-stage-bazel branch from 5b91b1c to 7c08dd8 Compare January 4, 2024 07:10
@ofborg ofborg bot requested a review from uri-canva January 4, 2024 07:31
@avdv
Copy link
Member Author

avdv commented Jan 4, 2024

Back to you, sorry.

My bad. Seems like I fixed it this time, builds and tests are green on x86_64-darwin.

@avdv
Copy link
Member Author

avdv commented Jan 18, 2024

@uri-canva could you have a look again, please?

@avdv
Copy link
Member Author

avdv commented Jan 24, 2024

closing, superseded by #283480

@avdv avdv closed this Jan 24, 2024
@uri-canva
Copy link
Contributor

Apologies I'm not very active these days, will look at #283480.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 1-10 10.rebuild-linux: 101-500 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bazel_6: MODULE.bazel.lock file is empty
3 participants