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

Build fails on Bazel 8.0.0rc3 #82

Closed
mortenmj opened this issue Nov 22, 2024 · 9 comments · Fixed by #83
Closed

Build fails on Bazel 8.0.0rc3 #82

mortenmj opened this issue Nov 22, 2024 · 9 comments · Fixed by #83

Comments

@mortenmj
Copy link
Contributor

Build fails with an error when using 8.0.0rc3:

➜  bazel_features git:(main) ✗ bazel build //...
Starting local Bazel server and connecting to it...
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.6.1, but got bazel_skylib@1.7.1 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'io_bazel_stardoc', the root module requires module version stardoc@0.6.2, but got stardoc@0.7.1 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
ERROR: Traceback (most recent call last):
        File "/home/vscode/.cache/bazel/_bazel_vscode/c972e14ded6d086e3efa57eaf11e9e05/external/+version_extension+bazel_features_globals/globals.bzl", line 10, column 79, in <toplevel>
                ProtoInfo = getattr(getattr(native, 'legacy_globals', None), 'ProtoInfo', ProtoInfo),
Error: predeclared variable 'ProtoInfo' is referenced before assignment.
WARNING: Target pattern parsing failed.
ERROR: Skipping '//...': error loading package under directory '': error loading package 'test': at /workspaces/bazel_features/test/test.bzl:5:6: at /workspaces/bazel_features/features.bzl:3:6: initialization of module 'globals.bzl' failed
ERROR: error loading package under directory '': error loading package 'test': at /workspaces/bazel_features/test/test.bzl:5:6: at /workspaces/bazel_features/features.bzl:3:6: initialization of module 'globals.bzl' failed
INFO: Elapsed time: 4.797s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
@fmeum
Copy link
Member

fmeum commented Nov 22, 2024

@comius

@cgrindel
Copy link
Member

I can confirm that this does not happen on 8.0.0rc2.

@rickeylev
Copy link

Just relying a comment from chowder@ about possible cause:

@bazel_features evaluates 8.0.0rc3 to be "less than" 8.0.0, so it still thinks these are still valid globals.

@comius
Copy link
Contributor

comius commented Nov 25, 2024

I believe version checks are wrong in bazel_features:

Checks for workspace mode seem fine, but it doesn't hurt to double check:

@meteorcloudy
Copy link
Collaborator

Relevant discussion: #80 (comment)

@meteorcloudy
Copy link
Collaborator

@fmeum @Wyverald I think we should probably treat rcs the same as the final release instead of asking users to specify 8.0.0rc3? Otherwise, all versions specific in bazel_features should theoretically be rcs.

@fmeum
Copy link
Member

fmeum commented Nov 25, 2024

@fmeum @Wyverald I think we should probably treat rcs the same as the final release instead of asking users to specify 8.0.0rc3? Otherwise, all versions specific in bazel_features should theoretically be rcs.

Over at #80 (comment), I still thought that "bazel_features is the one project to use exact version matching", but as this issue demonstrates that's just too much of a footgun. I'll send a PR to drop the rc suffix from comparisons in the same way as bazel_compatibility.

katre pushed a commit to bazel-contrib/rules_bazel_integration_test that referenced this issue Nov 25, 2024
- Replace Bazel 6.5.0 with Bazel 8.0.0rc2. [A bazel_features
error](bazel-contrib/bazel_features#82)
prevents us from upgrading to 8.0.0rc3.
- Remove the Bazel lock files. We test with different versions of Bazel.
They are not really relevant for our tests/examples.
copybara-service bot pushed a commit to bazelbuild/bazel that referenced this issue Nov 25, 2024
Addressing bazel-contrib/bazel_features#82

PiperOrigin-RevId: 699970013
Change-Id: Ia9b6952c4836437b4f74e4e498c5d5839185c496
meteorcloudy added a commit to meteorcloudy/bazel that referenced this issue Nov 25, 2024
Addressing bazel-contrib/bazel_features#82

PiperOrigin-RevId: 699970013
Change-Id: Ia9b6952c4836437b4f74e4e498c5d5839185c496
@rickeylev
Copy link

FYI for those subscribed: bazel_features 1.21.0 is released with a fix for this

rickeylev added a commit to bazelbuild/rules_python that referenced this issue Nov 25, 2024
bazel_features has a bug where it doesn't detect Bazel 8 rc3 correctly.
This is fixed in release 1.21.0.

From the discussion on
bazel-contrib/bazel_features#82,
it's likely this only occurs due to the "rc" notation of the Bazel
release, so an
earlier bazel_features version will probably work fine once Bazel 8 is
no longer rc.
@meteorcloudy
Copy link
Collaborator

8.0.0rc4 actually bumps the bazel_features by default, see bazelbuild/bazel@11596c3#diff-2bd581915487f6ba07e5ce4940d6c64969ffeb336664fb816189665631b7d018R15, so you probably don't have to do it manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants