Skip to content

Commit

Permalink
build(deps): Update protobuf to v25.3 (#1165)
Browse files Browse the repository at this point in the history
  • Loading branch information
caspermeijn authored Oct 23, 2024
1 parent 9592e7c commit 86f87a2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:


env:
PROTOC_VERSION: '3.20.3'
PROTOC_VERSION: '3.25.3'
clippy_rust_version: '1.80'

jobs:
Expand Down
27 changes: 4 additions & 23 deletions protobuf/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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");

Expand Down Expand Up @@ -90,25 +88,6 @@ fn git_describe(src_dir: &Path) -> Result<String> {
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,
Expand All @@ -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",
Expand Down
41 changes: 0 additions & 41 deletions protobuf/src/fix-conformance_test_runner-cmake-build.patch

This file was deleted.

2 changes: 1 addition & 1 deletion third_party/protobuf
Submodule protobuf updated 3499 files

0 comments on commit 86f87a2

Please sign in to comment.