diff --git a/.github/scripts/install-all-deps.sh b/.github/scripts/install-all-deps.sh new file mode 100755 index 00000000000000..33d154453795c3 --- /dev/null +++ b/.github/scripts/install-all-deps.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e + +here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +os_name="$1" + +# shellcheck source=.github/scripts/install-openssl.sh +source "$here/install-openssl.sh" "$os_name" +# shellcheck source=.github/scripts/install-proto.sh +source "$here/install-proto.sh" "$os_name" diff --git a/.github/scripts/install-openssl.sh b/.github/scripts/install-openssl.sh new file mode 100644 index 00000000000000..1bbcbd01a3773b --- /dev/null +++ b/.github/scripts/install-openssl.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e + +os_name="$1" + +case "$os_name" in +"Windows") + choco install openssl --version 3.3.2 --install-arguments="'/DIR=C:\OpenSSL'" -y + export OPENSSL_LIB_DIR="C:\OpenSSL\lib\VC\x64\MT" + export OPENSSL_INCLUDE_DIR="C:\OpenSSL\include" + ;; +"macOS") ;; +"Linux") ;; +*) + echo "Unknown Operating System" + ;; +esac diff --git a/.github/scripts/cargo-clippy-before-script.sh b/.github/scripts/install-proto.sh old mode 100755 new mode 100644 similarity index 79% rename from .github/scripts/cargo-clippy-before-script.sh rename to .github/scripts/install-proto.sh index bba03060877434..478847562fdc0f --- a/.github/scripts/cargo-clippy-before-script.sh +++ b/.github/scripts/install-proto.sh @@ -6,8 +6,6 @@ os_name="$1" case "$os_name" in "Windows") - vcpkg install openssl:x64-windows-static-md - vcpkg integrate install choco install protoc export PROTOC='C:\ProgramData\chocolatey\lib\protoc\tools\bin\protoc.exe' ;; diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index b78d9d66de4016..37096d3be6808a 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -41,11 +41,16 @@ jobs: with: version: "v0.8.1" - - shell: bash - run: .github/scripts/cargo-clippy-before-script.sh ${{ runner.os }} + # took the workaround from https://github.com/sfackler/rust-openssl/issues/2149 + - name: Set Perl environment variables + if: runner.os == 'Windows' + run: | + echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 - shell: bash run: | + source .github/scripts/install-all-deps.sh ${{ runner.os }} source ci/rust-version.sh nightly rustup component add clippy --toolchain "$rust_nightly" scripts/cargo-clippy-nightly.sh diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 8b1da1d7e28426..1966d59ab1a246 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -39,14 +39,19 @@ jobs: run: | git checkout ${{ inputs.commit }} + # took the workaround from https://github.com/sfackler/rust-openssl/issues/2149 + - name: Set Perl environment variables + run: | + echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + - name: Build id: build shell: bash run: | - vcpkg install openssl:x64-windows-static-md - vcpkg integrate install - choco install protoc - export PROTOC="C:\ProgramData\chocolatey\lib\protoc\tools\bin\protoc.exe" + # install all deps + source .github/scripts/install-all-deps.sh ${{ runner.os }} + source /tmp/env.sh echo "tag=$CI_TAG" >> $GITHUB_OUTPUT eval "$(ci/channel-info.sh)" diff --git a/storage-bigtable/Cargo.toml b/storage-bigtable/Cargo.toml index fafacf0292da72..4234cf3eec234a 100644 --- a/storage-bigtable/Cargo.toml +++ b/storage-bigtable/Cargo.toml @@ -22,6 +22,9 @@ http = { workspace = true } hyper = { workspace = true } hyper-proxy = { workspace = true } log = { workspace = true } +# openssl is a dependency of the goauth and smpl_jwt crates, but explicitly +# declare it here as well to activate the "vendored" feature that builds OpenSSL +openssl = { workspace = true, features = ["vendored"] } prost = { workspace = true } prost-types = { workspace = true } serde = { workspace = true } @@ -36,16 +39,6 @@ tokio = { workspace = true } tonic = { workspace = true, features = ["tls", "transport"] } zstd = { workspace = true } -# openssl is a dependency of the goauth and smpl_jwt crates, but explicitly -# declare it here as well to activate the "vendored" feature that builds OpenSSL -# statically... -[target."cfg(not(windows))".dependencies] -openssl = { workspace = true, features = ["vendored"] } -# ...except on Windows to avoid having to deal with getting CI past a build-time -# Perl dependency -[target."cfg(windows)".dependencies] -openssl = { workspace = true, features = [] } - [lib] crate-type = ["lib"] name = "solana_storage_bigtable"