<#17129 Require goals to explicitly locate/choose ...
# github-notifications
q
#17129 Require goals to explicitly locate/choose an environment, and pin `graph` calculations to `__local__` Issue created by stuhood Currently,
determine_bootstrap_environment
is called to compute a "default"
EnvironmentName
before the rule graph is entered, such that all `@goal_rule`s have one in scope automatically. While this was useful for getting things going and proving out our cross-compilation capabilities (demonstrated in #11148 and #13682), it is error prone. The environment design has been trending toward (eventually) giving all targets an
environment=
field (even if the vast majority of the time it is only set via
__defaults__
). And in a world where ~all targets have an
environment=
field, ever accidentally using the default would definitely represent an issue. Instead, we'd like to put the onus on each
@goal_rule
to select the relevant environment (usually via targets). Additionally, to resolve the open question in Appendix A in the design doc, we will pin effectively all calculations in
graph.py
to the
__local__
environment (to eventually potentially be made configurable). This will mean that graph-introspection goals won't need to choose environments, and other `@goal_rule`s won't need to select an environment while computing the graph. pantsbuild/pants