Skip to content
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

query for attr does not work #17

Open
libratiger opened this issue Jul 7, 2022 · 3 comments
Open

query for attr does not work #17

libratiger opened this issue Jul 7, 2022 · 3 comments

Comments

@libratiger
Copy link

I have the following query

driver -targets 'attr(tags, "gov", "//...")' 3db60bbdd57d39ea1b8acd6d7d650f7100842c5b

but it reported the following error.

image

however the bazel query 'attr(tags, "gov", //...)') works.

@illicitonion
Copy link
Collaborator

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?

@libratiger
Copy link
Author

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.

@illicitonion
Copy link
Collaborator

Is the information printed just not clear, or is it not printed at all?

#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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants