diff --git a/WORKSPACE b/WORKSPACE
index ca964412f1..fd3015f1fb 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -73,8 +73,8 @@ git_repository(
## Protobuf
git_repository(
name = "com_google_protobuf",
- tag = "v22.2",
- patches = ["//patches:protobuf-v22.2.patch"],
+ tag = "v22.4",
+ patches = ["//patches:protobuf-v22.4.patch"],
patch_args = ["-p1"],
remote = "https://github.com/protocolbuffers/protobuf.git",
)
@@ -259,4 +259,3 @@ contrib_rules_jvm_deps()
load("@contrib_rules_jvm//:setup.bzl", "contrib_rules_jvm_setup")
contrib_rules_jvm_setup()
-
diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt
index 3311272605..5c156dc514 100644
--- a/cmake/dependencies/CMakeLists.txt
+++ b/cmake/dependencies/CMakeLists.txt
@@ -103,9 +103,9 @@ if(BUILD_Protobuf)
FetchContent_Declare(
protobuf
GIT_REPOSITORY "https://github.com/protocolbuffers/protobuf.git"
- GIT_TAG "v22.2"
+ GIT_TAG "v22.4"
GIT_SUBMODULES ""
- PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/protobuf-v22.2.patch")
+ PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/protobuf-v22.4.patch")
FetchContent_MakeAvailable(protobuf)
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(CHECK_PASS "fetched")
diff --git a/cmake/host.CMakeLists.txt b/cmake/host.CMakeLists.txt
index bdd64aa35b..d997027c24 100644
--- a/cmake/host.CMakeLists.txt
+++ b/cmake/host.CMakeLists.txt
@@ -116,10 +116,9 @@ set(protobuf_MSVC_STATIC_RUNTIME OFF)
FetchContent_Declare(
protobuf
GIT_REPOSITORY "https://github.com/protocolbuffers/protobuf.git"
- GIT_TAG "v22.2"
+ GIT_TAG "v22.4"
GIT_SUBMODULES ""
- PATCH_COMMAND git apply "${CMAKE_CURRENT_LIST_DIR}/../../../patches/protobuf-v22.2.patch")
+ PATCH_COMMAND git apply "${CMAKE_CURRENT_LIST_DIR}/../../../patches/protobuf-v22.4.patch")
FetchContent_MakeAvailable(protobuf)
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(CHECK_PASS "fetched")
-
diff --git a/ortools/java/pom-full.xml.in b/ortools/java/pom-full.xml.in
index 4c0472f4ce..2e7acfb11e 100644
--- a/ortools/java/pom-full.xml.in
+++ b/ortools/java/pom-full.xml.in
@@ -109,7 +109,7 @@
com.google.protobuf
protobuf-java
- 3.22.2
+ 3.22.4
diff --git a/ortools/java/pom-local.xml.in b/ortools/java/pom-local.xml.in
index 84005b2e92..150ff2f115 100644
--- a/ortools/java/pom-local.xml.in
+++ b/ortools/java/pom-local.xml.in
@@ -81,7 +81,7 @@
com.google.protobuf
protobuf-java
- 3.22.2
+ 3.22.4
diff --git a/ortools/java/pom-test.xml.in b/ortools/java/pom-test.xml.in
index 0737b1e5d7..4054b7027f 100644
--- a/ortools/java/pom-test.xml.in
+++ b/ortools/java/pom-test.xml.in
@@ -102,7 +102,7 @@
maven-surefire-plugin
- 2.22.2
+ 2.22.4
org.apache.maven.plugins
diff --git a/ortools/java/pom.xml.in b/ortools/java/pom.xml.in
index 3f09b1783a..3660d80d18 100644
--- a/ortools/java/pom.xml.in
+++ b/ortools/java/pom.xml.in
@@ -69,7 +69,7 @@
com.google.protobuf
protobuf-java
- 3.22.2
+ 3.22.4
junit
diff --git a/patches/protobuf-v22.2.patch b/patches/protobuf-v22.4.patch
similarity index 73%
rename from patches/protobuf-v22.2.patch
rename to patches/protobuf-v22.4.patch
index 496fccba81..dbe87b5552 100644
--- a/patches/protobuf-v22.2.patch
+++ b/patches/protobuf-v22.4.patch
@@ -27,7 +27,7 @@ index 2e38c1bac..0c26a97f4 100644
set(protobuf_WITH_ZLIB_DEFAULT ON)
option(protobuf_WITH_ZLIB "Build with zlib support" ${protobuf_WITH_ZLIB_DEFAULT})
@@ -189,24 +197,16 @@ endif()
-
+
set(_protobuf_FIND_ZLIB)
if (protobuf_WITH_ZLIB)
- find_package(ZLIB)
@@ -59,16 +59,16 @@ index 2e38c1bac..0c26a97f4 100644
+ 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)
-
+
if (HAVE_ZLIB)
@@ -332,7 +332,6 @@ else (MSVC)
endif (MSVC)
-
+
include_directories(
- ${ZLIB_INCLUDE_DIRECTORIES}
${protobuf_BINARY_DIR}
${protobuf_SOURCE_DIR}/src)
-
+
diff --git a/build_defs/cpp_opts.bzl b/build_defs/cpp_opts.bzl
index f95c3e257..5a32371da 100644
--- a/build_defs/cpp_opts.bzl
@@ -85,43 +85,12 @@ index f95c3e257..5a32371da 100644
"//conditions:default": [
"-lpthread",
"-lm",
-diff --git a/python/internal.bzl b/python/internal.bzl
-index d9ba37ef8..6596a2d39 100644
---- a/python/internal.bzl
-+++ b/python/internal.bzl
-@@ -1,5 +1,11 @@
- # Internal helpers for building the Python protobuf runtime.
-
-+def _remove_cross_repo_path(path):
-+ components = path.split("/")
-+ if components[0] == "..":
-+ return "/".join(components[2:])
-+ return path
-+
- def _internal_copy_files_impl(ctx):
- strip_prefix = ctx.attr.strip_prefix
- if strip_prefix[-1] != "/":
-@@ -7,10 +13,11 @@ def _internal_copy_files_impl(ctx):
-
- src_dests = []
- for src in ctx.files.srcs:
-- if src.short_path[:len(strip_prefix)] != strip_prefix:
-+ short_path = _remove_cross_repo_path(src.short_path)
-+ if short_path[:len(strip_prefix)] != strip_prefix:
- fail("Source does not start with %s: %s" %
-- (strip_prefix, src.short_path))
-- dest = ctx.actions.declare_file(src.short_path[len(strip_prefix):])
-+ (strip_prefix, short_path))
-+ dest = ctx.actions.declare_file(short_path[len(strip_prefix):])
- src_dests.append([src, dest])
-
- if ctx.attr.is_windows:
diff --git a/src/google/protobuf/port.h b/src/google/protobuf/port.h
index 9ca45d966..6bbf1d164 100644
--- a/src/google/protobuf/port.h
+++ b/src/google/protobuf/port.h
@@ -38,6 +38,7 @@
-
+
#include
#include
+#include