Hmm... I think that `help` is implemented as a bui...
# development
w
Hmm... I think that
help
is implemented as a built-in goal now?
w
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
All of help is implemented outside of the
@rule
engine, so you shouldn't need to get rules involved
w
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
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
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
Wouldn’t be too difficult to add a builtin rule that provides that data, I believe..
w
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
There’s no way to invoke builtin goals from a regular rule, no 😕
w
😢
c
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
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
🤷