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

Formulae with python bindings only build against 1 version of python #2834

Closed
32 tasks done
scpeters opened this issue Oct 9, 2024 · 8 comments
Closed
32 tasks done

Comments

@scpeters
Copy link
Member

scpeters commented Oct 9, 2024

Currently our formulae that build python bindings use [email protected] (see #2580). There are python packages in homebrew-core that support multiple versions of python using pip (see pybind11 for example), and a few that use meson (see py3cairo for example).

Currently this is a problem because [email protected] has just been made the default python version in Homebrew/homebrew-core#182840, so any CI scripts that assume which python resolves to [email protected] will cause test failures:

Also, any users attempting to use python bindings on macOS will fail if they don't explicitly use [email protected].

Options to fix this:

@scpeters
Copy link
Member Author

scpeters commented Oct 9, 2024

edited to add a 3rd option

@scpeters
Copy link
Member Author

scpeters commented Oct 9, 2024

this is not fun, but matches what we have to do when other dependencies are updated; it shouldn't be too frequent, though it could break existing workspaces using the older python version

@scpeters
Copy link
Member Author

scpeters commented Oct 9, 2024

  • Figure out how to build bindings for multiple versions of python in our formulae, and rebuild bottles to add support for new python versions when they are released.

the only way I can think to do this is to build each package multiple times with different -DPython3_EXECUTABLE=... cmake arguments, which will slow down formula build time, though it shouldn't affect regular CI builds which will use a single python version

@traversaro
Copy link
Contributor

  • Figure out how to build bindings for multiple versions of python in our formulae, and rebuild bottles to add support for new python versions when they are released.

the only way I can think to do this is to build each package multiple times with different -DPython3_EXECUTABLE=... cmake arguments, which will slow down formula build time, though it shouldn't affect regular CI builds which will use a single python version

Not sure if it is useful in this context , but in conda packages I build the C++ library and the Python library as independent CMake projects, in this way I can just build the C++ library once and the Python bindings for each python supported version, to do so I have a small patch (like https://github.com/conda-forge/gz-math-feedstock/blob/main/recipe/standalone_bindings.patch) for each project. The only exception for this is gz-sim, there to have support for systems written in Python you need to rebuild also the C++ version for each Python minor version.

@scpeters
Copy link
Member Author

scpeters commented Oct 9, 2024

Not sure if it is useful in this context , but in conda packages I build the C++ library and the Python library as independent CMake projects, in this way I can just build the C++ library once and the Python bindings for each python supported version, to do so I have a small patch (like https://github.com/conda-forge/gz-math-feedstock/blob/main/recipe/standalone_bindings.patch) for each project. The only exception for this is gz-sim, there to have support for systems written in Python you need to rebuild also the C++ version for each Python minor version.

thanks, that's helpful context. I think we could consider that patch for upstream. If you don't mind, I'll cherry-pick that patch from traversaro/ign-math@d02282e and open a pull request against gz-math8 to see what other maintaienrs think

@traversaro
Copy link
Contributor

If you don't mind, I'll cherry-pick that patch from traversaro/ign-math@d02282e and open a pull request against gz-math8 to see what other maintaienrs think

Sure. I never did that myself as I wanted to avoid to add a patch for an untested workflow in which upstream did not have interest, and the patch was small enough that it was not problematic to mantain it downstream, but I will be happy if that is integrated upstream.

@scpeters
Copy link
Member Author

If you don't mind, I'll cherry-pick that patch from traversaro/ign-math@d02282e and open a pull request against gz-math8 to see what other maintaienrs think

Sure. I never did that myself as I wanted to avoid to add a patch for an untested workflow in which upstream did not have interest, and the patch was small enough that it was not problematic to mantain it downstream, but I will be happy if that is integrated upstream.

prototyping in gazebosim/gz-math#636 and #2836

@scpeters
Copy link
Member Author

scpeters commented Dec 3, 2024

I've updated the gz-sim formulae to use python 3.13 for now so the only remaining task is to review and merge gazebosim/gz-transport#555

@scpeters scpeters closed this as completed Dec 9, 2024
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

No branches or pull requests

2 participants