diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c952bc..e29aa03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,9 +15,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - - name: Set rust version run: | source ci/rust-version.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75c29eb..520bb3e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,9 +14,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - - name: Set rust version run: | source ci/rust-version.sh diff --git a/Cargo.lock b/Cargo.lock index 7fcdd77..459070c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,6 +185,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "autotools" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8138adefca3e5d2e73bfba83bd6eeaf904b26a7ac1b4a19892cfe16cc7e1701" +dependencies = [ + "cc", +] + [[package]] name = "axum" version = "0.5.16" @@ -1896,6 +1905,15 @@ version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" +[[package]] +name = "protobuf-src" +version = "1.1.0+21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" +dependencies = [ + "autotools", +] + [[package]] name = "qstring" version = "0.7.2" @@ -2408,6 +2426,7 @@ dependencies = [ "log", "prometheus", "prost", + "protobuf-src", "serde", "serde_json", "solana-geyser-plugin-interface", diff --git a/Cargo.toml b/Cargo.toml index 681b1bb..4d2ba2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,5 +31,6 @@ tonic = { version = "0.8", features = ["gzip"] } anyhow = "1" cargo-lock = "8" git-version = "0.3" +protobuf-src = "1.1.0" tonic-build = "0.8" vergen = "=7.2.1" diff --git a/build.rs b/build.rs index c4938c7..4111a67 100644 --- a/build.rs +++ b/build.rs @@ -5,11 +5,17 @@ use { }; fn main() -> anyhow::Result<()> { - tonic_build::compile_protos("proto/geyser.proto")?; + compile_protos()?; generate_env()?; Ok(()) } +fn compile_protos() -> anyhow::Result<()> { + std::env::set_var("PROTOC", protobuf_src::protoc()); + tonic_build::compile_protos("proto/geyser.proto")?; + Ok(()) +} + fn generate_env() -> anyhow::Result<()> { vergen(Config::default())?;