Skip to content

fix: Adapt bindings for UnresolvedChannel's readonly properties#4224

Merged
jjerphan merged 2 commits intomamba-org:mainfrom
jjerphan:fix/adapt-bindings-UnresolvedChannel-readonly-properties
Apr 8, 2026
Merged

fix: Adapt bindings for UnresolvedChannel's readonly properties#4224
jjerphan merged 2 commits intomamba-org:mainfrom
jjerphan:fix/adapt-bindings-UnresolvedChannel-readonly-properties

Conversation

@jjerphan
Copy link
Copy Markdown
Member

@jjerphan jjerphan commented Apr 8, 2026

Description

For some reasons, the previous state of the file fails when it is being compiled; this was first observed on the feedstock with conda-forge/mamba-feedstock#376 although nothing changed in the code-base.

 │ │   *** Building project with Default Generator...                                                                                                                                                                                                                   
 │ │   [1/7] Building CXX object CMakeFiles/bindings.dir/bindings/bindings.cpp.o                                                                                                                                                                                        
 │ │   [2/7] Building CXX object CMakeFiles/bindings.dir/bindings/utils.cpp.o                                                                                                                                                                                           
 │ │   [3/7] Building CXX object CMakeFiles/bindings.dir/bindings/solver_libsolv.cpp.o                                                                                                                                                                                  
 │ │   [4/7] Building CXX object CMakeFiles/bindings.dir/bindings/specs.cpp.o                                                                                                                                                                                           
 │ │   FAILED: [code=1] CMakeFiles/bindings.dir/bindings/specs.cpp.o                                                                                                                                                                                                    
 │ │   $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-c++ -DFMT_SHARED -DMAMBA_USE_INSTALL_PREFIX_AS_BASE -DSPDLOG_FMT_EXTERNAL -DSPDLOG_FWRITE_UNLOCKED -Dbindings_EXPORTS -I$SRC_DIR/libmambapy/bindings -isystem $PREFIX/include/python3.10 -isystem $PREFIX/lib/python3.10
 │ │ /site-packages/pybind11/include -isystem $PREFIX/share -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-m
 │ │ ap=$SRC_DIR=/usr/local/src/conda/libmambapy-2.6.0.rc0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -D_LIBCPP_DISABLE_AVAILABILITY=1 -O3 -DNDEBUG -std=c++20 -fPIC -fvisibility=hidden -fdiagnostics-color=always -Wall -Wextra -Wshadow -Wnon-virtual-dto
 │ │ r -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wdouble-promotion -Wformat=2 -Wunreachable-code -Wuninitialized -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wuseless-ca
 │ │ st -flto=auto -fno-fat-lto-objects -pthread -MD -MT CMakeFiles/bindings.dir/bindings/specs.cpp.o -MF CMakeFiles/bindings.dir/bindings/specs.cpp.o.d -o CMakeFiles/bindings.dir/bindings/specs.cpp.o -c $SRC_DIR/libmambapy/bindings/specs.cpp                      
 │ │   $SRC_DIR/libmambapy/bindings/specs.cpp: In function 'void mambapy::bind_submodule_specs(pybind11::module_)':                                                                                                                                                     
 │ │   $SRC_DIR/libmambapy/bindings/specs.cpp:348:48: error: conversion from '<unresolved overloaded function type>' to 'const pybind11::cpp_function' is ambiguous                                                                                                     
 │ │     348 |             .def_property_readonly("location", &UnresolvedChannel::location)                                                                                                                                                                             
 │ │         |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                              
 │ │   In file included from $PREFIX/lib/python3.10/site-packages/pybind11/include/pybind11/operators.h:12,                                                                                                                                                             
 │ │                    from $SRC_DIR/libmambapy/bindings/specs.cpp:7:                                                                                                                                                                                                  
 │ │   $PREFIX/lib/python3.10/site-packages/pybind11/include/pybind11/pybind11.h:375:5: note: candidate: 'pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...) &&, const Extra& ...) [with Return = std::__cxx11::basic_string<char>; Class = mamba::specs::U
 │ │ nresolvedChannel; Arg = {}; Extra = {}]'                                                                                                                                                                                                                           
 │ │     375 |     cpp_function(Return (Class::*f)(Arg...) &&, const Extra &...extra) {                                                                                                                                                                                 
 │ │         |     ^~~~~~~~~~~~                                                                                                                                                                                                                                         
 │ │   $PREFIX/lib/python3.10/site-packages/pybind11/include/pybind11/pybind11.h:365:5: note: candidate: 'pybind11::cpp_function::cpp_function(Return (Class::*)(Arg ...) const &, const Extra& ...) [with Return = const std::__cxx11::basic_string<char>&; Class = mam
 │ │ ba::specs::UnresolvedChannel; Arg = {}; Extra = {}]'                                                                                                                                                                                                               
 │ │     365 |     cpp_function(Return (Class::*f)(Arg...) const &, const Extra &...extra) {                                                                                                                                                                            
 │ │         |     ^~~~~~~~~~~~                                                                                                                                                                                                                                         
 │ │   $PREFIX/lib/python3.10/site-packages/pybind11/include/pybind11/pybind11.h:2590:65: note:   initializing argument 2 of 'pybind11::class_<type_, options>& pybind11::class_<type_, options>::def_property_readonly(const char*, const pybind11::cpp_function&, cons
 │ │ t Extra& ...) [with Extra = {}; type_ = mamba::specs::UnresolvedChannel; options = {}]'
 │ │    2590 |     def_property_readonly(const char *name, const cpp_function &fget, const Extra &...extra) {
 │ │         |                                             ~~~~~~~~~~~~~~~~~~~~^~~~
 │ │   [5/7] Building CXX object CMakeFiles/bindings.dir/bindings/solver.cpp.o
 │ │   [6/7] Building CXX object CMakeFiles/bindings.dir/bindings/legacy.cpp.o
 │ │   ninja: build stopped: subcommand failed.
 │ │   

This PR upstreams the commit of the patch made there.

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

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@github-actions github-actions bot added the release::bug_fixes For PRs fixing bugs label Apr 8, 2026
@jjerphan
Copy link
Copy Markdown
Member Author

jjerphan commented Apr 8, 2026

We could spend more time understanding the root cause of this new failure, but that's not a priority.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.72%. Comparing base (f38446f) to head (2afc10a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
libmambapy/bindings/specs.cpp 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4224      +/-   ##
==========================================
- Coverage   53.52%   52.72%   -0.80%     
==========================================
  Files         240      240              
  Lines       29523    29526       +3     
  Branches     3154     3154              
==========================================
- Hits        15803    15569     -234     
- Misses      13717    13954     +237     
  Partials        3        3              

☔ 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.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan jjerphan merged commit f7d6d8e into mamba-org:main Apr 8, 2026
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release::bug_fixes For PRs fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants