Hi folks. Sorry for the (probably) repeat questio...
# general
a
Hi folks. Sorry for the (probably) repeat question, but couldn't find searching: what's the latest on C/C++ support? I see some cc_sources in master, but it doesn't appear to be enabled. Any examples out there? I'm looking to have a Python+C++ through ctypes setup.
f
I believe @wide-midnight-78598 is in the process of splitting https://github.com/pantsbuild/pants/pull/16424 apart and submitting it in smaller pieces. So the support on
main
is definitely not ready yet until that process is done.
w
That's correct. And man splitting up that PR is tedious 😢
The end of that should be 1st party lib and binary compilation
a
Awesome! Just glad to see progress, I'll be eagerly awaiting completion. Hopefully I can get away with making .so's manually with make until it lands.
w
So, if you're able to, it would be great to get some incremental testing on this along the way - to catch all the places where I've missed stuff. For example, right now if you
tailor
and then run
./pants roots
or something, is everything even picked up correctly
If my pesky migraine goes away, then I was going to push a PR tonight checking for local gcc/clang, and also downloading standalone toolchains
a
sorry newb question, I did a default pants install so am on 2.14.0. should I do something different?
f
if you are using a current copy of the
./pants
script, you can set the environment variable
PANT_SHA
to a git commit ID from the Pants
main
branch and the `./pants`script will download and run from that point on Pants
main
that would allow you to easily consume a development version to try out stuff as it lands
w
e.g.
PANTS_SHA=d209d1558202349896fa268b2c0a1b3c5fd8b546 ./pants --version
a
that's awesome, I love pants so much already. I updated to that commit (2.16.0.dev2+gitd209d155), but
./pants tailor <dir>
doesn't modify <dir>/BUILD, when <dir> contains a single <file>.cc. Is that the intended usage?
w
Hmm, I'm not a
tailor
user, so I can't recall if it updates BUILD files - if you delete that file, does it create one including
cc_sources
f
tailor
only adds targets, it doesn't update existing targets
a
The BUILD file I had was originally empty (and remained empty after tailor). I also tried removing the BUILD file, but tailor didn't recreate it.
I'll make a small test repo tomorrow and share it
w
Silly question: Did you add the experimental
cc
package? Just a sanity check
a
Not a silly question - I hadn't found where it was but I tracked it down. Now I see cc_sources() added to my BUILD on a
tailor
. Sorry, just getting familiar. So I guess next step is working toward a run/test goal. Did that toolchain-checking PR land?
w
It'll be getting pushed for a PR in a few minutes - and will need some bikeshedding on the options/flags naming. Supports system clang/gcc, and then a downloadable toolchain (which I've only ever tested on ARM gcc) Once that passes, I'll throw in the compilation/linking stuff hopefully this week if I get time
I'd love some input on the bikeshedding to avoid an echo chamber. https://github.com/pantsbuild/pants/discussions/16777 https://github.com/pantsbuild/pants/pull/17844
a
Awesome. I don't have any meaningful input into the names discussion (e.g. I don't think C preprocessor when I see cpp)
How's it going? I pulled the change from Dec 27, and I'm using
cc_sources
with clang-format for linting along with my Python, which is nice. I'm currently fudging the build by subprocessing a bash script at import time to build a shared library that is loaded into python with ctypes (oh the humanity!). But I noticed that when including a
cc_source
as a dependency in a
python_source
, the cc files don't actually make it into the sandbox. I have to use a
files
target. Should this work?