google / or-tools

Google's Operations Research tools:
https://developers.google.com/optimization/
Apache License 2.0
10.82k stars 2.09k forks source link

[cmake] Building Protobuf v27.2 for Python fail #4302

Closed Mizux closed 1 week ago

Mizux commented 1 week ago

Trace:

/home/runner/work/or-tools/or-tools/build/_deps/pybind11-src/include/pybind11/pybind11.h:145:19:   required from ‘pybind11::cpp_function::cpp_function(Func&&, const Extra& ...) [with Func = operations_research::pdlp::pybind11_init_pdlp(pybind11::module_&)::<lambda(const operations_research::MPModelProto&, bool, bool)>; Extra = {pybind11::name, pybind11::scope, pybind11::sibling, pybind11::arg, pybind11::arg, pybind11::arg_v}; <template-parameter-1-3> = void]’
/home/runner/work/or-tools/or-tools/build/_deps/pybind11-src/include/pybind11/pybind11.h:1237:22:   required from ‘pybind11::module_& pybind11::module_::def(const char*, Func&&, const Extra& ...) [with Func = operations_research::pdlp::pybind11_init_pdlp(pybind11::module_&)::<lambda(const operations_research::MPModelProto&, bool, bool)>; Extra = {pybind11::arg, pybind11::arg, pybind11::arg_v}]’
/home/runner/work/or-tools/or-tools/ortools/pdlp/python/pdlp.cc:95:8:   required from here
/home/runner/work/or-tools/or-tools/build/_deps/protobuf-src/src/google/protobuf/port.h:72:43: error: no matching function for call to ‘StrongPointer<const operations_research::MPModelProto& (* const)(), ptr>()’
   72 |   return StrongPointer<decltype(ptr), ptr>();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/runner/work/or-tools/or-tools/build/_deps/protobuf-src/src/google/protobuf/port.h:43:36: note: candidate: ‘template<class T> void google::protobuf::internal::StrongPointer(T*)’
   43 | inline PROTOBUF_ALWAYS_INLINE void StrongPointer(T* var) {
      |                                    ^~~~~~~~~~~~~
/home/runner/work/or-tools/or-tools/build/_deps/protobuf-src/src/google/protobuf/port.h:43:36: note:   template argument deduction/substitution failed:
/home/runner/work/or-tools/or-tools/build/_deps/protobuf-src/src/google/protobuf/port.h:72:43: error: wrong number of template arguments (2, should be 1)
   72 |   return StrongPointer<decltype(ptr), ptr>();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/runner/work/or-tools/or-tools/build/_deps/protobuf-src/src/google/protobuf/port.h:43:36: note: provided for ‘template<class T> void google::protobuf::internal::StrongPointer(T*)’
   43 | inline PROTOBUF_ALWAYS_INLINE void StrongPointer(T* var) {
      |                                    ^~~~~~~~~~~~~
/home/runner/work/or-tools/or-tools/build/_deps/protobuf-src/src/google/protobuf/port.h:54:36: note: candidate: ‘template<class T, T ptr> void google::protobuf::internal::StrongPointer()’
   54 | inline PROTOBUF_ALWAYS_INLINE void StrongPointer() {
      |                                    ^~~~~~~~~~~~~
/home/runner/work/or-tools/or-tools/build/_deps/protobuf-src/src/google/protobuf/port.h:54:36: note:   template argument deduction/substitution failed:
/home/runner/work/or-tools/or-tools/build/_deps/protobuf-src/src/google/protobuf/port.h:72:43: error: could not convert template argument ‘ptr’ from ‘const operations_research::MPModelProto& (* const)()’ to ‘const operations_research::MPModelProto& (* const)()’
   72 |   return StrongPointer<decltype(ptr), ptr>();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

related to:

Mizux commented 1 week ago

Work in Progress: testing using ubuntu-24.04 base image to have a more recent gcc (13.2.0 instead of 11.4.0)

ref: https://github.com/actions/runner-images trace: https://github.com/google/or-tools/actions/runs/9841412658