Is there something like bazels genrule in pantsbui...
# general
Is there something like bazels genrule in pantsbuild?
the caching process execution framework in the v2 engine can consume input files and produce output files in a structured way, which seems similar to the docs on
-- see an example for
, a script which counts lines of code using heuristics and regex: we are currently rewriting the python support in v2 (along with many other things) so this functionality works, but the interface from v2 rules to the CLI is still being hashed out -- see the very very very very in-progress diff at what use case are you thinking of?
Thanks for the detailed answer. I’m just getting to know this brand of build system and gauging the differences and how much I’ll be constrained to what’s provided, are there easy extension points, etc.
I’m finding it a bit hard to answer the question: What do I do when my code generation tool / language, etc. isn’t supported? Or could I e.g. process a bunch of images as part of the build etc.
pants has the best extension model of any build tool by far (imo). one of the reasons this has come to be the case is that one of the larger corporate contributors (twitter) doesn't consume any internal version, and always relies on making open source releases, as well as using the extension model to satisfy internal use cases (imo). in the v1 model (which is fully supported), the task development guide is here: (also see the v2 engine API is described here:, but as mentioned, that is exciting and new and still being hashed out unless you like getting used to really new code.
the general idea is that you can make a directory (by convention,
) in your repo which defines pants tasks, subsystems, targets, etc, and register it in your repo's
file. you can then invoke your tasks as first-class citizens just like built-in pants tasks such as jvm and scala compilation tasks.
to answer the original question, there's not an idea specifically akin to
in the v1 model, but tasks can invoke subprocesses and rely on some automatic caching of output directories, described in the task development docs above.
Sounds cool, I’ll give this a try. One reason I’ve been drawn to check out pants first is that I had a very good experience of using twitter finagle. Another that the new engine has been written in Rust 😉
we're going to have first-class rust support sooner than everyone else thinks if i get my act together and i'm planning to make it easier to use pants with twitter open source jvm projects (which is why i joined this company) in a great way soon enough if i get my act together. pants has a lot of features and architectures that no other build tool has and i am attempting to win the title of being its biggest fan.
please feel free to make an issue if you find a bug or missing feature or ping this channel!