target-determinator
target-determinator copied to clipboard
query for attr does not work
I have the following query
driver -targets 'attr(tags, "gov", "//...")' 3db60bbdd57d39ea1b8acd6d7d650f7100842c5b
but it reported the following error.
however the bazel query 'attr(tags, "gov", //...)')
works.
This worked for me in our testdata repository:
% (cd ../target-determinator-testdata && git checkout 3d22ee76c892762fc979eaf0be10019f56c82995) && bazel-bin/driver/driver_/driver -working-directory ../target-determinator-testdata -targets 'attr(tags, "gov", "//...")' d00fdc57fad09fbdc1a9b9e53ce0a102e813fd1a
HEAD is now at 3d22ee7 Set jvm_flags
2022/07/07 10:48:33 Discovering affected targets
2022/07/07 10:48:33 Processing revision 'before' (sha: d00fdc57fad09fbdc1a9b9e53ce0a102e813fd1a)
2022/07/07 10:48:34 Running cquery on deps(attr(tags, "gov", "//..."))
2022/07/07 10:48:34 Running cquery on attr(tags, "gov", "//...")
2022/07/07 10:48:34 Matching labels to configurations
2022/07/07 10:48:34 Hashing targets
2022/07/07 10:48:34 Processing revision 'after' (current working directory state)
2022/07/07 10:48:35 Running cquery on deps(attr(tags, "gov", "//..."))
2022/07/07 10:48:36 Running cquery on attr(tags, "gov", "//...")
2022/07/07 10:48:36 Matching labels to configurations
2022/07/07 10:48:36 Hashing targets
2022/07/07 10:48:36 No targets were affected, not running Bazel
Could you try running in our testdata repo (https://github.com/bazel-contrib/target-determinator-testdata) to see if you hit the same issue, or if things work there? That would help to diagnose whether this is a repository-specific issue, a machine-specific issue, or something weirder.
Below that error message, there should be the output from Bazel from trying to run the query - could you share that? Or take a look to see if there's anything illuminating as to why the query failed there?
Note that the query actually being run is bazel query 'deps(attr(tags, "gov", //...)'))
- there's an extra deps(
around the query you pasted - does that work for you?
Thanks for reply! This is a repository-specific issue
, mainly lead by that there is not enough information printed when running cquery
.
maybe we can add the verbose
flag for a better debug.
Is the information printed just not clear, or is it not printed at all?
https://github.com/bazel-contrib/target-determinator/pull/5 was intended to try to make it more clear "look down for more logs" - does that help, or was there legit missing information, rather than hard to spot information?