https://pantsbuild.org/ logo
#general
Title
# general
f

freezing-lamp-12123

10/25/2022, 12:27 PM
is it possible to parameterise a target based on output from another target? .. or how would you go about that? …
c

curved-television-6568

10/25/2022, 12:35 PM
Not that I can think of. What are you trying to solve?
f

freezing-lamp-12123

10/25/2022, 1:26 PM
i’m trying to find out how i want to structure something, and looking at different options … determining how deep i need to dig into pants to come up with a solution basically i have some targets which depend on outputs that are parameterised for … say 20 different “environments” …
this will be the case for 100s of projects … — basically generating deployment configuration for various amounts of environments … if that makes sense
and i am trying to see how little boilerplate in BUILD files i can get away with, while still leaving room for customisation
so .. the way it works today is that we have a command, which generates a bunch of output scoped for a particular environment … and that “input” can be reused for generating many different variations of outputs …
so i’m looking to determine how much of pants build tooling i want to reuse for trying to optimising caching behaviour — which requires that i add language support for the configuration language that we’re currently using (jsonnet) — which is further complicated by having to use a special binary for interpreting due to various extensions …
at this point i’m probably just rambling and none of it makes sense … but it’s the parameterised generated “outputs” that i’m mostly interested in … if there’s another approach with pants that is preferable/idiomatic as opposed to … well, my current thinking
c

curved-television-6568

10/25/2022, 1:45 PM
OK, so from the above, I think it may be worth while to grok the concept of target generators, the
__defaults__
concept and possibly synthetic targets (bleeding edge feature) in addition to how to add support for jsonnet. That’s quite a bit to chew so expect some lead time on this, for your own sake 🙂 https://www.pantsbuild.org/v2.14/docs/targets#target-generation https://www.pantsbuild.org/v2.14/docs/targets#field-default-values https://github.com/pantsbuild/pants/pull/17330 (doc for synthetic targets api) Asking a lot of specific questions on each of these (and other) topics as needed will probably be helpful, as those are easier to answer. 😉
f

freezing-lamp-12123

10/25/2022, 1:56 PM
thanks a lot for the pointers — i’ll try and look into them 😃
c

curved-television-6568

10/25/2022, 2:02 PM
Oh, and of course you’ll likely have use for the Plugin and Rules APIs as well: https://www.pantsbuild.org/v2.14/docs/plugins-overview
🙏 1
f

freezing-lamp-12123

10/25/2022, 6:35 PM
okay, two minutes in (tops) and i think synthetic targets is exactly what i need — what i’m working on probably won’t become something rel anytime soon, so jumping on the latest and greatest would be no problem as well
💯 1
c

curved-television-6568

10/25/2022, 7:03 PM
Cool, as that is a smoking new feature, any feedback on API/usability or anything else much appreciated 🙂
f

freezing-lamp-12123

10/25/2022, 7:19 PM
will keep that in mind!
🙏 1
5 Views