One selling point of Pants relative to Bazel is [f...
# general
a
One selling point of Pants relative to Bazel is [first-class python](https://www.pantsbuild.org/#first-class-python). I am trying to understand what implications this has for the [task-based vs artifact-based distinction](https://bazel.build/basics/artifact-based-builds)
Rather than being an imperative set of commands in a Turing-complete scripting language describing how to produce an output, buildfiles in Bazel are a declarative manifest describing a set of artifacts to build, their dependencies, and a limited set of options that affect how they’re built.
My guess is that Pants would classify as an artifact-based build system as well, especially since it supports https://www.pantsbuild.org/dev/docs/using-pants/remote-caching-and-execution. But I don't know how to square that with Starlark vs. Python.
b
One way to think about it might be: BUILD files are Python programs that produce descriptions of various artifacts.
(As in, Pants executes a BUILD file which results a graph of (declarative) artifacts, and then Pants manipulates/executes that graph to actually get the result the user asked for)
a
That makes sense! Thank you.
Does this have any relation to 1. "phased" vs. "unphased" builds? 2. Dynamic dependencies? I understand pants dependency inference as being related to "first-class" dynamic dependencies, which I think bazel only has in certain rules, but not user-defined rules. But I'm just getting familiar with gazelle.
b
It may be related to phased vs. unphased builds, although those sounds like terms with particular definitions that I may not be aware of. I think dynamic dependencies are somewhat orthogonal: one could have dynamic (aka inferred?) dependencies even with fully declarative/non-executable config, one would just have to write fewer
dependencies=[...]
configs.
a
Ah sorry, I thought I had seen something in relation to phase in pants documentation, but I might be thinking of https://buck2.build/docs/about/why/