https://pantsbuild.org/ logo
a

adventurous-island-11048

07/23/2022, 12:12 AM
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

enough-analyst-54434

07/23/2022, 12:16 AM
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

adventurous-island-11048

07/23/2022, 12:18 AM
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

enough-analyst-54434

07/23/2022, 12:20 AM
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

adventurous-island-11048

07/23/2022, 12:21 AM
Ah okay
makes sense
e

enough-analyst-54434

07/23/2022, 12:21 AM
We have people use that to get Cython "support" in Pants - punt to setuptools.
a

adventurous-island-11048

07/23/2022, 12:22 AM
makes sense, once you get a PEP517 build backend involved you can do pretty much anything
e

enough-analyst-54434

07/23/2022, 12:22 AM
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

adventurous-island-11048

07/23/2022, 12:24 AM
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

busy-vase-39202

07/23/2022, 12:24 AM
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

bitter-ability-32190

07/23/2022, 12:28 AM
We vendor our native libs alongside our compiled code, and do it +compilation in a plugin 🤷‍♂️ No ragrets
w

wide-midnight-78598

07/24/2022, 12:09 AM
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

adventurous-island-11048

07/24/2022, 12:10 AM
Makes sense 🙂 I'm half considering trying out writing a plugin that will just expose Nixpkgs
💯 1
👍 1
w

wide-midnight-78598

07/24/2022, 12:10 AM
Dooooo itttttttttt
1
b

bitter-ability-32190

07/24/2022, 12:11 AM
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

wide-midnight-78598

07/24/2022, 12:14 AM
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

bitter-ability-32190

07/24/2022, 12:16 AM
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
4 Views