bad news good news time re: rust pantsd client!
# development
w
bad news good news time re: rust pantsd client!
the bad news: i looked at options parsing, and i just don’t see a way to incrementally port less than about 2000 lines of code to allow rust to get the micro-bootstrap options
so i started looking at how bad it would be to have a rust entrypoint, and still use a bit of python code here
the actual bootstrap options parsing only takes 150 ms. but it occurs after we have spent nearly a second importing stuff.
----
good news is, a huge amount of that import time is because of v1 hacks: in particular, this one: https://github.com/pantsbuild/pants/blob/82be0c568fe0a74393cd1cda95e702b51b888394/src/python/pants/init/engine_initializer.py#L8-L14
…meaning that we import three backends in order to bootstrap options currently.
and that’s good news, because … we’re about to delete all of that, heh.
👍 2
h
Interesting
What is in those 2000 lines?
Why is parsing micro-bootstrap options that laborious?
w
what you need is (significant chunks of):
Copy code
OptionsBootstrapper
Options
OptionValueContainer
Config
Parser
RankedValue
because you need to support setting that flag in any config file identified by bootstrap
👍 1
you can leave out ParserHierarchy and ArgSplitter because they are only used post-bootstrap when scopes come into play
----
so, concretely what i’m thinking right now is to see whether we can tackle https://github.com/pantsbuild/pants/issues/7369 first, which will allow for an incremental/partial port of options parsing
in particular, could likely directly use
register
and
Parser
, which are huge chunks of code.
and then incrementally port other bits.
7369 might have a small impact on its own, but the larger impact is just that we can import the absolute minimum amount necessary to parse bootstrap options, and then move incrementally to shrink them.
h
Makes sense. Agreed that parsing
pants.toml
wouldn’t work
Once we remove v1, we can consider a much more dramatic rewrite of Subsystems, possibly in a Rust-centric way. For example, we won’t need
global_instance()
anymore
w
yea, can do that immediately even! exciting.
❤️ 1
(… me falling into common trap of course: “unblocked immediately” doesn’t mean “should do immediately”, but yea)
h
doesn’t mean “should do immediately”,
Agreed. I think it’ll be possible to do things like re-envision subsystems in a few months. Not at all blocked by 2.0