-
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 produces non-actionable warning related to toolchains #11993
Comments
This means that something referred to that target, but it hadn't actually been analyzed as part of the build (in this case, '//:tab_python_runtime_pair What is your preference? Do not show the message? Make it clearer what is happening? |
Adding @juliexxia as a cquery expert while we determine the right course of action. |
Frankly I still don't quite understand what causes the warning. And the fact that the warning shows up only when |
Looks like, without With If I try to build
This may be due to me having to complete the BUILD files for linux (your repro only has Windows paths). Based on the Windows config, I assumed that the correct URL for linux would be |
It is not the correct path and I don't see the correct one there. Need 30 min to make Linux compatible repro. |
Thanks! |
re: this specific warning in the query environment. It's difficult to be totally sure without running the full repro, but the error is coming from here: bazel/src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java Line 260 in 487d0b2
We ran into a similar issue a while back with mysteriously not-there garden variety (not-toolchain) nodes in the cquery graph which may be related? bazel/src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java Line 424 in 487d0b2
Basically, I think that while trying to get all dependencies of a particular target in the graph, if any calculated dependency does not fall into any cases in this if/else, this warning will print. Not totally sure without a repro though. |
Repro updated. |
Thanks! Okay, I see the same behavior: with the flag, One question I had: why are you using the flag |
We are not using |
I am not saying this warning is a blocker by any means, more like an indication of the possible bug which better be discovered early than later. |
It's definitely surprising, I'm going to keep investigating. |
Okay, added some test code to PostAnalysisQueryEnvironment to dig into skyframe and report configured targets with the same label but which aren't the same, and here we are:
So, the issue is that, when toolchain transitions are in use, toolchains actually have Coincidentally, @juliexxia was working on this just yesterday, so it should be fixed soon. Thanks, @konste, for bringing this to my attention. |
Toolchain deps were not being caught by implicit deps filtering because there's no way to tell them apart from regular deps. Thus, we add (back) logic to do it during ruleContext building. This was caught by a user in unknown commit when they fixed our test for us. The test fix in included in this CL. Fixing the test triggered the bug. Fixes bazelbuild#11993 PiperOrigin-RevId: 333367049
As far as I understand the fix is released with the version 3.7.0. Is that right? |
31b0453 is in 3.7.0. If you're still seeing strange results, and if it's not a problem to come up with a repro, please do and we'll take a look some more. |
I have tried my original repro here and it still reproduces on both Windows and Linux. Try the command |
@katre This issue needs to be re-activated. Hopefully, it requires just a little amendment to your existing fix and it would not take much of your time. |
@katre could we please get some traction on this issue so the fix can make it to 4.0? It produces confusing WARNING for our users which we cannot suppress and we get support tickets for that. |
I'm sorry this has been sitting for so long. I have been snowed under by other projects and this has slipped through. Unfortunately, since the cut for 4.0 is happening shortly and I am busy with BazelCon activities, I don't know if I'll be able to debug this further and identify a fix before the cut. |
@katre Thank you for getting back to me! I realized that meeting 4.0 cut time is tough and retract my ask for it. Still, it would be great to have this issue fixed this year. We try to stay at the edge and upgrade to every monthly Bazel release, often including RCs when they contain the fixes we need, so missing 4.0 cut off is not that important as we hopefully can get the fix only about a month later. |
- Fix looking up a target from the walkable graph. - This prevents ConfiguredTargetValueAccessor from needing to look into ConfiguredTargetAccessor. - And removes duplicated code. - Move CTVA into the correct package. Part of bazelbuild#11993.
Uses a default value for non-alias and non-rule CTs. This alloows removing many instanceof/cast checks when getting config conditions. Part of the work on bazelbuild#11993.
This will allow us to keep the configured target key between lookup rounds. Fixes bazelbuild#11993.
Okay, I have a clean-looking fix, but it requires a decent bit of cleanup. I'll send out the stages for review over the next week or so (given the break for US holidays this week). |
Uses a default value for non-alias and non-rule CTs. This alloows removing many instanceof/cast checks when getting config conditions. Part of the work on bazelbuild#11993.
This will allow us to keep the configured target key between lookup rounds. Fixes bazelbuild#11993.
Super! Thanks @katre for a kind of unexpected ton of work! But as far as I understand this fix prevents much more serious problems in the future than the cosmetic issue I initially reported. |
Bazel 4.1 would be the release to contain this. I'm not sure it's something we can cherrypick into 4.0, unfortunately. |
Part of #11993. PiperOrigin-RevId: 344304990
Part of #11993. PiperOrigin-RevId: 344304990
Part of #11993. PiperOrigin-RevId: 344304990
Toolchain deps were not being caught by implicit deps filtering because there's no way to tell them apart from regular deps. Thus, we add (back) logic to do it during ruleContext building. This was caught by a user in unknown commit when they fixed our test for us. The test fix in included in this CL. Fixing the test triggered the bug. Fixes bazelbuild/bazel#11993 PiperOrigin-RevId: 333367049
Description of the problem / feature request:
IF
--incompatible_override_toolchain_transition
is in effect;3 command is
bazel cquery deps(Foo) THEN
WARNING: Targets were missing from graph` is generated.The small repro with Python toolchain is published here
We get exactly the same problem with C++ toolchain as well.
What operating system are you running Bazel on?
Windows, Linux, OSX.
What's the output of
bazel info release
?3.4.1
The text was updated successfully, but these errors were encountered: