diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 5db8e25e660ac1..36eb31d4e15515 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -50,6 +50,7 @@ jobs: choco install openssl export OPENSSL_DIR="C:\Program Files\OpenSSL-Win64" choco install protoc + export PROTOC="C:\ProgramData\chocolatey\lib\protoc\tools\bin\protoc.exe" source /tmp/env.sh echo "::set-output name=tag::$CI_TAG" eval "$(ci/channel-info.sh)" diff --git a/storage-bigtable/build-proto/Cargo.toml b/storage-bigtable/build-proto/Cargo.toml index 7da00e8dbb052b..4e32ff93c21e81 100644 --- a/storage-bigtable/build-proto/Cargo.toml +++ b/storage-bigtable/build-proto/Cargo.toml @@ -12,5 +12,9 @@ version = "1.11.6" [workspace] [dependencies] -protobuf-src = "1.0.5" tonic-build = "0.8.0" + +# windows users should install the protobuf compiler manually and set the PROTOC +# envar to point to the installed binary +[target."cfg(not(windows))".dependencies] +protobuf-src = "1.0.5" diff --git a/storage-bigtable/build-proto/src/main.rs b/storage-bigtable/build-proto/src/main.rs index 4e7b4b171021ad..f2385d48a5ffa5 100644 --- a/storage-bigtable/build-proto/src/main.rs +++ b/storage-bigtable/build-proto/src/main.rs @@ -1,6 +1,7 @@ fn main() -> Result<(), std::io::Error> { const PROTOC_ENVAR: &str = "PROTOC"; if std::env::var(PROTOC_ENVAR).is_err() { + #[cfg(not(windows))] std::env::set_var(PROTOC_ENVAR, protobuf_src::protoc()); } diff --git a/storage-proto/Cargo.toml b/storage-proto/Cargo.toml index 39174c37dbf99b..72c67275498aec 100644 --- a/storage-proto/Cargo.toml +++ b/storage-proto/Cargo.toml @@ -29,5 +29,9 @@ name = "solana_storage_proto" targets = ["x86_64-unknown-linux-gnu"] [build-dependencies] -protobuf-src = "1.0.5" tonic-build = "0.8.0" + +# windows users should install the protobuf compiler manually and set the PROTOC +# envar to point to the installed binary +[target."cfg(not(windows))".build-dependencies] +protobuf-src = "1.0.5" diff --git a/storage-proto/build.rs b/storage-proto/build.rs index e5e17400a4feeb..ec975a105411ae 100644 --- a/storage-proto/build.rs +++ b/storage-proto/build.rs @@ -1,6 +1,7 @@ fn main() -> Result<(), std::io::Error> { const PROTOC_ENVAR: &str = "PROTOC"; if std::env::var(PROTOC_ENVAR).is_err() { + #[cfg(not(windows))] std::env::set_var(PROTOC_ENVAR, protobuf_src::protoc()); }