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

[8.0.0rc7] bazel mod deps fails in bazel repo #24583

Closed
boltzmannrain opened this issue Dec 5, 2024 · 9 comments
Closed

[8.0.0rc7] bazel mod deps fails in bazel repo #24583

boltzmannrain opened this issue Dec 5, 2024 · 9 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug

Comments

@boltzmannrain
Copy link

Description of the bug:

Running bazel mod deps using 8.0.0rc7 bazel binary in bazel source base at 8.0.0rc7 tag fails. While 7.4.1 succeeds on same 8.0.0rc7 tag

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

bazel$ git checkout 8.0.0rc7
bazel$ bazel_nojdk-8.0.0rc7-linux-x86_64 mod deps
Starting local Bazel server and connecting to it...
DEBUG: /...../external/rules_jvm_external+/private/extensions/maven.bzl:146:14: The maven repository 'maven' is used in two different bazel modules, originally in 'bazel' and now in 'grpc-java'
DEBUG: /...../external/rules_jvm_external+/private/extensions/maven.bzl:146:14: The maven repository 'maven' is used in two different bazel modules, originally in 'bazel' and now in 'protobuf'
ERROR: Traceback (most recent call last):
	File "/...../external/rules_apple+/apple/internal/apple_xcframework_import.bzl", line 775, column 21, in <toplevel>
		apple_common.AppleDynamicFramework,
Error: 'struct' value has no field or method 'AppleDynamicFramework'
Available attributes: Objc, XcodeProperties, XcodeVersionConfig, apple_host_system_env, apple_platform, apple_toolchain, compilation_support, dotted_version, get_apple_config, get_cpu, get_split_build_configs, get_split_prerequisites, new_objc_provider, platform, platform_type, target_apple_env
ERROR: @@bazel_tools//tools/cpp:cc_configure.bzl does not export a module extension called cc_configure_extension, yet its use is requested at https://bcr.bazel.build/modules/abseil-cpp/20240722.0/MODULE.bazel:23:29
ERROR: Error loading '@@rules_apple+//apple:apple.bzl' for module extensions, requested by https://bcr.bazel.build/modules/rules_apple/3.5.1/MODULE.bazel:27:48: at /...../external/rules_apple+/apple/apple.bzl:27:5: initialization of module 'apple/internal/apple_xcframework_import.bzl' failed: at /...../external/rules_apple+/apple/apple.bzl:27:5: initialization of module 'apple/internal/apple_xcframework_import.bzl' failed
<root> (bazel@8.0.0)

ERROR: Results may be incomplete as 2 extensions failed.

and with 7.4.1

bazel$ bazel-7.4.1 mod deps
Starting local Bazel server and connecting to it...
DEBUG: /...../external/rules_jvm_external+/private/extensions/maven.bzl:146:14: The maven repository 'maven' is used in two different bazel modules, originally in 'bazel' and now in 'grpc-java'
DEBUG: /...../external/rules_jvm_external+/private/extensions/maven.bzl:146:14: The maven repository 'maven' is used in two different bazel modules, originally in 'bazel' and now in 'protobuf'
<root> (bazel@8.0.0)

Which operating system are you running Bazel on?

NixOS

What is the output of bazel info release?

release 8.0.0rc7

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@keith
Copy link
Member

keith commented Dec 5, 2024

depends on bazelbuild/rules_apple#2604

@satyanandak satyanandak added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label Dec 6, 2024
@fmeum
Copy link
Collaborator

fmeum commented Dec 6, 2024

Closing as an incompatibility with rules_apple, not a bug in Bazel.

@fmeum fmeum closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2024
@boltzmannrain
Copy link
Author

Root cause might be in rules_apple, but it is bazel building bazel that fails and it is an issue. Will it be a release blocker, or is it possible to downgrade or patch rules_apply until there's a forward fix?

@fmeum
Copy link
Collaborator

fmeum commented Dec 6, 2024

Bazel is only guaranteed to build itself with the Bazel version in .bazelversion. What is your motivation for trying to build it with Bazel 8.0.0rc7? The build will be fixed after Bazel 8 has been officially released.

@boltzmannrain
Copy link
Author

If .bazelversion is supported for bootstrapping then it's fair indeed 👍
I was looking into building bazel-8 for NixOS where the latest approach involves vendoring external dependencies using a pre-built bazel

@boltzmannrain
Copy link
Author

One extra note is pre-built nojdk binaries in https://github.com/bazelbuild/bazel/releases/tag/8.0.0rc7 are underlying bazel binaries without the wrapper that checks .bazelversion, so it's less obvious in a scenario of using pre-built bazel that the version is unsupported. A potential improvement is to also include extra version check via skylib https://github.com/bazelbuild/bazel-skylib/blob/main/docs/versions_doc.md or something similar

@fmeum fmeum reopened this Dec 6, 2024
@fmeum
Copy link
Collaborator

fmeum commented Dec 6, 2024

@meteorcloudy

@meteorcloudy
Copy link
Member

We are creating a new rc for #24582, if a compatible rules_apple is released in time, we could maybe fix this. But there is no promise bazel mod deps will work for Bazel versions that doesn't match .bazelversion in the Bazel repo.

vendoring external dependencies using a pre-built bazel

Why not just use 7.x? Vendoring should also work.

@boltzmannrain
Copy link
Author

vendoring external dependencies using a pre-built bazel

Why not just use 7.x? Vendoring should also work.

Yes, looks like it should work, it just wasn't obvious that the problem was with bazel version

@meteorcloudy meteorcloudy added P1 I'll work on this now. (Assignee required) and removed untriaged labels Jan 7, 2025
@meteorcloudy meteorcloudy self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug
Projects
None yet
Development

No branches or pull requests

7 participants