diff --git a/WORKSPACE b/WORKSPACE index 23a1e507b3..5b3e1a48f4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -148,9 +148,9 @@ install_notebook_deps() # This statement defines the @com_google_protobuf repo. git_repository( name = "com_google_protobuf", - patches = ["//patches:protobuf-v26.1.patch"], + patches = ["//patches:protobuf-v28.3.patch"], patch_args = ["-p1"], - tag = "v26.1", + tag = "v28.3", remote = "https://github.com/protocolbuffers/protobuf.git", ) # Load common dependencies. diff --git a/patches/BUILD.bazel b/patches/BUILD.bazel index 60d072770f..901dac9f92 100644 --- a/patches/BUILD.bazel +++ b/patches/BUILD.bazel @@ -15,6 +15,7 @@ exports_files([ "abseil-cpp-20240722.0.patch", "highs.patch", "protobuf-v26.1.patch", + "protobuf-v28.3.patch", "pybind11_abseil.patch", "pybind11_bazel.patch", "pybind11_protobuf.patch", diff --git a/patches/protobuf-v28.3.patch b/patches/protobuf-v28.3.patch new file mode 100644 index 0000000000..331e026797 --- /dev/null +++ b/patches/protobuf-v28.3.patch @@ -0,0 +1,56 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 807ef014..8937d5eb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,7 +42,7 @@ else (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) + option(protobuf_BUILD_SHARED_LIBS "Build Shared Libraries" ${protobuf_BUILD_SHARED_LIBS_DEFAULT}) + include(CMakeDependentOption) +-cmake_dependent_option(protobuf_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON ++cmake_dependent_option(protobuf_MSVC_STATIC_RUNTIME "Link static runtime libraries" OFF + "NOT protobuf_BUILD_SHARED_LIBS" OFF) + set(protobuf_WITH_ZLIB_DEFAULT ON) + option(protobuf_WITH_ZLIB "Build with zlib support" ${protobuf_WITH_ZLIB_DEFAULT}) +@@ -160,24 +160,16 @@ endif() + + set(_protobuf_FIND_ZLIB) + if (protobuf_WITH_ZLIB) +- find_package(ZLIB) +- if (ZLIB_FOUND) +- set(HAVE_ZLIB 1) +- # FindZLIB module define ZLIB_INCLUDE_DIRS variable +- # Set ZLIB_INCLUDE_DIRECTORIES for compatible +- set(ZLIB_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRECTORIES} ${ZLIB_INCLUDE_DIRS}) +- # Using imported target if exists +- if (TARGET ZLIB::ZLIB) +- set(ZLIB_LIBRARIES ZLIB::ZLIB) +- set(_protobuf_FIND_ZLIB "if(NOT ZLIB_FOUND)\n find_package(ZLIB)\nendif()") +- endif (TARGET ZLIB::ZLIB) +- else (ZLIB_FOUND) +- set(HAVE_ZLIB 0) +- # Explicitly set these to empty (override NOT_FOUND) so cmake doesn't +- # complain when we use them later. +- set(ZLIB_INCLUDE_DIRECTORIES) +- set(ZLIB_LIBRARIES) +- endif (ZLIB_FOUND) ++ if (NOT TARGET ZLIB::ZLIB) ++ find_package(ZLIB REQUIRED) ++ endif() ++ set(HAVE_ZLIB 1) ++ # FindZLIB module define ZLIB_INCLUDE_DIRS variable ++ # Set ZLIB_INCLUDE_DIRECTORIES for compatible ++ set(ZLIB_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRECTORIES} ${ZLIB_INCLUDE_DIRS}) ++ # Using imported target if exists ++ set(ZLIB_LIBRARIES ZLIB::ZLIB) ++ set(_protobuf_FIND_ZLIB "if(NOT ZLIB_FOUND AND NOT TARGET ZLIB::ZLIB)\n find_package(ZLIB REQUIRED)\nendif()") + endif (protobuf_WITH_ZLIB) + + # We need to link with libatomic on systems that do not have builtin atomics, or +@@ -279,7 +271,6 @@ else (MSVC) + endif (MSVC) + + include_directories( +- ${ZLIB_INCLUDE_DIRECTORIES} + ${protobuf_BINARY_DIR} + # Support #include-ing other top-level directories, i.e. upb_generator. + ${protobuf_SOURCE_DIR}