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

witty-crayon-22786

10/20/2022, 2:30 AM
Hmm... I think that
help
is implemented as a built-in goal now?
w

wide-midnight-78598

10/20/2022, 2:32 AM
Yep, BuiltIn, which is what I was using - however, if we want to try it out as an export, need to access the full help JSON. Maybe I missed a Request object though, "help" is a hard grep
I guess the other option is whether a rule can call builtin goals
w

witty-crayon-22786

10/20/2022, 2:34 AM
All of help is implemented outside of the
@rule
engine, so you shouldn't need to get rules involved
w

wide-midnight-78598

10/20/2022, 3:25 AM
Yeah, so right now, completions are just another Builtingoal, using the same/similar infra. However, from the
export
rule graph area, how can I get access to help?
w

witty-crayon-22786

10/20/2022, 3:26 AM
mm… you can’t currently. that’s why i had suggested doing this in a builtingoal in the first place
most of those arguments to
HelpInfoExtractor
can be consumed from rules, except for the `goal_consumed_subsystem_scopes`… that’s itself some rule-graph introspection.
w

wide-midnight-78598

10/20/2022, 3:28 AM
Yeahhh, there's been a lot of back and forth - I don't particularly like a custom goal for this, and now that
export
has some cool subsystem functionality, seemed like the ideal place - if the plumbing was in place to grab help data
c

curved-television-6568

10/20/2022, 12:48 PM
Wouldn’t be too difficult to add a builtin rule that provides that data, I believe..
w

wide-midnight-78598

10/20/2022, 12:59 PM
So, the issue I ran into is - can you currently call BuiltIns from within a rule?
If so - I can just call Help and be done, but I didn't see that functionality anywhere (nor do I know if you can just
Get
a scheduler instance or something that allows sibling code to run
c

curved-television-6568

10/20/2022, 1:06 PM
There’s no way to invoke builtin goals from a regular rule, no 😕
w

wide-midnight-78598

10/20/2022, 1:07 PM
😢
c

curved-television-6568

10/20/2022, 1:08 PM
What I would do is add a rule that pulls out all the stuff passed to the builtin goals, and return the extracted helpinfo data from that.
…. (fishing code link…)
https://github.com/pantsbuild/pants/blob/68894b9918d4a1d4802888238f03cbc0c68e9bfd/src/python/pants/init/engine_initializer.py#L266 (wow that was difficult to find today..) This is the list of all builtin rules, haven’t looked at what’s available and what’s required for the HelpInfoExtracter, but I think it should be doable to add another builtin rule here that returns the HelpInfo data structure..
w

wide-midnight-78598

10/20/2022, 1:42 PM
Hmm, so that makes me wonder if it's a good idea - or more of a patch between two systems that are isolated, and mayyybe should/shouldn't be connected? Thanks either way, I'll look at that and see what comes up
c

curved-television-6568

10/20/2022, 2:26 PM
🤷