cquery --output=files ignores source files #16599
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Configurability
platforms, toolchains, cquery, select(), config transitions
type: bug
Description of the bug:
I try to use
bazel cquery --output=files
to replacebazel run --run_under=echo
in order to find the path to files which may later be run (or e.g. passed as arguments to other scripts).Sometimes this is for complex targets, e.g. an alias where on some platform we use a pre-built binary and on another we build a binary, e.g. something like:
However,
bazel cquery --output=files :my_binary
ignores source files because of this filtering.I think there should be a way to ask bazel "what file(s) does this resolve to?", regardless of whether the file is generated or checked in.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
% touch WORKSPACE && touch prebuilt && chmod 0755 prebuilt && echo 'exports_files(["prebuilt"])' > BUILD.bazel && bazel cquery --output=files :prebuilt 2>/dev/null
Expect to see
prebuilt
output, but actually see nothing.Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?release 5.3.2
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
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
/cc @fmeum @gregestren
The text was updated successfully, but these errors were encountered: