ibazel --target_pattern_file=/tmp/target-file.txt fails to identify files to watch
Describe the bug
ibazel fails to figure out what files to watch, when using --target_pattern_file.
ibazel build --target_pattern_file=/tmp/target-file.txt will spit out errors:
> bazel query //react:build > /tmp/target-file.txt
> ibazel build --target_pattern_file=/tmp/target-file.txt
iBazel [1:21PM]: Querying for files to watch...
INFO: Invocation ID: 82c7686c-0c14-4a89-bf9a-906adfac98cd
Loading: 0 packages loaded
INFO: Empty results
iBazel [1:21PM]: Didn't find any files to watch from query buildfiles(deps(set()))
INFO: Invocation ID: 3720b271-ec5a-4ebe-ad20-e24a7be0f209
Loading: 0 packages loaded
INFO: Empty results
iBazel [1:21PM]: Didn't find any files to watch from query kind('source file', deps(set()))
iBazel [1:21PM]: Building
INFO: Invocation ID: ca171cf4-1bd3-4345-8bd8-10a17ee744af
Analyzing: target //react:build (83 packages loaded, 15 targets configured)
Reproduction instructions
Steps to reproduce the behavior:
git clone [email protected]:bazelbuild/examples.gitcd examples/frontendbazel query //react-router:build > /tmp/target-file.txtcat /tmp/target-file.txt- Expected to see:
//react-router:build - Run
ibazel build --target_pattern_file=/tmp/target-file.txt - Observe error above.
- Modify:
frontend/react-router/app/entry.client.tsx - ibazel doesn't re-build.
Expected behavior A clear and concise description of what you expected to happen.
I expect ibazel to be able to recognize what files it needs to watch when given a target-pattern file.
Actual behavior A clear and concise description of what really happenend instead of the expected.
ibazel fails to identify what files to load.
Version (please complete the following information):
- OS: [e.g. iOS]:
Linux Ubuntu:
uname -a Linux main 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
-
Browser [e.g. chrome, safari] Irrelevant, but Chrome.
-
ibazel Version [e.g. 0.2.4] (run
ibazel 2>&1 | head -n 1to get this)iBazel - Version v0.26.10 -
Bazel version [e.g. 3.1.0] (run
bazel versionto get this. Please include all the lines)bazel 7.1.0in the example above, bazel 7.6.1 in my real-world (closed-source) use-case.
Stale issue message
@samcooke98, sorry to say I think this is working as expected. The flag you're interacting with is a Bazel flag, not an iBazel flag. iBazel doesn't have any code to interpret that, except that we pass it into bazel without modification. The command you invoked ibazel build --target_pattern_file=/tmp/target-file.txt doesn't have a positional parameter which it will use as the query string and thus the query that returns an empty set. If you wish to watch the files associated with a particular target, you would invoke it with ibazel build $TARGET, not with --target_pattern_file.
If you wish to watch the files associated with a particular target, you would invoke it with
ibazel build $TARGET, not with--target_pattern_file.
How would one work around this if the list of targets is too large to fit on a single command line?