What's the right way to provide C libraries to a p...
# general
a
What's the right way to provide C libraries to a pants project, like if one of my python deps links against libcurl or something
e
Does the linkage rely on
LD_LIBRARY_PATH
? Pants tends towards hermetic by default and will not let arbitrary env vars leak into the processes it runs unless you poke holes. If so I can point you at config for doing that.
a
Most likely yea, there's a pycurl dependency in this code base. Is the pants answer to pole holes and use the host's libcurl? Or is there a reasonable way to build libcurl etc as well
e
There is currently no support for building native libs unfortunately. You can cheat via setup.py / Python, but that's probably not going to work here.
a
Ah okay
makes sense
e
We have people use that to get Cython "support" in Pants - punt to setuptools.
a
makes sense, once you get a PEP517 build backend involved you can do pretty much anything
e
We'd definitely love to support C/C++, but man-hours and all that so far.
Yeah, exactly. The build backend is the escape hatch.
a
yea no worries. just messing around with different options for this code base, figuring out what I'm gonna propose pypi does to make our builds better
b
By the way, if you're curious about Pants' hermetic environment, @ancient-vegetable-10556 did a talk recently at Pycon about it and goes into the rationales behind some of its design.

https://www.youtube.com/watch?v=0INmW9KaAp4

https://speakerdeck.com/chrisjrn/hermetic-environments-in-pantsbuild-31d03419-8a15-4cd3-9041-b817b8924b3c
👀 1
b
We vendor our native libs alongside our compiled code, and do it +compilation in a plugin 🤷‍♂️ No ragrets
w
We'd definitely love to support C/C++, but man-hours and all that so far.
I have a draft PR for first party source compilation going in later this week - but it'll be a while before it's even a remotely stable backend. My target use case is C/C++ libs bound to Python via pybind11 - so it's a very Pants-centric workflow once we have the C support
a
Makes sense 🙂 I'm half considering trying out writing a plugin that will just expose Nixpkgs
💯 1
👍 1
w
Dooooo itttttttttt
1
b
Pybind11 is header-only right? That's what we download and use setuptools in a plugin to provide a compiled C extension module
Using http_source 🙈 Duct tape and string...
w
Love it. However, since I direly need a proper solution that isn't hacked together scripts, cmake, and whatever else for a project I'm working on right now - seems like the right time to do this
b
Oh yes. The more I can remove from my repos plugins, the better chance my org has of staying afloat after my untimely demise at the sudden onset of a bus. The chances will go from 0 to maybe 7% 😂
🚌 2