Are there any plans for integrated C/C++ support i...
# general
w
Are there any plans for integrated C/C++ support in the future? I use CMake for everything, but so many of my projects are C++ and Python (for testing, or bindings), so it would be nice to use the same runner. My current workarounds are to use the shell target to kick off cmakebuild, or Docker whenever this is ready: https://github.com/pantsbuild/pants/issues/13682
Pretty heavy use of pybind11 here as well - my compilation workflow is fine, but testing gets whacky because Cmake sucks at finding python environments from time to time - hence using Docker
I do see this - not sure if it's still the plan: https://github.com/pantsbuild/pants/issues/7564
h
No plans for C++ from the current team of maintainers, but we do value community feedback a lot so that could change. And always happy to help mentor people through changes like this
👍 1
e
Real C/C++ support would be the most epic "finally" in Pants history. IIRC the 1st semi-serious ask / offer on this was from Paypal BITD ~2012. IIRC they even had a representative come to a Pants summit (a way we used to roadmap when multiple maintainers were from multiple companies). Needless to say, there have been innumerable requests for this over the intervening years and it would be amazing to finally support.
w
I'd offer my support for development - I'm not a Rust guy, but most of what I do on any given day is C or C++, so it would be a big win for me
e
All the implementation would be in Python unless some new Rust engine intrinsic was needed - which is getting less and less likely as we flesh out the API with more languages.
1
👏 1
h
We now have an example of compiled languages with Go, Scala, and Java. That figured out a lot of tough questions with how to approach compilation with the v2 engine, such as how to handle compilation cycles
e
IOW just a bunch of shelling out to gcc/clang, ld, etc. Just like Make - a core that just runs other things and keeps track of inputs and outputs. We just keep track more closely, etc.
1
h
I know very little about C/C++ 3rd-party dep management, but that would probably be a major thrust too -- how to resolve those, which would roughly be wrapping a tool like Conan with Pants
w
the Cpp 3rd party dependency story is rough. The language has made so many advances over the year, but deps.... less so 🤦‍♂️
1
@enough-analyst-54434 That's kinda what I'm playing around with now, just using the shell commands. Very high level bash script replacement, while I figure out what the deal is. Although, I shell out to cmake/ctest, and I'm trying to extract the python part out of my cmakefiles
e
That gets you most of the way to a Pants plugin. The hard bits are generally around perf. If executing the underlying tools per-file is slow, then you have to entertain various forms of grouping which then hurt cache hits, etc. Or if the set of files needed to perform a single operation is really large, there are perf issues to be worked around with our system of isolation via LMDB <-> /tmp action chroots.
1
We're starting to address the common perf cases with some basic APIs to work around. We're not there fully yet, but there are advances regularly.