From ebd29ccdaa3c3477704e86c5a7fa412de8949254 Mon Sep 17 00:00:00 2001 From: rafaeling Date: Tue, 27 Jun 2023 11:24:05 +0200 Subject: [PATCH] Pre-build protoc from source and remove installation step from actions --- .github/workflows/kuksa_databroker-cli_build.yml | 2 -- .github/workflows/kuksa_databroker_build.yml | 4 ---- kuksa_databroker/databroker-proto/Cargo.toml | 1 + kuksa_databroker/databroker-proto/build.rs | 1 + 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/kuksa_databroker-cli_build.yml b/.github/workflows/kuksa_databroker-cli_build.yml index c028fbac8..d59a480a3 100644 --- a/.github/workflows/kuksa_databroker-cli_build.yml +++ b/.github/workflows/kuksa_databroker-cli_build.yml @@ -34,8 +34,6 @@ jobs: steps: - name: Installing JVM run: sudo apt update && sudo apt-get install -y default-jre - - name: Install Protoc - run: sudo apt-get install -y protobuf-compiler - uses: actions/checkout@v3 - name: cargo fmt working-directory: ${{github.workspace}} diff --git a/.github/workflows/kuksa_databroker_build.yml b/.github/workflows/kuksa_databroker_build.yml index 5c15bd02a..ce1a4ab2c 100644 --- a/.github/workflows/kuksa_databroker_build.yml +++ b/.github/workflows/kuksa_databroker_build.yml @@ -34,8 +34,6 @@ jobs: steps: - name: Installing JVM run: sudo apt update && sudo apt-get install -y default-jre - - name: Install Protoc - run: sudo apt-get install -y protobuf-compiler - uses: actions/checkout@v3 - name: cargo fmt working-directory: ${{github.workspace}} @@ -60,8 +58,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Install Protoc - run: sudo apt-get install -y protobuf-compiler - uses: actions/checkout@v3 - uses: actions-rs/install@v0.1 with: diff --git a/kuksa_databroker/databroker-proto/Cargo.toml b/kuksa_databroker/databroker-proto/Cargo.toml index 88d40008b..a82f070f5 100644 --- a/kuksa_databroker/databroker-proto/Cargo.toml +++ b/kuksa_databroker/databroker-proto/Cargo.toml @@ -25,3 +25,4 @@ prost-types = { workspace = true } [build-dependencies] tonic-build = { workspace = true, features = ["transport", "prost"] } +protobuf-src = "1.1.0" diff --git a/kuksa_databroker/databroker-proto/build.rs b/kuksa_databroker/databroker-proto/build.rs index d3a70acc9..d02a006df 100644 --- a/kuksa_databroker/databroker-proto/build.rs +++ b/kuksa_databroker/databroker-proto/build.rs @@ -12,6 +12,7 @@ ********************************************************************************/ fn main() -> Result<(), Box> { + std::env::set_var("PROTOC", protobuf_src::protoc()); tonic_build::configure() .compile_well_known_types(false) .protoc_arg("--experimental_allow_proto3_optional")