posting here because it proposes a change to the o...
# development
posting here because it proposes a change to the options system: basically, it seems like it might be good to allow users to configure environment variables that affect the tools pants invokes, but we generally run those tools with a stripped environment, so this normal method of configuration doesn't really work. particularly in the case of pex, we have to introduce pants options to cover each new pex option, which causes options fatigue as well as annoying variance in what's deprecated over time. i think we could introduce a
which doesn't register any options itself, but allows environment variables in the form
to be converted to just
environment variables when we go to run a process (where
is the value of a class-level string field
. making this a subsystem (or not, and using some other method) means we could hook it up to
./pants help
and allow the user to see what variables are in their environment which would affect a pants execution, and we could also incorporate the tool's own help text for its environment variables. posting here because i made the comment specifically regarding using this for pex in the issue, and i want to see what response i get to that before trying to make a more general issue
thank you! will review
given that, is there value in maintaining options like
in the totally separate
subsystem? i am also somewhat interested in the idea of displaying the options that are available in
./pants help
, as well as pulling the env vars help output from pex itself (since it's mostly trivial to use pex to pull down the version of pex that pants is using, then invoking its help in the command line, but not entirely trivial)
pex's env var help being parseable allows for this, it may not be very generalizable
it also has a nice TODO that relates 100% to my thoughts here:
Copy code
# TODO: We may want to support different sets of env vars for different types of process.
#  Can be done via scoped subsystems, possibly.  However we should only do this if there
#  is a real need.