-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Add the ability to consume scoped Options from @rules #6872
Add the ability to consume scoped Options from @rules #6872
Conversation
Commits should be useful to review independently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scanned through, looks good. Some errors in CI seem legit tho
…` re-parses bootstrap options anyway.
7872458
to
2bd4f6d
Compare
This no longer depends on #6871. |
…ptionsBootstrapper.
… mid-level integration tests.
2bd4f6d
to
5569e33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just finished reading through all the commits - looks great!
) | ||
|
||
def register_global(*args, **kwargs): | ||
## Only use of Options.register? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there before: just moved.
Have seen #6879 a few times today, and restarting shards has fixed it. Merging. |
### Problem #6872 laid groundwork for consuming `(Scoped)Options` from `@rules`, but did not actually expose a facility for a `@(console_)rule` to consume a `Subsystem`. ### Solution Expose `ScopedOptions` parsing to `@console_rules`, and add a helper method that creates an `@rule` to construct a `Subsystem`. Finally, use this facility to have `v2` `list` consume a `Subsystem` that holds options that define (most) of the behaviour that would allow it to replace the `Task`/`v1` implementation of `./pants list`. ### Result `@rules` and `@console_rules` can consume `Subsystems`. This is a prerequisite for #6880, which will build atop this facility to fully support `v2`-only goals, and replace `v1` `list` with `v2` `list`.
Problem
As described in #5869, we need a way to consume
Options
in the new engine in order to provide access toSubsystems
in@rules
.Solution
Convert
OptionsBootstrapper
andConfig
intodatatype
s in order to give them useful eq/hash implementations.Then, modify the
@rules
that were added in #5889 to consume theParams
API added in #6871 and expose aScopedOptions
wrapper around the set of options for aScope
.Result
@rules
can consumeScopedOptions
, although there should probably be built-in rules that can consumeScopedOptions
to createSubsystems
. Nonetheless, let's say that this "fixes #5869", and open a followup for actually exposingSubsystems
to@rules
in a generic way.