Skip to content
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

python3-pybind11: add symlinks to include, cmake, pkg-config dirs #43981

Closed
wants to merge 1 commit into from

Conversation

chrysos349
Copy link
Contributor

Testing the changes

  • I tested the changes in this PR: YES

Local build testing

  • I built this PR locally for my native architecture, (x86_64-LIBC)

Note

Before this change, cmake and pkg-config couldn't find the library.
P.S. I could've moved the dirs, but decided to play it safe, and create symlinks instead.

@classabbyamp
Copy link
Member

Before this change, cmake and pkg-config couldn't find the library.

generally you can do something like -Dpybind11_DIR=${XBPS_CROSS_BASE}/${py3_sitelib}/pybind11/share/cmake/pybind11

@chrysos349
Copy link
Contributor Author

@classabbyamp thanks for the piece of advice! I'm still learning the ins and outs of creating packages.

@ahesford
Copy link
Member

When you touch packages that are actively maintained, please tag the maintainer, especially if you are proposing structural changes to the package.

I'm on the fence about this change. On the one hand, it emulates the behavior of the pybind11-global package that upstream distributes. On the other, it should generally be unnecessary if you properly configure the build environment to look for the CMake and pkg-config files where they are actually installed.

Moving the directories would have been the wrong choice, because that would break the Python package.

@chrysos349
Copy link
Contributor Author

When you touch packages that are actively maintained, please tag the maintainer, especially if you are proposing structural changes to the package.

@ahesford Will do next time.

it should generally be unnecessary if you properly configure the build environment to look for the CMake and pkg-config files where they are actually installed.

I'd rather not do any extra steps like adding -Dpybind11_DIR=${XBPS_CROSS_BASE}/${py3_sitelib}/pybind11/share/cmake/pybind11. This seems like a workaround.

@ahesford
Copy link
Member

Why are you using xbps-src variables like ${XBPS_CROSS_BASE} and ${py3_sitelib}? Is there some Void template that is not building properly?

"I'd rather not do any extra steps" isn't a sufficient reason for moving the complexity into the Void package; if upstream decides to move things around in the future, the symlinks we create could easily be broken without going noticed. The pybind11-global package is a bit different because they provide a proper setup script to copy files from a location they know exists into the system paths.

@chrysos349
Copy link
Contributor Author

Why are you using xbps-src variables like ${XBPS_CROSS_BASE} and ${py3_sitelib}?

That's what @classabbyamp suggested above (#43981 (comment)).

-Dpybind11_DIR=${XBPS_CROSS_BASE}/${py3_sitelib}/pybind11/share/cmake/pybind11 is used in gnuradio templates.

Is there some Void template that is not building properly?

No, there's not. I created a template for audiotube. cmake couldn't find pybind11Config.cmake. So I modified python3-pybind11's template, and recompiled it. I didn't know I could've defined -Dpybind11_DIR.

BTW, it turns out there's already a pr for audiotube - #37569. At least I learnt something while building it.

"I'd rather not do any extra steps" isn't a sufficient reason for moving the complexity into the Void package; if upstream decides to move things around in the future, the symlinks we create could easily be broken without going noticed. The pybind11-global package is a bit different because they provide a proper setup script to copy files from a location they know exists into the system paths.

Well then, I'm not gonna complicate things any longer. PR closed. Thanks for your valuable feedback.

@chrysos349 chrysos349 closed this May 26, 2023
@chrysos349 chrysos349 deleted the python3-pybind11 branch January 12, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants