-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Unexpected builtin dependencies being loaded #24871
Comments
The dependency path that led to
|
Looks like what actually needs rules_foriegn_cc is only |
Why is |
bazelbuild/bazel-central-registry#3472 may help cut the dependency on grpc. |
gRPC doesn't use a separate testing module. IIRC The problem was parsing BUILD files loading google_benchmark fails without this dependency. |
Checking where it is used in https://github.com/search?q=repo%3Agrpc%2Fgrpc+google_benchmark&type=code, doesn't yield any results. Maybe this dependency could just be removed? |
@mering Indeed, I guess so. At least for building the targets listed in the presubmit.yml file. |
…el8 (#3214) bazelbuild/bazel#24871 will need to be addressed somehow where unnecessary "built-ins" are either not forcibly pulled in or all built-ins conform to this flag.
What is the expectation for users of Bazel? What is the fix we should be expecting and will it be something that requires a Bazel version upgrade? If so it would seem like this isn't gonna be addressed until Bazel 8.2 |
In the latest grpc version, Can you check if upgrading to this version helps? |
Trying the following diff to diff --git a/extensions/prost/MODULE.bazel b/extensions/prost/MODULE.bazel
index 7d2449ea..86d4c063 100644
--- a/extensions/prost/MODULE.bazel
+++ b/extensions/prost/MODULE.bazel
@@ -34,6 +34,12 @@ bazel_dep(
version = "28.3",
repo_name = "com_google_protobuf",
)
+bazel_dep(
+ name = "grpc",
+ version = "1.70.1",
+ repo_name = "com_github_grpc_grpc",
+)
+ |
I guess |
While it would be good to understand the exact dependency graph of the |
This has been tested against [googlebench:`9d8201efd4cbbe6271d0579ec2047dbfc396d22d`](https://github.com/google/benchmark/tree/9d8201efd4cbbe6271d0579ec2047dbfc396d22d) using the following diff ```diff diff --git a/MODULE.bazel b/MODULE.bazel index 62a3aa8..107a955 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -12,6 +12,10 @@ bazel_dep(name = "rules_python", version = "1.0.0", dev_dependency = True) bazel_dep(name = "googletest", version = "1.14.0", dev_dependency = True, repo_name = "com_google_googletest") bazel_dep(name = "libpfm", version = "4.11.0") +local_path_override( + module_name = "libpfm", + path = "../libpfm", +) # Register a toolchain for Python 3.9 to be able to build numpy. Python # versions >=3.10 are problematic. ``` ``` ~/google_benchmark$ bazel test //test/... WARNING: For repository 'platforms', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off WARNING: For repository 'rules_cc', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off WARNING: For repository 'com_google_googletest', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off INFO: Analyzed 44 targets (1 packages loaded, 105 targets configured). INFO: Found 1 target and 43 test targets... INFO: Elapsed time: 21.765s, Critical Path: 19.76s INFO: 285 processes: 5 action cache hit, 101 internal, 184 linux-sandbox. INFO: Build completed successfully, 285 total actions //test:args_product_test PASSED in 0.3s //test:basic_test PASSED in 1.3s //test:benchmark_gtest PASSED in 0.1s //test:benchmark_min_time_flag_iters_test PASSED in 0.1s //test:benchmark_min_time_flag_time_test PASSED in 17.0s //test:benchmark_name_gtest PASSED in 0.0s //test:benchmark_random_interleaving_gtest PASSED in 0.1s //test:benchmark_setup_teardown_test PASSED in 0.1s //test:benchmark_test PASSED in 5.8s //test:commandlineflags_gtest PASSED in 0.0s //test:complexity_test PASSED in 3.5s //test:cxx03_test PASSED in 7.9s //test:diagnostics_test PASSED in 0.1s //test:display_aggregates_only_test PASSED in 0.1s //test:donotoptimize_test PASSED in 0.1s //test:filter_test PASSED in 0.2s //test:fixture_test PASSED in 0.1s //test:internal_threading_test PASSED in 1.9s //test:link_main_test PASSED in 0.9s //test:map_test PASSED in 0.3s //test:memory_manager_test PASSED in 0.1s //test:min_time_parse_gtest PASSED in 0.6s //test:multiple_ranges_test PASSED in 0.5s //test:options_test PASSED in 5.3s //test:perf_counters_gtest PASSED in 0.1s //test:perf_counters_test PASSED in 0.1s //test:profiler_manager_gtest PASSED in 0.2s //test:profiler_manager_iterations_test PASSED in 0.1s //test:profiler_manager_test PASSED in 0.1s //test:register_benchmark_test PASSED in 0.2s //test:repetitions_test PASSED in 0.2s //test:report_aggregates_only_test PASSED in 0.2s //test:reporter_output_test PASSED in 0.9s //test:skip_with_error_test PASSED in 0.4s //test:spec_arg_test PASSED in 0.1s //test:spec_arg_verbosity_test PASSED in 0.1s //test:statistics_gtest PASSED in 0.1s //test:string_util_gtest PASSED in 0.1s //test:templated_fixture_test PASSED in 0.1s //test:time_unit_gtest PASSED in 0.1s //test:user_counters_tabular_test PASSED in 0.8s //test:user_counters_test PASSED in 0.6s //test:user_counters_thousands_test PASSED in 0.2s Executed 43 out of 43 tests: 43 tests pass. ``` relates to bazelbuild/bazel#24871 --------- Co-authored-by: Yun Peng <[email protected]>
With bazelbuild/bazel-central-registry#3764 now merged would someone be able to make sure however the old dependency was getting pulled in it's switched to this new one? I don't have any context on how the builtins are setup and imposed on Bazel users. |
I think adding a bazel_dep on the new libpfm should help. Although it's not your direct dependency. #25214 might help do this more elegantly. |
While I've reported this issue on behalf of |
I have also opened google/benchmark#1922 |
I haven't carefully read through this thread yet, but just to answer this question: All modules have an implicit dependency on the builtin module This module is shipped with Bazel itself, so whenever you update your Bazel version, this module's contents (and deps) can potentially change too. |
Thanks for sending the fix to google-benchmark! However, I don't think this dependency was introduced via the builtin bazel/src/test/tools/bzlmod/verify_default_lock_file.sh Lines 36 to 60 in 35e5284
And I think the root cause is actually for rules_foriegn_cc to fix |
Yes, while that issue is in |
Description of the bug:
I noticed on bazelbuild/rules_rust#3077 that one of the extensions fails with references to
rules_foreign_cc
whichrules_rust
does not use (to my knowledge) for any dependencies.https://buildkite.com/bazel/rules-rust-rustlang/builds/13675#0194496d-7d43-4239-a8b9-bf9b265ad98d
Note that
rules_rust
uses--incompatible_autoload_externally=
I ran
bazel build --experimental_repository_resolved_file=resolved.json //...
and found the following entry:Why would this be showing up at all?
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.
extensions/prost
bazel test //...
Which operating system are you running Bazel on?
Linux, Macos, Windows
What is the output of
bazel info release
?8.0.0
If
bazel info release
returnsdevelopment 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
The text was updated successfully, but these errors were encountered: