https://pantsbuild.org/ logo
#development
Title
# development
a

aloof-angle-91616

07/01/2020, 9:49 PM
is there a reason we decided
def global_subsystems()
was v1-only? if i define a context-aware object factory in my v2 ruleset which pulls in a subsystem using
.global_instance()
, i need that subsystem to be available. i was able to overcome this by just registering it as a v1 plugin as well, but unless we plan to literally deprecate
.global_instance()
for v2 (which it's not clear that we are) it seems like we should allow
global_subsystems
to be in v2 plugins as well
h

hundreds-father-404

07/01/2020, 9:54 PM
cc @happy-kitchen-89482. He came upon this yesterday
It’s possible that we want to keep the hook, but don’t document it so that we have more flexibility to remove later. Personally, I think it would be nice to remove
.global_instance()
to simplify the Optionable code, but I don’t think anyone has any plans to do this yet
a

aloof-angle-91616

07/01/2020, 9:56 PM
i think it would be great to do that
h

hundreds-father-404

07/01/2020, 9:56 PM
which part does “that” refer to?
a

aloof-angle-91616

07/01/2020, 9:56 PM
the second paragraph
👍 1
h

hundreds-father-404

07/01/2020, 9:56 PM
I think the only blocker is not knowing how
object
and
CAFO
would access subsystems
👍 1
a

aloof-angle-91616

07/01/2020, 9:57 PM
SubsystemRule
or whatever it is now is just exactly what we need
yea
i was trying to think of whether i had run into literally the only edge case
which i think i did with the CAOF to make different thrift libraries in the twitter repo
h

hundreds-father-404

07/01/2020, 9:57 PM
I don’t think anyone has thought about what CAFO should look like. DWH intentionally didn’t try to replace it and wanted a light-weight macro system to start
i was trying to think of whether i had run into literally the only edge case
Agreed that I think object/CAFO are the only remaining uses of
.global_subsystem()
a

aloof-angle-91616

07/01/2020, 9:59 PM
i think we can deprecate our usage of CAOF and turn them into macros at twitter, it's mainly the thrift libraries one and i think the new macro system can do everything except maybe access option values
h

hundreds-father-404

07/01/2020, 10:00 PM
We can’t for Pants. Pants depends on CAOF for
python_requirements
and
pants_requirement
. And the new macros don’t work there because the loading mechanism; new macros are only internal to your own repo, afaict
I think we need a modern replacement to CAOF. We would have it for more advanced cases that the light weight macros can’t cover
a

aloof-angle-91616

07/01/2020, 10:01 PM
i would prefer to have a single macro system
👍 1
w

witty-crayon-22786

07/01/2020, 10:01 PM
a

aloof-angle-91616

07/01/2020, 10:01 PM
that is fantastically helpful thank you
i think stu's issue link might be the way we can avoid making the macro system too heavyweight
w

witty-crayon-22786

07/01/2020, 10:02 PM
pretty stale… lots has changed. but
python_requirements
is still the hold out.
✍️ 2
h

hundreds-father-404

07/01/2020, 10:03 PM