-
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
cquery's config function doesn't work with Bzlmod #19823
Comments
/cc @gregestren |
/cc @katre |
Bazel tests status: - Bzlmod disabled: - AnalysisTestCase: to be migrated - ConfigurationTestCase: to be migrated - ConfigCommandTest: to be migrated, probably blocked by a bug - Bzlmod enabled: - BuildViewTestCase: migrated at d51144c - Java integration tests migrated at 8d04711 - Shell integration tests migrated at 175a18d (Bzlmod disabled in some tests) - Python integration tests migrated at 50c8375 (Bzlmod disabled in some tests) - BuildIntegrationTestCase: migrated in this change - Other Java unit tests migrated in this change Issues identified: - cc_shared_library doesn't work well with Bzlmod: #19822 - `bazel config` doesn't work well with Bzlmod: #19823 Fixes #18958 Tracking migration of remaining test cases in #19824 RELNOTES[INC]: Bzlmod is enabled by default, please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. Find more details at #18958 PiperOrigin-RevId: 573827480 Change-Id: I097b4bd7caafc996b034284ee688b8f3d2bca1f7
bazel config
doesn't work with Bzlmod enabled
As @fmeum mentioned at #19785 (comment), you can also demonstrate this with |
@fmeum I'm not recreating the failure you described in #19785 (comment) at the command line. I can reproduce the test failure. But a direct i cquery / config invocation with bazel@head with
|
With this setup: # MODULE.bazel (empty)
# WORKSPACE (empty)
# pkg/BUILD
load("//pkg:rule.bzl", "demo_rule")
sh_binary(name = "tool", srcs = ["tool.sh"])
demo_rule(
name = 'demo',
binary = ":tool",
)
# pkg/rule.bzl
def _impl(ctx):
pass
demo_rule = rule(
implementation = _impl,
attrs = {
"binary": attr.label(cfg = "exec"),
},
)
# pkg/tool.sh
echo "Hello"
exit 0 I get: $ USE_BAZEL_VERSION=2ddacab80af1dca3c04e74809827c47ec4bc8498 bazel --nohome_rc --nosystem_rc cquery "deps(//pkg:demo)"
//pkg:demo (cb4f3cc)
@local_config_platform//:host (f3e0989)
//pkg:tool (bac8967)
...
$ USE_BAZEL_VERSION=2ddacab80af1dca3c04e74809827c47ec4bc8498 bazel --nohome_rc --nosystem_rc config
Available configurations:
$ USE_BAZEL_VERSION=2ddacab80af1dca3c04e74809827c47ec4bc8498 bazel --nohome_rc --nosystem_rc cquery "deps(//pkg:demo)" --noenable_bzlmod
//pkg:demo (cb4f3cc)
@local_config_platform//:host (f3e0989)
//pkg:tool (bac8967)
...
$ USE_BAZEL_VERSION=2ddacab80af1dca3c04e74809827c47ec4bc8498 bazel --nohome_rc --nosystem_rc config --noenable_bzlmod
Available configurations:
bac89673cb6a316d6814d09db69e2300dd9796229313c36bc7c06680a1c4d8ec k8-opt-exec-ST-e846b08c7501 (exec)
cb4f3ccb516213afb57b51cb2aba480bc44b184b701bcc30e6dd090e8540af2b k8-fastbuild
f3e09891a52a118ada4747b9fed7d209ab6049a7786710934f5f50e1d0f82f2a fastbuild-noconfig |
It seems likely that this is also the cause of bazel-contrib/rules_go#3597 (comment). |
I will submit a fix shortly. |
@bazel-io flag |
I submitted #19842. |
@bazel-io fork 6.4.0 |
…update Ensure that `BazelLockFileModule` only updates `MODULE.bazel.lock` if the content of the file needs to change. Every such update changes the file's metadata, which results in Skyframe invalidation of, in particular, all configurations. This broke `bazel config`, which uses `MemoizingEvaluator#getDoneValues()` to directly observe Skyframe state. Compared to the original commit bazelbuild@78db9ae, this cherry-pick does not include the change to `bazel config` as it may not be backwards compatible (changes the exit code in certain situations). Fixes bazelbuild#19823 Closes bazelbuild#19842. PiperOrigin-RevId: 574133346 Change-Id: I5886c91fc6b7b938a7dee59ea75aa7b8afb5b161 Fixes bazelbuild#19843
#19848) …update Ensure that `BazelLockFileModule` only updates `MODULE.bazel.lock` if the content of the file needs to change. Every such update changes the file's metadata, which results in Skyframe invalidation of, in particular, all configurations. This broke `bazel config`, which uses `MemoizingEvaluator#getDoneValues()` to directly observe Skyframe state. Compared to the original commit 78db9ae, this cherry-pick does not include the change to `bazel config` as it may not be backwards compatible (changes the exit code in certain situations). Fixes #19823 Closes #19842. PiperOrigin-RevId: 574133346 Change-Id: I5886c91fc6b7b938a7dee59ea75aa7b8afb5b161 Fixes #19843
A fix for this issue has been included in Bazel 6.4.0 RC5. Please test out the release candidate and report any issues as soon as possible. Thanks! |
@bazel-io fork 7.0.0 |
Description of the bug:
When Bzlmod is enabled,
//src/test/shell/integration:configured_query_test
fails withsee #19785 (comment)
Which category does this issue belong to?
Configurability
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
To reproduce:
disable_bzlmod
fromsrc/test/shell/integration/configured_query_test.sh
bazel test //src/test/shell/integration:configured_query_test --test_filter test_config_function
Which operating system are you running Bazel on?
No response
What is the output of
bazel info release
?No response
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 master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
It's very likely
//src/test/java/com/google/devtools/build/lib/runtime:ConfigCommandTest
is failing with the same reason when enabling Bzlmod.The text was updated successfully, but these errors were encountered: