busy-vase-39202
09/16/2022, 5:54 PMancient-vegetable-10556
09/16/2022, 6:18 PMancient-vegetable-10556
09/16/2022, 6:20 PMget_option
API to resolve environment-sensitive values to add:
1. static type safety
2. making it a (runtime?) error to access environment-sensitive variables directly off the subsystemcurved-television-6568
09/16/2022, 6:57 PMhundreds-father-404
09/16/2022, 7:20 PMget_option
? I'm trying to figure out what to do with the global option remote_execution_extra_platform_properties
. (I'll try this out rn)ancient-vegetable-10556
09/16/2022, 7:22 PMancient-vegetable-10556
09/16/2022, 7:22 PMGlobalOptions
is a Subsystem
, so it should Just Work™witty-crayon-22786
09/16/2022, 7:23 PMancient-vegetable-10556
09/16/2022, 7:24 PMwitty-crayon-22786
09/16/2022, 7:25 PMSubsystem
construction from consuming the environment is that field defaults are used at some point during EnvironmentTarget
construction, which causes a cycle?ancient-vegetable-10556
09/16/2022, 7:26 PMEnvironmentTarget
, and there is a Gigantic Flipping Question Mark around what it would mean for EnvironmentTarget
to be present when they are constructedancient-vegetable-10556
09/16/2022, 7:27 PMwitty-crayon-22786
09/16/2022, 7:27 PM@union(in_scope_types=[EnvironmentName])
…hundreds-father-404
09/16/2022, 7:27 PMhundreds-father-404
09/16/2022, 7:28 PMslightly more verbose call sitesThis only impacts plugin authors, not end users
ancient-vegetable-10556
09/16/2022, 7:29 PMhundreds-father-404
09/16/2022, 7:29 PMwitty-crayon-22786
09/16/2022, 7:30 PMdiff --git a/src/python/pants/engine/target.py b/src/python/pants/engine/target.py
index b77b0c0ad1..cff934776f 100644
--- a/src/python/pants/engine/target.py
+++ b/src/python/pants/engine/target.py
@@ -264,7 +264,7 @@ class AsyncFieldMixin(Field):
)
-@union
+@union(in_scope_types=[EnvironmentName])
@dataclass(frozen=True)
class FieldDefaultFactoryRequest:
"""Registers a dynamic default for a Field.
ancient-vegetable-10556
09/16/2022, 7:30 PMancient-vegetable-10556
09/16/2022, 7:30 PMwitty-crayon-22786
09/16/2022, 7:31 PMwitty-crayon-22786
09/16/2022, 7:31 PMsparse-lifeguard-95737
09/16/2022, 7:32 PMcommon.sh
test_common.sh
BUILD.pants
where test_common.sh
invokes common.sh
, and the BUILD.pants
file had:
shell_sources()
shunit2_tests(name="tests", shell="bash")
this worked fine in v2.13, but on v2.14.0rc0 test_common.sh
started failing with a “no such file or directory” error when it tried to invoke common.sh
. adding an explicit dependency in the BUILD.pants
made things work againwitty-crayon-22786
09/16/2022, 7:34 PMTransitiveTargets
/ DependenciesRequests
, etc: yes, they will be computed multiple times unless we explicitly pin them to being computed in a particular environmentwitty-crayon-22786
09/16/2022, 7:34 PMwitty-crayon-22786
09/16/2022, 7:35 PMEnvironmentName
can be approximately everywhereancient-vegetable-10556
09/16/2022, 7:42 PMancient-vegetable-10556
09/16/2022, 7:44 PMwitty-crayon-22786
09/16/2022, 7:45 PMancient-vegetable-10556
09/16/2022, 7:48 PM