Add support for deprecating scoped SubsystemDependencies #6961
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
In order for a
v2
Goal
(in #6880) to replace a goal that was previously implemented as a collection of v1Task
s, we need the ability to declare a deprecated dependency on aSubsystem
(concretely:CacheSetup
, in that case).As explained in the patch, this is different from
Optionable.deprecated_scope
in one fundamental way: withdeprecated_scope
options live in two locations simultaneously (one of which is deprecated), while with a deprecated dependency they live in one location (which is deprecated). This split plays out in the unit tests, which verify thatOptionable.deprecated_scope
allows for splitting of a deprecated scope between two new destinations.Solution
Add a
removal_version
toSubsystemDependency
andScopeInfo
, and consume it inOptions
in order to render a warning for a deprecatedScopeInfo
.The ability to deprecate a scoped dependency is exposed via
Subsystem.scoped(cls, removal_version=.., removal_hint=..)
.Result
Callers can use
Subsystem.scoped(cls, removal_version=.., removal_hint=..)
to deprecate a scopedSubsystem
dependency. #6880 will be unblocked to introduce a deprecated dependency onCacheSetup
for v2 goals.