From cfefe417a056a3cadb459b9ec87abea79ebf3ed2 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 21 May 2025 17:44:15 +0200 Subject: [PATCH] cmake: bump dependencies * abseil-cpp 20250512.0 * protobuf v31.0 * re2 2024-07-02 * googletest 1.17.0 * benchmark 1.9.2 devNote: to fix a patch not working ```sh cd ~/.../ortools_repo cmake -S. -Bbuild -DBUILD_DEPS=ON -DBUILD_EXAMPLES=OFF -DBUILD_SAMPLES=OFF -DBUILD_TESTING=ON pushd build/_deps/absl-src git apply --3way ~/.../ortools_repo/patches/abseil-cpp-20250512.0.patch git mergetool git diff HEAD -u > ~/.../ortools_repo/patches/abseil-cpp-20250512.0.patch cd .. rm -rf absl-* popd ``` --- cmake/dependencies/CMakeLists.txt | 20 ++-- cmake/host.CMakeLists.txt | 4 +- ortools/dotnet/Google.OrTools-full.csproj.in | 2 +- ortools/dotnet/Google.OrTools-local.csproj.in | 2 +- ortools/java/pom-full.xml.in | 2 +- ortools/java/pom-local.xml.in | 2 +- ortools/python/setup.py.in | 2 +- patches/abseil-cpp-20250127.1.patch | 99 ------------------- patches/abseil-cpp-20250512.0.patch | 20 ++++ patches/fuzztest-2025-02-14.patch | 8 +- ...v1.16.0.patch => googletest-v1.17.0.patch} | 0 ...tobuf-v30.2.patch => protobuf-v31.0.patch} | 0 ...-2024-04-01.patch => re2-2024-07-02.patch} | 0 13 files changed, 41 insertions(+), 120 deletions(-) delete mode 100644 patches/abseil-cpp-20250127.1.patch create mode 100644 patches/abseil-cpp-20250512.0.patch rename patches/{googletest-v1.16.0.patch => googletest-v1.17.0.patch} (100%) rename patches/{protobuf-v30.2.patch => protobuf-v31.0.patch} (100%) rename patches/{re2-2024-04-01.patch => re2-2024-07-02.patch} (100%) diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt index dacf587bd5..d0f14a71a0 100644 --- a/cmake/dependencies/CMakeLists.txt +++ b/cmake/dependencies/CMakeLists.txt @@ -111,10 +111,10 @@ if(BUILD_absl) FetchContent_Declare( absl GIT_REPOSITORY "https://github.com/abseil/abseil-cpp.git" - GIT_TAG "20250127.1" + GIT_TAG "20250512.0" GIT_SHALLOW TRUE PATCH_COMMAND git apply --ignore-whitespace - "${CMAKE_CURRENT_LIST_DIR}/../../patches/abseil-cpp-20250127.1.patch" + "${CMAKE_CURRENT_LIST_DIR}/../../patches/abseil-cpp-20250512.0.patch" OVERRIDE_FIND_PACKAGE ) FetchContent_MakeAvailable(absl) @@ -136,10 +136,11 @@ if(BUILD_Protobuf) FetchContent_Declare( Protobuf GIT_REPOSITORY "https://github.com/protocolbuffers/protobuf.git" - GIT_TAG "v30.2" + GIT_TAG "v31.0" GIT_SHALLOW TRUE GIT_SUBMODULES "" - PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/protobuf-v30.2.patch" + PATCH_COMMAND git apply --ignore-whitespace + "${CMAKE_CURRENT_LIST_DIR}/../../patches/protobuf-v31.0.patch" ) FetchContent_MakeAvailable(Protobuf) list(POP_BACK CMAKE_MESSAGE_INDENT) @@ -156,9 +157,9 @@ if(BUILD_re2) FetchContent_Declare( re2 GIT_REPOSITORY "https://github.com/google/re2.git" - GIT_TAG "2024-04-01" + GIT_TAG "2024-07-02" GIT_SHALLOW TRUE - PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/re2-2024-04-01.patch" + PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/re2-2024-07-02.patch" ) FetchContent_MakeAvailable(re2) list(POP_BACK CMAKE_MESSAGE_INDENT) @@ -491,11 +492,10 @@ if(BUILD_googletest) FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG v1.16.0 + GIT_TAG v1.17.0 GIT_SHALLOW TRUE PATCH_COMMAND git apply --ignore-whitespace - "${CMAKE_CURRENT_LIST_DIR}/../../patches/googletest-v1.16.0.patch" - #PATCH_COMMAND git apply --ignore-whitespace "" + "${CMAKE_CURRENT_LIST_DIR}/../../patches/googletest-v1.17.0.patch" ) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) set(INSTALL_GTEST OFF) @@ -511,7 +511,7 @@ if(BUILD_benchmark) FetchContent_Declare( benchmark GIT_REPOSITORY https://github.com/google/benchmark.git - GIT_TAG v1.9.1 + GIT_TAG v1.9.2 GIT_SHALLOW TRUE #PATCH_COMMAND git apply --ignore-whitespace "" ) diff --git a/cmake/host.CMakeLists.txt b/cmake/host.CMakeLists.txt index c354feb7a2..9d5b83c421 100644 --- a/cmake/host.CMakeLists.txt +++ b/cmake/host.CMakeLists.txt @@ -125,11 +125,11 @@ set(protobuf_WITH_ZLIB OFF) FetchContent_Declare( protobuf GIT_REPOSITORY "https://github.com/protocolbuffers/protobuf.git" - GIT_TAG "v30.2" + GIT_TAG "v31.0" GIT_SHALLOW TRUE GIT_SUBMODULES "" PATCH_COMMAND git apply --ignore-whitespace - "${CMAKE_CURRENT_LIST_DIR}/@PATCHES_PATH@/protobuf-v30.2.patch" + "${CMAKE_CURRENT_LIST_DIR}/@PATCHES_PATH@/protobuf-v31.0.patch" ) FetchContent_MakeAvailable(protobuf) list(POP_BACK CMAKE_MESSAGE_INDENT) diff --git a/ortools/dotnet/Google.OrTools-full.csproj.in b/ortools/dotnet/Google.OrTools-full.csproj.in index ffdaf5860c..b4619f4627 100644 --- a/ortools/dotnet/Google.OrTools-full.csproj.in +++ b/ortools/dotnet/Google.OrTools-full.csproj.in @@ -193,7 +193,7 @@ - + diff --git a/ortools/dotnet/Google.OrTools-local.csproj.in b/ortools/dotnet/Google.OrTools-local.csproj.in index e6576d74ea..02b9da4443 100644 --- a/ortools/dotnet/Google.OrTools-local.csproj.in +++ b/ortools/dotnet/Google.OrTools-local.csproj.in @@ -181,7 +181,7 @@ - + diff --git a/ortools/java/pom-full.xml.in b/ortools/java/pom-full.xml.in index 69a4547aa6..ffde245eac 100644 --- a/ortools/java/pom-full.xml.in +++ b/ortools/java/pom-full.xml.in @@ -109,7 +109,7 @@ com.google.protobuf protobuf-java - 4.30.2 + 4.31.0 diff --git a/ortools/java/pom-local.xml.in b/ortools/java/pom-local.xml.in index 93f38eac79..d03b19413b 100644 --- a/ortools/java/pom-local.xml.in +++ b/ortools/java/pom-local.xml.in @@ -81,7 +81,7 @@ com.google.protobuf protobuf-java - 4.30.2 + 4.31.0 diff --git a/ortools/python/setup.py.in b/ortools/python/setup.py.in index d7fe709b5d..23b6654505 100644 --- a/ortools/python/setup.py.in +++ b/ortools/python/setup.py.in @@ -46,7 +46,7 @@ setup( 'absl-py >= 2.0.0', 'numpy >= 1.13.3', 'pandas >= 2.0.0', - 'protobuf >= 6.30.2,<6.31', + 'protobuf >= 6.31.0,<6.32', 'typing-extensions >= 4.12', 'immutabledict >= 3.0.0', ], diff --git a/patches/abseil-cpp-20250127.1.patch b/patches/abseil-cpp-20250127.1.patch deleted file mode 100644 index d63e105477..0000000000 --- a/patches/abseil-cpp-20250127.1.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake -index 32cc28f..e51d6df 100644 ---- a/CMake/AbseilDll.cmake -+++ b/CMake/AbseilDll.cmake -@@ -699,31 +699,44 @@ set(ABSL_INTERNAL_TEST_DLL_TARGETS - - include(CheckCXXSourceCompiles) - --check_cxx_source_compiles( -- [==[ --#ifdef _MSC_VER --# if _MSVC_LANG < 201703L --# error "The compiler defaults or is configured for C++ < 17" --# endif --#elif __cplusplus < 201703L --# error "The compiler defaults or is configured for C++ < 17" --#endif --int main() { return 0; } --]==] -+message(WARNING "ABSL_CXX_STANDARD: ${ABSL_CXX_STANDARD}") -+message(WARNING "CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}") -+message(WARNING "CMAKE_CXX_STANDARD_REQUIRED: ${CMAKE_CXX_STANDARD_REQUIRED}") -+message(WARNING "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") -+ -+if(CMAKE_CXX_STANDARD GREATER_EQUAL 17) -+ set(ABSL_INTERNAL_AT_LEAST_CXX17 TRUE) -+else() -+ check_cxx_source_compiles( -+ [==[ -+ #ifdef _MSC_VER -+ # if _MSVC_LANG < 201703L -+ # error "The compiler defaults or is configured for C++ < 17" -+ # endif -+ #elif __cplusplus < 201703L -+ # error "The compiler defaults or is configured for C++ < 17" -+ #endif -+ int main() { return 0; } -+ ]==] - ABSL_INTERNAL_AT_LEAST_CXX17) -+endif() - --check_cxx_source_compiles( -- [==[ --#ifdef _MSC_VER --# if _MSVC_LANG < 202002L --# error "The compiler defaults or is configured for C++ < 20" --# endif --#elif __cplusplus < 202002L --# error "The compiler defaults or is configured for C++ < 20" --#endif --int main() { return 0; } --]==] -+if(CMAKE_CXX_STANDARD GREATER_EQUAL 20) -+ set(ABSL_INTERNAL_AT_LEAST_CXX20 TRUE) -+else() -+ check_cxx_source_compiles( -+ [==[ -+ #ifdef _MSC_VER -+ # if _MSVC_LANG < 202002L -+ # error "The compiler defaults or is configured for C++ < 20" -+ # endif -+ #elif __cplusplus < 202002L -+ # error "The compiler defaults or is configured for C++ < 20" -+ #endif -+ int main() { return 0; } -+ ]==] - ABSL_INTERNAL_AT_LEAST_CXX20) -+endif() - - if(ABSL_INTERNAL_AT_LEAST_CXX20) - set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20) -@@ -731,6 +744,7 @@ elseif(ABSL_INTERNAL_AT_LEAST_CXX17) - set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17) - else() - set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14) -+ message(FATAL_ERROR "Should not pass here !!!") - endif() - - function(absl_internal_dll_contains) -diff --git a/absl/flags/declare.h b/absl/flags/declare.h -index 8d2a856..a154046 100644 ---- a/absl/flags/declare.h -+++ b/absl/flags/declare.h -@@ -59,10 +59,15 @@ ABSL_NAMESPACE_END - - // Internal implementation of ABSL_DECLARE_FLAG to allow macro expansion of its - // arguments. Clients must use ABSL_DECLARE_FLAG instead. -+#if defined(_MSC_VER) -+#define ABSL_DECLARE_FLAG_INTERNAL(type, name) \ -+ extern absl::Flag FLAGS_##name -+#else - #define ABSL_DECLARE_FLAG_INTERNAL(type, name) \ - extern absl::Flag FLAGS_##name; \ - namespace absl /* block flags in namespaces */ {} \ - /* second redeclaration is to allow applying attributes */ \ - extern absl::Flag FLAGS_##name -+#endif // _MSC_VER - - #endif // ABSL_FLAGS_DECLARE_H_ diff --git a/patches/abseil-cpp-20250512.0.patch b/patches/abseil-cpp-20250512.0.patch new file mode 100644 index 0000000000..78af605623 --- /dev/null +++ b/patches/abseil-cpp-20250512.0.patch @@ -0,0 +1,20 @@ +diff --git a/absl/flags/declare.h b/absl/flags/declare.h +index 8d2a856..a154046 100644 +--- a/absl/flags/declare.h ++++ b/absl/flags/declare.h +@@ -59,10 +59,15 @@ ABSL_NAMESPACE_END + + // Internal implementation of ABSL_DECLARE_FLAG to allow macro expansion of its + // arguments. Clients must use ABSL_DECLARE_FLAG instead. ++#if defined(_MSC_VER) ++#define ABSL_DECLARE_FLAG_INTERNAL(type, name) \ ++ extern absl::Flag FLAGS_##name ++#else + #define ABSL_DECLARE_FLAG_INTERNAL(type, name) \ + extern absl::Flag FLAGS_##name; \ + namespace absl /* block flags in namespaces */ {} \ + /* second redeclaration is to allow applying attributes */ \ + extern absl::Flag FLAGS_##name ++#endif // _MSC_VER + + #endif // ABSL_FLAGS_DECLARE_H_ diff --git a/patches/fuzztest-2025-02-14.patch b/patches/fuzztest-2025-02-14.patch index e803bbe2a7..053736fbb7 100644 --- a/patches/fuzztest-2025-02-14.patch +++ b/patches/fuzztest-2025-02-14.patch @@ -20,15 +20,15 @@ index 1f4f08d..cc4d0ba 100644 set(absl_URL https://github.com/abseil/abseil-cpp.git) -set(absl_TAG 20240116.0) -+set(absl_TAG 20250127.1) ++set(absl_TAG 20250512.0) set(re2_URL https://github.com/google/re2.git) -set(re2_TAG 2024-02-01) -+set(re2_TAG 2024-04-01) ++set(re2_TAG 2024-07-02) set(gtest_URL https://github.com/google/googletest.git) -set(gtest_TAG v1.14.0) -+set(gtest_TAG v1.16.0) ++set(gtest_TAG v1.17.0) # From https://www.antlr.org/download.html set(antlr_cpp_URL https://www.antlr.org/download/antlr4-cpp-runtime-4.12.0-source.zip) @@ -36,7 +36,7 @@ index 1f4f08d..cc4d0ba 100644 set(proto_URL https://github.com/protocolbuffers/protobuf.git) -set(proto_TAG v28.2) -+set(proto_TAG v30.2) ++set(proto_TAG v31.0) set(nlohmann_json_URL https://github.com/nlohmann/json.git) set(nlohmann_json_TAG v3.11.2) diff --git a/patches/googletest-v1.16.0.patch b/patches/googletest-v1.17.0.patch similarity index 100% rename from patches/googletest-v1.16.0.patch rename to patches/googletest-v1.17.0.patch diff --git a/patches/protobuf-v30.2.patch b/patches/protobuf-v31.0.patch similarity index 100% rename from patches/protobuf-v30.2.patch rename to patches/protobuf-v31.0.patch diff --git a/patches/re2-2024-04-01.patch b/patches/re2-2024-07-02.patch similarity index 100% rename from patches/re2-2024-04-01.patch rename to patches/re2-2024-07-02.patch