Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./pants --no-v1 --v2 doesn't complain about no goals specified #6918

Closed
illicitonion opened this issue Dec 13, 2018 · 0 comments · Fixed by #6880
Closed

./pants --no-v1 --v2 doesn't complain about no goals specified #6918

illicitonion opened this issue Dec 13, 2018 · 0 comments · Fixed by #6880
Assignees

Comments

@illicitonion
Copy link
Contributor

pants$ ./pants --no-v1 --v2 && echo success
WARN] Encountered unhandled exception  during rule execution!
pants$ ./pants --no-v1 --v2 3rdparty: && echo success
success

I suspect this will be fixed in #6880

stuhood pushed a commit that referenced this issue Apr 21, 2019
…6880)

### Problem

While `@console_rule` has existed for a while now, it has not yet been possible to install a `@console_rule` as the exclusive implementer of a goal like `./pants list` (see #6918 and #6651). Additionally, replacing existing goals comes with a need to backwards-compatibly consume options.

### Solution

Run goals that are unambiguously `--v1` or `--v2` without passing those flags: this means that passing the `--v1` vs `--v2` flags is only necessary in cases where both `v1` and `v2` goals are installed.  Additionally, create an `engine.goal.Goal` class with an inner `Optionable` instance in order to claim a CLI scope (and have options), and require one for all `@console_rules`. Finally, add a `ConsoleRuleTestBase` class to easily unit test `@console_rules`.

### Result

The `list` goal is now implemented as a `@console_rule`, and consequently: is faster. `./pants help list` is unchanged due to a deprecated dependency on a `CacheSetup` subsystem, and an optional `Goal`-mixin for wrapping line-oriented output around a `Console`. Fixes #6918 and fixes #6651.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants