purple-plastic-57801
07/10/2023, 11:07 PM//path/to/thing:thing
//path/to/thing:thing_helper
bazel run //path/to/thing
works.
As far as I can tell, pants works this way to.. if the target name matches the directory name it defaults.
Though, if you have more than one target in a BUILD file I am seeing this exception
TooManyTargetsException: The `run` goal only works with one valid target, but was given multiple valid targets:
* third_party/balena:balena
* third_party/balena:login
So question: Can I tell pants to do what I want? default to balena:balena if multiple targets?enough-analyst-54434
07/10/2023, 11:18 PMpurple-plastic-57801
07/10/2023, 11:19 PMpants run third_party/balena -- --version
16:18:50.12 [ERROR] 1 Exception encountered:
Engine traceback:
in `run` goal
TooManyTargetsException: The `run` goal only works with one valid target, but was given multiple valid targets:
* third_party/balena:balena
* third_party/balena:login
Please select one of these targets to run.
enough-analyst-54434
07/10/2023, 11:19 PMpurple-plastic-57801
07/10/2023, 11:19 PMpants run third_party/balena:balena -- -version
works as expected.enough-analyst-54434
07/10/2023, 11:20 PM:
is supposed to be required to glob, which should lead to your error. No trailing :
should not be globbing, it should expand to your working CLI internally... or else the default target concept means nothing.broad-processor-92400
07/10/2023, 11:25 PMfoo/bar
= foo/bar:bar
to foo/bar
= foo/bar:
in 2.13 (https://github.com/pantsbuild/pants/pull/15589 / https://github.com/pantsbuild/pants/issues/14209).broad-processor-92400
07/10/2023, 11:25 PMpurple-plastic-57801
07/10/2023, 11:30 PMthird_party/balena
does the right thing.broad-processor-92400
07/10/2023, 11:30 PMpurple-plastic-57801
07/10/2023, 11:31 PMenough-analyst-54434
07/10/2023, 11:31 PM