-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add installation support for pkg-config dependency detection #4077
Conversation
tools/JoinPaths.cmake
Outdated
endforeach() | ||
set(${joined_path} "${temp_path}" PARENT_SCOPE) | ||
set(temp_path "${first_path_segment}") | ||
foreach(current_segment IN LISTS ARGN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some way to tell pre-commit.ci that this file belongs to another repo and shouldn't be autoformatted as that will result in a confusing file delta between here and the upstream version? 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can add an exclude key regex to the pre-commit-config.yaml for the relevant hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filename seems to have a dot in front of it...
This file is very big and I have basically zero knowledge of how it works other than "frustrating thing that messes up my commit messages", can I have a small hint at what I'm looking at, here? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also could be worth mentioning this file can be removed once we depend on CMake 3.20+.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks. Global exclude sounds helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added comments in CMakeLists.txt, marked with # TODO:
for easy searchability.
I'm traveling & at conferences, I'd like to take a look at the generated file. I might want to tweak the CMake code just a bit too. I'll have a bit more time starting Wednesday, so ping me ~Thursday if I don't get back to this by then. Thanks! |
Ping. :)
BTW, here is the generated code for the regular wheel:
It's the same content for the pybind11_global wheel except, of course, the location. pybind11:
pybind11_global
|
@henryiii ping |
Thanks! I'm back in Princeton now after nearly a month of travel. Is there any reason it's joining the path rather than hardcoding the separator, as in |
The JoinPaths function uses forward slashes anyway, exactly for portability reasons. And the paths need to be joined because cmake's includedir may or may not be an absolute path. (It will be a relative path when invoking cmake from setup.py, though.) |
@henryiii the test that you added is failing due to platform differences between Is this another of those "setuptools re-encodes all the newlines" issues? :( |
By the way, merging this PR would help Void Linux successfully cross-compile SciPy. See scipy/scipy#16783 |
Sorry, in the third of four conferences in a row. And preparation for CPython 3.10rc1 is taking free time too. This just needs to address the failing test. Not too worried about the line endings, happy to normalize them in the test. I hopefully can do it by Monday, ping me if I don’t! (Or you can do it if you want) |
No problem, take your time. I won't have time before then either, anyway. :) |
pkg-config is a buildsystem-agnostic alternative to `pybind11Config.cmake` that can be used from build systems other than cmake. Fixes pybind#230
Signed-off-by: Henry Schreiner <[email protected]>
This is totally over my head but I looked out of curiosity. Is this impression correct?
If that's true, it might be nice to add that as a note to the PR description. Initially the phrase "alternative to pybind11Config.cmake" in the PR description led me to believe the pkg-config support will not involve cmake at all. |
CMake is the build system that pybind11 uses, so CMake is used to generate the pkg-config file. Once generated (for example by producing a python wheel, or by running For the purposes of e.g. SciPy (and more generally meson) we don't involve CMake. |
Got it, thanks for the explanation! |
@henryiii thanks for figuring out the CI. Really happy to see this landing. :) |
pkg-config is a build-system agnostic alternative to
pybind11Config.cmake
that can be used from build systems other than cmake.Fixes #230
Suggested changelog entry: