diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8421eae6..859592fb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: env: - PROTOC_VERSION: '3.20.3' + PROTOC_VERSION: '3.25.3' clippy_rust_version: '1.80' jobs: diff --git a/protobuf/build.rs b/protobuf/build.rs index 158fc918c..0f329fe3b 100644 --- a/protobuf/build.rs +++ b/protobuf/build.rs @@ -3,7 +3,7 @@ use std::fs; use std::path::{Path, PathBuf}; use std::process::Command; -use anyhow::{ensure, Context, Result}; +use anyhow::{Context, Result}; fn main() -> Result<()> { let out_dir = @@ -20,8 +20,6 @@ fn main() -> Result<()> { let protobuf_dir = &out_dir.join(format!("protobuf-{}", version)); if !protobuf_dir.exists() { - apply_patches(&src_dir)?; - let build_dir = &out_dir.join(format!("build-protobuf-{}", version)); fs::create_dir_all(build_dir).expect("failed to create build directory"); @@ -90,25 +88,6 @@ fn git_describe(src_dir: &Path) -> Result { Ok(stdout.trim().to_string()) } -/// Apply patches to the protobuf source directory -fn apply_patches(src_dir: &Path) -> Result<()> { - let mut patch_src = env::current_dir().context("failed to get current working directory")?; - patch_src.push("src"); - patch_src.push("fix-conformance_test_runner-cmake-build.patch"); - - let rc = Command::new("patch") - .arg("-p1") - .arg("-i") - .arg(patch_src) - .current_dir(src_dir) - .status() - .context("failed to apply patch")?; - // exit code: 0 means success; 1 means already applied - ensure!(rc.code().unwrap() <= 1, "protobuf patch failed"); - - Ok(()) -} - fn install_protoc_and_conformance_test_runner( src_dir: &Path, build_dir: &Path, @@ -119,7 +98,9 @@ fn install_protoc_and_conformance_test_runner( let build_conformance = !cfg!(windows); // Build and install protoc, the protobuf libraries, and the conformance test runner. - cmake::Config::new(src_dir.join("cmake")) + cmake::Config::new(src_dir) + .define("CMAKE_CXX_STANDARD", "14") + .define("ABSL_PROPAGATE_CXX_STD", "ON") .define("CMAKE_INSTALL_PREFIX", prefix_dir) .define( "protobuf_BUILD_CONFORMANCE", diff --git a/protobuf/src/fix-conformance_test_runner-cmake-build.patch b/protobuf/src/fix-conformance_test_runner-cmake-build.patch deleted file mode 100644 index 8c28991c9..000000000 --- a/protobuf/src/fix-conformance_test_runner-cmake-build.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 104a483fbf3b87d42b0c3381049c72ab45d0f630 Mon Sep 17 00:00:00 2001 -From: Dan Burkert -Date: Sat, 11 Jan 2020 13:44:02 -0800 -Subject: [PATCH] Fix conformance_test_runner CMake build - -Makes the conformance_test_runner declared sources in -cmake/conformance.cmake match the corresponding sources in -conformance/Makefile.am, which allows the test runner to build -successfully with CMake. ---- - cmake/conformance.cmake | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/cmake/conformance.cmake b/cmake/conformance.cmake -index 82b4cf580..7be713d33 100644 ---- a/cmake/conformance.cmake -+++ b/cmake/conformance.cmake -@@ -19,14 +19,17 @@ add_custom_command( - ) - - add_executable(conformance_test_runner -- ${protobuf_source_dir}/conformance/conformance.pb.cc -+ ${protobuf_source_dir}/conformance/conformance_test.h - ${protobuf_source_dir}/conformance/conformance_test.cc -- ${protobuf_source_dir}/conformance/binary_json_conformance_main.cc -- ${protobuf_source_dir}/conformance/binary_json_conformance_suite.cc -+ ${protobuf_source_dir}/conformance/conformance_test_main.cc - ${protobuf_source_dir}/conformance/binary_json_conformance_suite.h -+ ${protobuf_source_dir}/conformance/binary_json_conformance_suite.cc -+ ${protobuf_source_dir}/conformance/text_format_conformance_suite.h -+ ${protobuf_source_dir}/conformance/text_format_conformance_suite.cc - ${protobuf_source_dir}/conformance/conformance_test_runner.cc - ${protobuf_source_dir}/conformance/third_party/jsoncpp/json.h - ${protobuf_source_dir}/conformance/third_party/jsoncpp/jsoncpp.cpp -+ ${protobuf_source_dir}/conformance/conformance.pb.cc - ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc - ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc - ) --- -2.21.1 - diff --git a/third_party/protobuf b/third_party/protobuf index 2514f0bd7..4a2aef570 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit 2514f0bd7da7e2af1bed4c5d1b84f031c4d12c10 +Subproject commit 4a2aef570deb2bfb8927426558701e8bfc26f2a4