witty-crayon-22786
06/24/2020, 8:27 PM--levels={
'pants.backend.python.rules.pex.Pex': debug,
}
…which would set that log level for rules below the Pex
type in the rule graphhundreds-breakfast-49010
06/24/2020, 8:29 PMwitty-crayon-22786
06/24/2020, 8:30 PMhundreds-breakfast-49010
06/24/2020, 8:30 PMwitty-crayon-22786
06/24/2020, 8:30 PMhundreds-breakfast-49010
06/24/2020, 8:30 PMEngineAware
log-level changing (I have a PR that uses this functionality nearly ready)witty-crayon-22786
06/24/2020, 8:31 PM-ldebug
, which is a recursive option (boo)hundreds-father-404
06/24/2020, 8:32 PMwitty-crayon-22786
06/24/2020, 8:32 PMit means that pants administrators have to have a reasonably sophisticated idea of what the rules are (and how to specify them) that are relevant to debugging their problemi don’t see what the alternative is when debugging a problem. it’s just a question of whether it’s file level, class level, rule-graph level, etc.
hundreds-father-404
06/24/2020, 8:33 PMwitty-crayon-22786
06/24/2020, 8:33 PMFor example, with plugin authors, we can re-export the symbol and do a deprecationsame here?
hundreds-father-404
06/24/2020, 8:34 PMthis kind of stuffwhat stuff
witty-crayon-22786
06/24/2020, 8:34 PM-ldebug
globally is rarely workablehundreds-father-404
06/24/2020, 8:36 PM--python-setup-level
, --pex-level
, or --pytest-level
My concern is leaking to end users every single file and symbol that we’ve written as now being valid to use in the options systemhappy-kitchen-89482
06/24/2020, 8:38 PMgetLogger(__name__)
.witty-crayon-22786
06/24/2020, 8:39 PMhappy-kitchen-89482
06/24/2020, 8:40 PM--level
option, because that option is recursive, so it's registered on every scope.witty-crayon-22786
06/24/2020, 8:40 PMrecursive
option, which as discussed yesterday is problematic… almost nothing consumes it.happy-kitchen-89482
06/24/2020, 8:40 PMhundreds-father-404
06/24/2020, 8:41 PMpants.backend.python.rules.pex.Pex
will continue working across versions. So, you shouldn’t ever check into VCS the value in a config file. It’s only for ephemeral debuggingwe do, but it’s a recursive option, which as discussed yesterday is problematic… almost nothing consumes it.Right, which is why I keep advocating for call sites needing to explicitly opt in to them having this option. The issue isn’t with subsystems having the option; the issue is that they have it no matter what, even if they don’t consume it
witty-crayon-22786
06/24/2020, 8:42 PMThe issue isn’t with subsystems having the option; the issue is that they have it no matter what, even if they don’t consume itright. what i’m proposing is something else. native support in the engine for configuring per-subgraph levels.
hundreds-father-404
06/24/2020, 8:43 PMin practice, we will need to mark a bunch of these public APIs. maybe not that one, but yea.Yes, but only public to plugin authors. Not to every-day users. Every-day users shouldn’t need to know about the internals of Pants’ implementation
witty-crayon-22786
06/24/2020, 8:45 PMrecursive
options don’t really work in practice, this is potentially a graph-aware path forward for --level
src/python/pants/option/global_options.py
169- "-l",
170- "--level",
171- type=LogLevel,
172- default=<http://LogLevel.INFO|LogLevel.INFO>,
173: recursive=True,
--
859- register(
860- "--colors",
861- type=bool,
862- default=sys.stdout.isatty(),
863: recursive=True,
--
923- register(
924- "-q",
925- "--quiet",
926- type=bool,
927: recursive=True,
--
941- register(
942- "--fail-fast",
943- advanced=True,
944- type=bool,
945: recursive=True,
--
950- register(
951- "--cache-key-gen-version",
952- advanced=True,
953- default="200",
954: recursive=True,
--
968- "--max-subprocess-args",
969- advanced=True,
970- type=int,
971- default=100,
972: recursive=True,
hundreds-father-404
06/24/2020, 8:48 PMrecursive
options. Pants 2.0 is the time to do thatwitty-crayon-22786
06/24/2020, 8:50 PMLogLevel
, which is a singleton currently (here: https://github.com/pantsbuild/pants/blob/ee9ca02ba891803861862a28f04b66784cf2453f/src/python/pants/backend/python/rules/pex.py#L307-L344 )LogLevel
would not be a singleton… instead, a Param
that might be different in different subgraphshappy-kitchen-89482
06/24/2020, 8:57 PMrecursive=True
options removes some complexitywitty-crayon-22786
06/24/2020, 8:59 PM@rule
“name” too…?Subsystem