You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This invocation of pants specifies a goal but no targets. It does a lot of work and reports SUCCESS, but is almost certainly not what the user wants, no code is actually compiled.
It would help in the argument parsing to know if a goal required one or more targets to be useful because there can be ambiguity between specs and goals if you have a BUILD file one directory deep. Say
pants goal compile compile
If there were a BUILD file named compile/BUILD then this wouldn't be ambiguous (although you can think of other invocations that would be ambiguous)
Garrett and I are going back and forth on how far to take this.
I am on the side that says if you specify a goal like 'compile' but when it gets to the compile phase there are no targets to run, that might be an error (somehow you would want to make sure that there weren't targets that were originally in the graph that you didn't need to run because the results were cached.)
I have been bitten so many times by specifying a goal that doesn't actually depend on any targets that would be directly executed by the goal (like saying running 'goal test' on a /src/... target that doesn't contain any test target types instead of a /tests/target
./pants goal test src/java/com/pants/examples/pingpong/main
10:11:07 00:00 [main]
(To run a reporting server: ./pants goal server)
10:11:08 00:01 [bootstrap]
10:11:08 00:01 [setup]
10:11:08 00:01 [parse]
...
10:11:12 00:05 [test]
10:11:12 00:05 [pytest]
10:11:12 00:05 [junit]
10:11:12 00:05 [specs]
Waiting for background workers to finish.
SUCCESS
I would consider this to be a pants invocation failure, no tests were ever in the graph to run.
The text was updated successfully, but these errors were encountered:
Closing as V2 goals now have a mechanism for doing this by requesting Addresses or Targets in the rule signature, then erroring if it's == 0. Currently, we only error in certain cases if too many targets are given, rather than too little, but it's trivial to implement.
This invocation of pants specifies a goal but no targets. It does a lot of work and reports SUCCESS, but is almost certainly not what the user wants, no code is actually compiled.
It would help in the argument parsing to know if a goal required one or more targets to be useful because there can be ambiguity between specs and goals if you have a BUILD file one directory deep. Say
If there were a BUILD file named compile/BUILD then this wouldn't be ambiguous (although you can think of other invocations that would be ambiguous)
Garrett and I are going back and forth on how far to take this.
I am on the side that says if you specify a goal like 'compile' but when it gets to the compile phase there are no targets to run, that might be an error (somehow you would want to make sure that there weren't targets that were originally in the graph that you didn't need to run because the results were cached.)
I have been bitten so many times by specifying a goal that doesn't actually depend on any targets that would be directly executed by the goal (like saying running 'goal test' on a /src/... target that doesn't contain any test target types instead of a /tests/target
I would consider this to be a pants invocation failure, no tests were ever in the graph to run.
The text was updated successfully, but these errors were encountered: