Skip to content

Conversation

@AntoinePrv
Copy link
Member

@AntoinePrv AntoinePrv commented Sep 2, 2025

Description

This new implementation actually works with Pybind 2 and 3.

Type of Change

  • Bugfix
  • Feature / enhancement
  • CI / Documentation
  • Maintenance

Checklist

  • My code follows the general style and conventions of the codebase, ensuring consistency
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run pre-commit run --all locally in the source folder and confirmed that there are no linter errors.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes

Close #4024
Close #4030
Close #4056

@github-actions github-actions bot added the release::maintenance For PRs related to maintenance label Sep 2, 2025
@AntoinePrv AntoinePrv changed the title e Move to Pybind 3.0 Sep 2, 2025
@shermansiu
Copy link

Anyways, after I add #include <format> to libmambapy/bindings/bind_utils.hpp, all the libmambapy tests pass, except there is a segfault at the end:

python -m pytest libmambapy/tests
============================================================================== test session starts ===============================================================================
platform linux -- Python 3.11.13, pytest-8.4.1, pluggy-1.6.0
rootdir: /mnt/ubuntu_hdd/open_source/code/mamba
configfile: pyproject.toml
plugins: cov-6.2.1, xprocess-1.0.2, asyncio-1.1.0, rerunfailures-16.0.1, timeout-2.4.0
asyncio: mode=Mode.STRICT, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 117 items                                                                                                                                                              

libmambapy/tests/test_legacy.py ...                                                                                                                                        [  2%]
libmambapy/tests/test_solver.py ..............................                                                                                                             [ 28%]
libmambapy/tests/test_solver_libsolv.py ............................................                                                                                       [ 65%]
libmambapy/tests/test_specs.py .................................                                                                                                           [ 94%]
libmambapy/tests/test_utils.py ......                                                                                                                                      [ 99%]
libmambapy/tests/test_version.py .                                                                                                                                         [100%]

============================================================================== 117 passed in 0.15s ===============================================================================

munmap_chunk(): invalid pointer
Aborted (core dumped)

@AntoinePrv
Copy link
Member Author

Indeed, I believe I found it.

@codecov
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 0% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.14%. Comparing base (73b1d6f) to head (9fc5bfc).

Files with missing lines Patch % Lines
libmambapy/bindings/solver_libsolv.cpp 0.00% 12 Missing ⚠️
libmambapy/bindings/bind_utils.hpp 0.00% 11 Missing ⚠️
libmambapy/bindings/specs.cpp 0.00% 10 Missing ⚠️
libmambapy/bindings/legacy.cpp 0.00% 6 Missing ⚠️
libmambapy/bindings/utils.cpp 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4059      +/-   ##
==========================================
+ Coverage   64.00%   64.14%   +0.13%     
==========================================
  Files         303      303              
  Lines       38939    38853      -86     
  Branches     2880     2883       +3     
==========================================
- Hits        24924    24923       -1     
+ Misses      13948    13863      -85     
  Partials       67       67              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shermansiu
Copy link

@jjerphan Ready for review!

Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @AntoinePrv!

FYI, I can build with both pybind11 3 and pybind11 2 locally.

We will have to distribute build variants of libmambapy on pybind11 2 and 3 since users might use one or the others for a few minor versions I think.

I guess we can now perform a pre-release of 2.4.0 (or 2.3.3) to test this PR and #3802.

What do you think?

@AntoinePrv
Copy link
Member Author

AntoinePrv commented Sep 3, 2025

Ok, not waiting for the integration tests on pybind 2.0 before reverting.

@AntoinePrv
Copy link
Member Author

Also not waiting for this CI since it's the exact same commit as before.

@AntoinePrv AntoinePrv merged commit 2e0ac1a into mamba-org:main Sep 3, 2025
66 of 67 checks passed
@AntoinePrv AntoinePrv deleted the pybind3 branch September 3, 2025 08:29
@shermansiu
Copy link

I guess we can now perform a pre-release of 2.4.0 (or 2.3.3) to test this PR and #3802.

What do you think?

@AntoinePrv: so... are we going to get a pre-release?

@AntoinePrv
Copy link
Member Author

Yes, even a release. It's coming in the next few days.

@shermansiu
Copy link

Looking forward to it! 😄

@AntoinePrv
Copy link
Member Author

@shermansiu the prerelease is out.

@shermansiu
Copy link

Thanks for letting me know! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release::maintenance For PRs related to maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error building libmambapy with pybind11 3.0

4 participants