allow plugins to provide early goals (i.e., the current BuiltinGoal
)
#20931
Replies: 3 comments 24 replies
-
I'm interested about this LSP idea too? What would Pants serve over the LSP - as the VSCode plugin could make use of this too. In the Slack chat, where we landed on as a short-term solution was that I've used Aside: I also want to play around with the BSP later on - as right now, I'm using raw pants commands to interact with pants + vscode plugin but that feels... Blah. |
Beta Was this translation helpful? Give feedback.
-
Just to grab my comment from the PR that raised this discussion:
Re: 2
I don't see why not, if the name was something different. I think in an ideal world, it would be nice to have everything filter through the I don't know enough about the technical background about why they were split up like that, nor the implications (re: performance, customization, etc) to have any strong opinions otherwise. Re: 3
I don't particularly like "early_goal" as I feel like an API user would need a boatload of context just to understand why they would use it, why they wouldn't, and having a temporal prefix feels weird. Like, would there ever be a LateGoal - I can't imagine there would be, but when I see pre-, I usually expect an equivalent post-. One item that struck me was more that BuiltinGoals aren't chainable/composable, so maybe there is a way to riff off that? Or even, could
That seems to fit the spirit of the BSP to some degree, no? |
Beta Was this translation helpful? Give feedback.
-
The interface for pants/src/python/pants/goal/builtin_goal.py Lines 38 to 46 in bef63e9 The interface for pants/src/python/pants/goal/builtin_goal.py Lines 19 to 28 in bef63e9 As "only a single builtin goal is executed per run", maybe we should use the term "Singleton" instead of "Builtin"? So, maybe one of these?
Or we play off of the interface, which includes a
Other variations of these themes:
|
Beta Was this translation helpful? Give feedback.
-
Context: The core rules for Pants' support of Build Server Protocol ("BSP") are always loaded because the BSP rules need to provide a
BuiltinGoal
implementation (i.e.,BSPGoal
) so that the BSP server can take over stdin and stdout and respond to requests on them as per the BSP specification. This means loading rules (and theexperimental-bsp
goal) even if the users do not use the JVM backends which are the only (current) users of BSP.#20913 is a draft PR which splits the BSP rules out of the core rules by turning BSP into a proper Pants backend.
But the BSP server still needs to register its
BuiltinGoal
implementation. The draft PR accomplishes this via a newbuiltin_goals
plugin hook. This would be a new plugin API.BuiltinGoal
?BuiltinGoal
implementations?BuiltinGoal
should be renamed toEarlyGoal
which better fits whatBuiltinGoal
is actually used for? (Then the plugin hook would beearly_goals
.)Longer term (ulterior motive): I may want to write a LSP server for Pants which can run a server similar to how the BSP server operates. It would need to take over stdin/stdout just like the BSP server and likely would need to be a
BuiltinGoal
(baring some other way to implement the server).Beta Was this translation helpful? Give feedback.
All reactions