bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.1k stars 4.04k forks source link

[8.0.0rc1] `no such package '@@[unknown repo 'protobuf' requested from @@_builtins]//bazel/private'` #23907

Open fmeum opened 3 days ago

fmeum commented 3 days ago

Description of the bug:

With Bazel 8.0.0rc1, I get the following error when using proto toolchains:

ERROR: no such package '@@[unknown repo 'protobuf' requested from @@_builtins]//bazel/private': The repository '@@[unknown repo 'protobuf' requested from @@_builtins]' could not be resolved: No repository visible as '@protobuf' from repository '@@_builtins'
ERROR: /Users/fmeum/git/with_cfg.bzl/docs/BUILD.bazel:14:21: While resolving toolchains for target //docs:protoc_java_toolchain (415c165): com.google.devtools.build.lib.packages.BuildFileNotFoundException: no such package '@@[unknown repo 'protobuf' requested from @@_builtins]//bazel/private': The repository '@@[unknown repo 'protobuf' requested from @@_builtins]' could not be resolved: No repository visible as '@protobuf' from repository '@@_builtins'

Which category does this issue belong to?

External Dependency

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

git clone https://github.com/fmeum/with_cfg.bzl
git checkout 19b8eb6035ace755b1783f270ddfb17bc1b268b3
USE_BAZEL_VERSION=8.0.0rc1 bazel test //...

Which operating system are you running Bazel on?

macOS

What is the output of bazel info release?

release 8.0.0rc1

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.

Bazelisk points to: https://github.com/bazelbuild/bazel/commit/07af430eafcc7afb47d17d0b395a0020d08ed598

This commit removed the protobuf dep from bazel_tools: https://github.com/bazelbuild/bazel/commit/f36b8a390d750eaca5875af90666b866d9e94031

Have you found anything relevant by searching the web?

No response

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

No response

fmeum commented 3 days ago

After fixing this issue with https://github.com/bazelbuild/bazel/pull/23908, I run into a new one:

ERROR: Traceback (most recent call last):
    File "/private/var/tmp/_bazel_fmeum/515b48d03131f3c00c7548b171c91789/external/protobuf+/src/google/protobuf/compiler/BUILD.bazel", line 262, column 13, in <toplevel>
        aarch64_test(
    File "/private/var/tmp/_bazel_fmeum/515b48d03131f3c00c7548b171c91789/external/protobuf+/build_defs/arch_tests.bzl", line 44, column 20, in aarch64_test
        _arch_test_impl(
    File "/private/var/tmp/_bazel_fmeum/515b48d03131f3c00c7548b171c91789/external/protobuf+/build_defs/arch_tests.bzl", line 23, column 19, in _arch_test_impl
        inline_sh_test(
    File "/private/var/tmp/_bazel_fmeum/515b48d03131f3c00c7548b171c91789/external/protobuf+/build_defs/internal_shell.bzl", line 89, column 11, in inline_sh_test
        native.sh_test(
Error: no native function or rule 'sh_test'
Available attributes: action_listener, alias, available_xcodes, cc_binary, cc_import, cc_libc_top_alias, cc_library, cc_proto_library, cc_shared_library, cc_static_library, cc_test, cc_toolchain, cc_toolchain_alias, cc_toolchain_suite, config_feature_flag, config_setting, constraint_setting, constraint_value, environment, existing_rule, existing_rules, exports_files, extra_action, fdo_prefetch_hints, fdo_profile, filegroup, genquery, genrule, glob, java_binary, java_import, java_library, java_lite_proto_library, java_package_configuration, java_plugin, java_plugins_flag_alias, java_proto_library, java_runtime, java_test, java_toolchain, label_flag, label_setting, legacy_globals, memprof_profile, module_name, module_version, objc_import, objc_library, package, package_group, package_name, package_relative_label, platform, propeller_optimize, proto_lang_toolchain, proto_library, repo_name, repository_name, starlark_doc_extract, subpackages, test_suite, toolchain, toolchain_type, xcode_config, xcode_config_alias, xcode_version
ERROR: /private/var/tmp/_bazel_fmeum/515b48d03131f3c00c7548b171c91789/external/protobuf+/src/google/protobuf/compiler/BUILD.bazel:206:11: Cannot compute config conditions
ERROR: /private/var/tmp/_bazel_fmeum/515b48d03131f3c00c7548b171c91789/external/protobuf+/BUILD.bazel:232:10: Target '@@protobuf+//src/google/protobuf/compiler:protoc_lib' contains an error and its package is in error and referenced by '@@protobuf+//:protoc'

In my testing, accessing native.sh_test from an external module that isn't one of the allowlisted modules works.

@comius

Wyverald commented 3 days ago

Ivo is still working on the autoloads stuff. Let's give him a minute to breathe. :)