long time lurker and interested in pants — not bee...
# general
f
long time lurker and interested in pants — not been able to find time to use it on a real project, but i have a few questions on current state of pants • does pants have any similar functionality for writing trace files, similar to bazel performance trace json? • if not starlark — what language features exactly are available in BUILD files? • what is the state of auto-complete on the cli? • LSP — any support for that particularly for users when editing BUILD files • regarding environments and using docker containers — can pants create the environment container during a build, or does it need to be pre-created out of band? that is top of mind right now .. i’m hoping to get some more usage of it on a real project … 🙇
👋 2
h
Re BUILD files - they are eval'd as Python 3, except that they may not import. You can however define macros elsewhere and Pants will make them available.
🎉 1
Re LSP - I'll let @wide-midnight-78598 weigh in
Re environments - I believe Pants creates the container, but you have to specify the image
w
TIL: I never updated the docs for generating completions. I've been using them for...... quite a while. The one problem is that there is a noticeable delay when re-generating, but as we speed up Pants - that will minimize. Re LSP: In the alpha VS Code plugin (https://github.com/robotpajamas/suspenders), we use
pyright
and provide our own set of
___builtins___
that pyright can pick up and put down. Ditto for Pants.toml using json-schema. The generating of the custom schema and custom builtins isn't built into pants directly yet, but that's going up a PR in the next week or so
f
thank you very much for your answers — sounds great, and will see if i can get it to work when i find myself dabbling with pants the next time! ❤️
h
Oh and re trace files, there was a way to generate Zipkin spans in v1, looks like it was removed in v2...
There is a "workunits" API that gives you programmatic access to that sort of data, so it shouldn't be complicated to get that to stream out trace data
f
We've got a small plugin that transforms work units to honeycomb, it's been pretty helpful in troubleshooting cache misses and identifying bottlenecks https://pantsbuild.slack.com/archives/C046T6T9U/p1711732663706429?thread_ts=1711676065.758549&cid=C046T6T9U
👍 1
🎉 1
c
Regarding docker environments, this ticket tracks support for building the environment image in band: https://github.com/pantsbuild/pants/issues/17714
🎉 1
w
Goddamn. Another thing I forgot to PR 🤦‍♂️ I had a possible solution, but needed to wait until another PR went through, and then promptly forgot about it
😬 1