aspect-build/aspect-cli

[Bug]: bazel --query_file goes to interactive

justhecuke opened this issue · 1 comments

What happened?

$ bazel --version
aspect 5.8.20

$ echo '//:all' > queryfile.txt
$ bazel query --query_file queryfile.txt

Results in an interactive prompt:

Use the arrow keys to navigate: ↓ ↑ → ← 
? Select a preset query: 
  ▸ why: Determine why targetA depends on targetB
    deps: Get the deps of a target

This should not happen. The query should execute what is in the query_file and not start an interactive prompt.

Version

Development (host) and target OS/architectures:
22.04.1-Ubuntu SMP Fri Nov 17 21:07:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Output of bazel --version:
aspect 5.8.20

Our .bazelversion is 6.4.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
N/A

Language(s) and/or frameworks involved:
N/A

How to reproduce

echo '//:all' > queryfile.txt
bazel query --query_file queryfile.txt

Any other information?

No response

Calling

bazel query --aspect:interactive=false --query_file queryfile.txt

should work-around the issue.

We should fix this in the CLI, however, to not go into interactive mode if the user specifies a --query_file