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

flaky-beard-52072

11/09/2020, 5:29 PM
@hundreds-father-404
Anything we can help with with trying out Pants?
I have a bunch of questions related to differences from bazel. I have an intermediate level of bazel experience: I've written some very simple rules, and defined the build a medium sized multi-language project. is there some "compared to bazel" doc somewhere?
w

witty-crayon-22786

11/09/2020, 5:37 PM
hey Kamal! we don’t have a “compared to bazel” doc anywhere, but we’d be happy to answer questions in a thread
having that kind of page would be a good idea (as long as it was very neutral and factual of course!)
f

flaky-beard-52072

11/09/2020, 5:38 PM
yeah I'm thinking of a "coming from bazel" doc more than a "vs bazel" doc
w

witty-crayon-22786

11/09/2020, 5:38 PM
yea, makes sense.
f

flaky-beard-52072

11/09/2020, 5:38 PM
do you prefer a thread per question or should I just ask all questions in this thread? (there's only one or two right now)
w

witty-crayon-22786

11/09/2020, 5:39 PM
https://blog.pantsbuild.org/dependency-inference/ does touch on one of our differences with bazel
h

hundreds-father-404

11/09/2020, 5:39 PM
https://www.pantsbuild.org/docs/existing-repositories#migrating-from-other-build-tools-set-custom-build-file-names has a very small section about that, but not quite what you’re talking about. Doesn’t talk about the overall differences between the tools
w

witty-crayon-22786

11/09/2020, 5:39 PM
in this thread should be fine: thank you!
f

flaky-beard-52072

11/09/2020, 5:39 PM
my initial question is actually about that!
is there a notion of visibility? the dependency inference seems like a great idea, but not every import should actually be allowed.
w

witty-crayon-22786

11/09/2020, 5:40 PM
there is not currently, no: we’re not opposed to adding visibility though.
h

hundreds-father-404

11/09/2020, 5:41 PM
In the meantime, you can ignore dependencies you don’t like with
!
and
!!
in the
dependencies
field: https://www.pantsbuild.org/docs/targets#dependencies-and-dependency-inference
w

witty-crayon-22786

11/09/2020, 5:41 PM
@hundreds-father-404: yea. but visibility is “producer” side rather than consumer side.
h

hundreds-father-404

11/09/2020, 5:41 PM
ack
f

flaky-beard-52072

11/09/2020, 5:47 PM
got it. are there any production users of v2 outside of pants itself?
w

witty-crayon-22786

11/09/2020, 5:48 PM
there are yes. we should get a new “powered by” page going so that we can be certain that folks would be comfortable with us mentioning them. but yes
👍 2
the rough ballpark of teams who’ve confirmed that they’re using is probably 10 to 20
f

flaky-beard-52072

11/09/2020, 5:50 PM
cool. any non-python users yet?
reminds me of my other bazel comparison question: does pants have an equivalent of persistent workers? if not is it on the roadmap?
w

witty-crayon-22786

11/09/2020, 5:51 PM
well, v2 only supports Python currently. we know that there is demand (Java and Go in particular), but as of right now, they’re not using those other languages
f

flaky-beard-52072

11/09/2020, 5:51 PM
ah so the only rule authors so far are the core developers?
w

witty-crayon-22786

11/09/2020, 5:52 PM
not quite: we’ve had folks from the community develop plugins to add support for docker, publishing, jupyter, and a few other usecases
but no one has tackled a second language at this point… we’re actually running some feedback gathering right now to get an impression of where to focus next (including possibly language support)
@flaky-beard-52072: one related difference from bazel though is that there is no JVM-rule API vs Starlark API… there is only one API for writing language support.
f

flaky-beard-52072

11/09/2020, 5:54 PM
that's a big plus. bazel will get there... next year or the year after. android rules are the sore thumb for me there.
h

hundreds-father-404

11/09/2020, 5:54 PM
but no one has tackled a second language at this point
Outside of support for Bash in our example plugin repo, which integrates with Shfmt, Shellcheck, and Shunit2 test runner. https://github.com/pantsbuild/example-plugin
w

witty-crayon-22786

11/09/2020, 5:54 PM
ah, right! yep, sorry @hundreds-father-404.
f

flaky-beard-52072

11/09/2020, 5:55 PM
overall pants seems to have a lighter concept burden. I should try writing a plugin before actually saying that's true.
w

witty-crayon-22786

11/09/2020, 5:57 PM
for sure… i think it’s probably fair to say that bazel’s philosophy is to have more APIs each of which are more limited (ie, rules being applicative, while workspace rules can interact with files/processes).
👍 1
h

hundreds-father-404

11/09/2020, 5:58 PM
We’re happy to help with writing a plugin. Disclosure that the Plugin API isn’t yet fully stable, and we know, for example, that we want to do a revamp of the plugin docs to have more tutorial-style. Also the rule graph errors are terrifying, which we know and plan to improve now that 2.0.0 is out You might want to check out the #plugins channel also
w

witty-crayon-22786

11/09/2020, 6:00 PM
one spot where we know that Pants needs a bit more work will be building an alternative to Bazel’s toolchains: our
@rule
API already supports having differentiated subgraphs based on platform information, and it’s used to invoke as many instances of tools as are necessary (one per relevant python interpreter, for example), but we haven’t used it to support crossbuilds the way toolchains might
👍 1
@flaky-beard-52072: regarding your persistent workers question: no, not yet. there is a distinct possibility that we adopt bazel’s API verbatim. in the past we’ve used the nailgun protocol to support persistent workers (and it’s worked well), but we have not needed them yet for python usecases
f

flaky-beard-52072

11/09/2020, 7:07 PM
thanks for the answers. toolchains was one place where I was thinking there's a lighter concept burden. well that and the whole configuration transition machinery.
w

witty-crayon-22786

11/09/2020, 7:16 PM
Right. I expect that the result will be much simpler due to what the
@rule
API naturally enables .. but right now the reason it is simpler is that it is incomplete
👍 1
🙊 2