Does anyone have any public real world examples of...
# general
f
Does anyone have any public real world examples of a pants repo that is building python, and c++ or rust ? I understand c++/rust would be via shell but visible examples would be good
l
I haven't used it, but there is a non-documented cc backend https://github.com/pantsbuild/pants/tree/main/src/python/pants/backend/cc
b
That's @wide-midnight-78598's handiwork, so would be best able to point to examples if any are public. I believe he created it for private client work, so there may not be public repos to point to (for now).
@ancient-vegetable-10556 has been working on improvements to shell support that might also be relevant to this question. I believe those are scheduled for Pants 2.16, so examples may be a couple months away?
@fresh-continent-76371 is that any more info you can share on what need prompted the question? Perhaps there's another way we can meet the underlying need, while those two features are in progress.
f
Yes of course. I have a repository of 50% python and 50% C++. With rust a potential down the track. There are some other technologies, but these are the primary. I switched the trial from Pants to Bazel and have most things working well. But pants has better python support, and the docker building experience was nicer with pants But for the c++ , bazel is kind of the answer; unless someone has done some good examples
b
Ah interesting. One thing you could opt to do in the interim is use both systems until Pants' C++ support is finished. Pants and Bazel can be run side by side in the same repo. You would configure Pants to use a different BUILD filename such as BUILD.pants. Then, say, configure Pants to build the Python portion of the codebase and Bazel to build the C++ side for now. It's not ideal, especially if you have a large team. But for a couple of months it could do as a workaround.
f
What about a shell rust / cargo example ?
b
We don't have Rust support yet.
đź‘Ť 1
f
Am I mistaken in thinking: any language build can be wrapped managed and cached , with work using the _shell command ?
b
@ancient-vegetable-10556 is the best person to answer that. I expect you'll hear from him on Monday.
a
@fresh-continent-76371 yes, that’s a good summary. As long as the tools used in your
_shell_command
can be found on your
PATH
, you can invoke them in the sandbox, and get caching that’s as fine-grained as the targets you define.
There’s some limitations in how you can use the outputs of a shell command that will be fixed in Pants v2.16 (e.g it’s difficult to package files produced in that manner into an
archive
target).