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

v9.7: cmake fails due to mismatching pybind11_protobuf commit #4027

Closed
hanno-becker opened this issue Dec 18, 2023 · 2 comments
Closed

v9.7: cmake fails due to mismatching pybind11_protobuf commit #4027

hanno-becker opened this issue Dec 18, 2023 · 2 comments
Assignees
Labels
Bug Build: CMake CMake based build issue
Milestone

Comments

@hanno-becker
Copy link

hanno-becker commented Dec 18, 2023

What version of OR-Tools and what language are you using?

v9.7

What operating system (Linux, Windows, ...) and version?

MacOS (M1)

What did you do?

git clone --branch v9.7 https://github.com/google/or-tools.git
cd or-tools
mkdir build
cmake -S. -Bbuild -DBUILD_PYTHON:BOOL=ON

What did you expect to see

cmake succeeding

What did you see instead?

A build error when fetching and using pybind11_protobuf

-- Fetching pybind11_protobuf
--   Populating pybind11_protobuf
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: or-tools/build/_deps/pybind11_protobuf-subbuild
[ 11%] Creating directories for 'pybind11_protobuf-populate'
[ 22%] Performing download step (git clone) for 'pybind11_protobuf-populate'
Cloning into 'pybind11_protobuf-src'...
Already on 'main'
Your branch is up to date with 'origin/main'.
[ 33%] Performing disconnected update step for 'pybind11_protobuf-populate'
[ 44%] Performing patch_disconnected step for 'pybind11_protobuf-populate'
error: patch failed: pybind11_protobuf/proto_cast_util.cc:599
error: pybind11_protobuf/proto_cast_util.cc: patch does not apply
gmake[2]: *** [CMakeFiles/pybind11_protobuf-populate.dir/build.make:115: pybind11_protobuf-populate-prefix/src/pybind11_protobuf-populate-stamp/pybind11_protobuf-populate-patch_disconnected] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/pybind11_protobuf-populate.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
CMake Error at /opt/homebrew/Cellar/cmake/3.27.7/share/cmake/Modules/FetchContent.cmake:1662 (message):
  Build step for pybind11_protobuf failed: 2
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.27.7/share/cmake/Modules/FetchContent.cmake:1802:EVAL:2 (__FetchContent_directPopulate)
  /opt/homebrew/Cellar/cmake/3.27.7/share/cmake/Modules/FetchContent.cmake:1802 (cmake_language)
  /opt/homebrew/Cellar/cmake/3.27.7/share/cmake/Modules/FetchContent.cmake:2016 (FetchContent_Populate)
  cmake/dependencies/CMakeLists.txt:183 (FetchContent_MakeAvailable)

Comments

It looks like cmake/dependencies/CMakeLists.txt does not pin the commit for pybind11_protobuf. Pinning to the commit used in the bazel build files fixes the issue:

--- a/cmake/dependencies/CMakeLists.txt
+++ b/cmake/dependencies/CMakeLists.txt
@@ -177,7 +177,7 @@ if(BUILD_PYTHON AND BUILD_pybind11_protobuf)
   FetchContent_Declare(
     pybind11_protobuf
     GIT_REPOSITORY "https://github.com/pybind/pybind11_protobuf.git"
-    GIT_TAG "main"
+    GIT_TAG "5baa2dc9d93e3b608cde86dfa4b8c63aeab4ac78"
     PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/pybind11_protobuf.patch"
   )
   FetchContent_MakeAvailable(pybind11_protobuf)
@Mizux Mizux self-assigned this Dec 18, 2023
@Mizux Mizux changed the title cmake fails due to mismatching pybind11_protobuf commit v9.7: cmake fails due to mismatching pybind11_protobuf commit Dec 18, 2023
@Mizux Mizux added this to the v9.9 milestone Dec 18, 2023
@Mizux Mizux added Bug Build: CMake CMake based build issue labels Dec 18, 2023
hanno-becker added a commit to slothy-optimizer/slothy that referenced this issue Dec 19, 2023
hanno-becker added a commit to slothy-optimizer/slothy that referenced this issue Dec 19, 2023
hanno-becker added a commit to slothy-optimizer/slothy that referenced this issue Dec 25, 2023
@jdm
Copy link

jdm commented Jan 14, 2024

Building from source on the stable branch is still broken due to this issue.

@jdm
Copy link

jdm commented Jan 14, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Build: CMake CMake based build issue
Projects
None yet
Development

No branches or pull requests

3 participants