if anyone has thoughts on how to make a `SimpleCod...
# development
a
if anyone has thoughts on how to make a
SimpleCodegenTask
type of thing in v2 (we may not even need a specific wrapper) lmk https://github.com/pantsbuild/pants/issues/7137
a
I would say that first we need to work out the Target API (which you stated doing with target field externalisation)...
👌 1
a
sounds wonderful!
a
I suspect the answer will be the Target API equivalent of "just yield a `HydratedTarget`", but we need to work out how to represent types of targets first :)
a
is there a ticket i can waste my time on (after looking into the larger local process caching ticket?)
a
(mostly because we need something that the base target can be which isn't the same type as the thing it returns)
a
isn't that just
@union_rule
though?
a
That's a necessary but not sufficient step
a
with a rule graph path from PythonTarget -> HydratedTarget
a
The follow up work is around the
TargetAdaptor
type... I will be at a computer rather than phone in a moment... :)
a
no rush!!!
i need to get to the go support tickets today anyway
a
LegacySymbolTable
is currently a gnarly super-hard-coded mapping of target aliases to how the engine will parse them
We need to work out a nice way to make this extensible, which means we need to work out what the API should actually look like
But the whole BUILD file parse pipeline assumes you have a
TargetAdaptor
of a certain shape that does certain things, and that is something we need to make both a little more general, and much better specified
a
sure i guess i see the process of doing that as just being the repeated application of
@union_rule
if there's mechanical code to write i will do that
i made this issue from this thread so i don't forget things https://github.com/pantsbuild/pants/issues/7138
w
@union_rule
is the tool with which to design an actual
Target
API
because as the description of 4535 says, we're not married to any of the current class layout
i imagine that we could hack up codegen around
HydratedTarget
but designing the Target API in some amount of concert with incorporating codegen would be really good too: the experiments incorporating codegen have so far suggested that leaning in on types is the right way to do codegen: ie if a rule wants a classpath for a target address, that would result in something like
Classpath for ThriftLibrary
, which might consume Params to choose either Java/Scala codegen
...and generate
JavaLibrary
, or something.
a
+1 🙂