Skip to content

Tests broken under Ubuntu 24 due to holder type #324

@lczech

Description

@lczech

Hi @lyskov,

I was trying to start implementing some of my previous suggestions (#319, #320, #322, and maybe #323), and wanted to run the Binder tests as a baseline. However, on Ubuntu 24, I'm getting the following errors:

> python3 build-and-run-tests.py -j 8

[...]

T00.basic.hpp Compiling binding results...
cd /home/lucas/Downloads/binder/test/build && clang++ -O3 -shared -std=c++11 -isystem /home/lucas/Downloads/binder/build/pybind11/include -I/usr/include/python3.12 -I./.. -I./../.. -I./../../source T00_basic.cpp -o T00_basic.so -fPIC

T00.basic.hpp Testing imports...
cd /home/lucas/Downloads/binder/test/build && /usr/bin/python3 -c 'import T00_basic'

Comparing results for test T00.basic.hpp...
diff /home/lucas/Downloads/binder/test/T00.basic.ref.cpp /home/lucas/Downloads/binder/test/build/T00_basic.cpp
15,16c15,16
< 	PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
< 	PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
---
> 	PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
> 	PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
82,83c82,83
< 	PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
< 	PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
---
> 	PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
> 	PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
104,105c104,105
< 	PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
< 	PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
---
> 	PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
> 	PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
126c126
< typedef std::function< pybind11::module & (std::string const &) > ModuleGetter;
---
> using ModuleGetter = std::function< pybind11::module & (std::string const &) >;
150c150
< 			else return ns+'_';
---
> 			return ns+'_';
158c158
< 	for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
---
> 	for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second :  p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );


Encounter error while executing: diff /home/lucas/Downloads/binder/test/T00.basic.ref.cpp /home/lucas/Downloads/binder/test/build/T00_basic.cpp

followed by some repetitions of similar errors. It seems the holder type has changed? Is that due to the tests not being up to date, or is the holder type somehow different on Ubuntu compared to your Fedora CI tests?

Cheers
Lucas

PS: On that note: I never got Binder to build with any of the Installation instructions. The only thing that worked for me was the build.py script, and now trying the build-and-run-tests.py as well. Maybe the ReadTheDocs could use an update to mention those scripts :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions