<@U06A03HV1> ``` class Subsystem(metaclass=ABCMeta...
# development
a
@witty-crayon-22786
Copy code
class Subsystem(metaclass=ABCMeta):
     """A separable piece of functionality that may be reused across multiple tasks or other code.
@@ -46,7 +52,15 @@ class Subsystem(metaclass=ABCMeta):

         TODO: This indirection avoids a cycle between this module and the `rules` module.
         """
+        # Imported here to avoid import cycle (sigh)
+        from pants.core.util_rules.environments import EnvironmentTarget
+        from pants.core.util_rules.environments import EnvironmentsSubsystem
+
+        is_environments_subsystem = cls is EnvironmentsSubsystem
+
         partial_construct_subsystem = functools.partial(_construct_subsytem, cls)
+        if is_environments_subsystem:
+            partial_construct_subsystem = functools.partial(partial_construct_subsystem, cls, None)

         # NB: We must populate several dunder methods on the partial function because partial
         # functions do not have these defined by default and the engine uses these values to
@@ -64,9 +78,9 @@ class Subsystem(metaclass=ABCMeta):
             class_definition_lineno = 0  # `inspect.getsourcelines` returns 0 when undefined.
         partial_construct_subsystem.__line_number__ = class_definition_lineno

             output_type=cls,
-            input_selectors=(),
+            input_selectors=(EnvironmentTarget,) if not is_environments_subsystem else (),
             func=partial_construct_subsystem,
             input_gets=(
                 AwaitableConstraints(
@@ -75,6 +89,9 @@ class Subsystem(metaclass=ABCMeta):
             ),
             canonical_name=name,
         )
I did a quick change to see if making
EnvironmentsSubsystem
not require an
EnvironmentTarget
would work; still getting thousands of rule graph errors. Any idea how to proceed with debugging this one?