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

aloof-angle-91616

01/23/2019, 6:33 PM
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

average-vr-56795

01/23/2019, 6:39 PM
I would say that first we need to work out the Target API (which you stated doing with target field externalisation)...
👌 1
a

aloof-angle-91616

01/23/2019, 6:39 PM
sounds wonderful!
a

average-vr-56795

01/23/2019, 6:41 PM
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

aloof-angle-91616

01/23/2019, 6:42 PM
is there a ticket i can waste my time on (after looking into the larger local process caching ticket?)
a

average-vr-56795

01/23/2019, 6:42 PM
(mostly because we need something that the base target can be which isn't the same type as the thing it returns)
a

aloof-angle-91616

01/23/2019, 6:42 PM
isn't that just
@union_rule
though?
a

average-vr-56795

01/23/2019, 6:43 PM
That's a necessary but not sufficient step
a

aloof-angle-91616

01/23/2019, 6:43 PM
with a rule graph path from PythonTarget -> HydratedTarget
a

average-vr-56795

01/23/2019, 6:45 PM
The follow up work is around the
TargetAdaptor
type... I will be at a computer rather than phone in a moment... :)
a

aloof-angle-91616

01/23/2019, 6:45 PM
no rush!!!
i need to get to the go support tickets today anyway
a

average-vr-56795

01/23/2019, 6:52 PM
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

aloof-angle-91616

01/23/2019, 7:15 PM
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

witty-crayon-22786

01/24/2019, 5:11 PM
@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

average-vr-56795

01/24/2019, 11:05 PM
+1 🙂