Fix windows release builds (#26986)
* Don't try to build protobuf-src on windows * Set protoc envar
This commit is contained in:
parent
dc9a9238d5
commit
46b3ecee55
|
@ -50,6 +50,7 @@ jobs:
|
||||||
choco install openssl
|
choco install openssl
|
||||||
export OPENSSL_DIR="C:\Program Files\OpenSSL-Win64"
|
export OPENSSL_DIR="C:\Program Files\OpenSSL-Win64"
|
||||||
choco install protoc
|
choco install protoc
|
||||||
|
export PROTOC="C:\ProgramData\chocolatey\lib\protoc\tools\bin\protoc.exe"
|
||||||
source /tmp/env.sh
|
source /tmp/env.sh
|
||||||
echo "::set-output name=tag::$CI_TAG"
|
echo "::set-output name=tag::$CI_TAG"
|
||||||
eval "$(ci/channel-info.sh)"
|
eval "$(ci/channel-info.sh)"
|
||||||
|
|
|
@ -12,5 +12,9 @@ version = "1.12.0"
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
protobuf-src = "1.0.5"
|
|
||||||
tonic-build = "0.8.0"
|
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"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
fn main() -> Result<(), std::io::Error> {
|
fn main() -> Result<(), std::io::Error> {
|
||||||
const PROTOC_ENVAR: &str = "PROTOC";
|
const PROTOC_ENVAR: &str = "PROTOC";
|
||||||
if std::env::var(PROTOC_ENVAR).is_err() {
|
if std::env::var(PROTOC_ENVAR).is_err() {
|
||||||
|
#[cfg(not(windows))]
|
||||||
std::env::set_var(PROTOC_ENVAR, protobuf_src::protoc());
|
std::env::set_var(PROTOC_ENVAR, protobuf_src::protoc());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,5 +29,9 @@ name = "solana_storage_proto"
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
protobuf-src = "1.0.5"
|
|
||||||
tonic-build = "0.8.0"
|
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"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
fn main() -> Result<(), std::io::Error> {
|
fn main() -> Result<(), std::io::Error> {
|
||||||
const PROTOC_ENVAR: &str = "PROTOC";
|
const PROTOC_ENVAR: &str = "PROTOC";
|
||||||
if std::env::var(PROTOC_ENVAR).is_err() {
|
if std::env::var(PROTOC_ENVAR).is_err() {
|
||||||
|
#[cfg(not(windows))]
|
||||||
std::env::set_var(PROTOC_ENVAR, protobuf_src::protoc());
|
std::env::set_var(PROTOC_ENVAR, protobuf_src::protoc());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue