Skip to content

Commit 97a0705

Browse files
Fix Windows CI (RustPython#5168)
* pin openssl version for windows CI * use cargo vcpkg * install openssl with vcpkg * use Swatinem/rust-cache right after dtolnay/rust-toolchain * cargo install --target-dir=target cargo-vcpkg --------- Co-authored-by: Dmitry Erlikh <d.erlikh@smartrecruiters.com>
1 parent a88c2fe commit 97a0705

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

.github/workflows/ci.yaml

+7-15
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,18 @@ jobs:
123123
- uses: dtolnay/rust-toolchain@stable
124124
with:
125125
components: clippy
126+
- uses: Swatinem/rust-cache@v2
127+
126128
- name: Set up the Windows environment
127129
shell: bash
128130
run: |
129-
choco install llvm openssl --no-progress
130-
if [[ -d "C:\Program Files\OpenSSL-Win64" ]]; then
131-
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >> $GITHUB_ENV
132-
else
133-
echo "OPENSSL_DIR=C:\Program Files\OpenSSL" >> $GITHUB_ENV
134-
fi
131+
cargo install --target-dir=target -v cargo-vcpkg
132+
cargo vcpkg -v build
135133
if: runner.os == 'Windows'
136134
- name: Set up the Mac environment
137135
run: brew install autoconf automake libtool
138136
if: runner.os == 'macOS'
139137

140-
- uses: Swatinem/rust-cache@v2
141-
142138
- name: run clippy
143139
run: cargo clippy ${{ env.CARGO_ARGS }} --workspace --exclude rustpython_wasm -- -Dwarnings
144140

@@ -249,24 +245,20 @@ jobs:
249245
steps:
250246
- uses: actions/checkout@v3
251247
- uses: dtolnay/rust-toolchain@stable
248+
- uses: Swatinem/rust-cache@v2
252249
- uses: actions/setup-python@v4
253250
with:
254251
python-version: ${{ env.PYTHON_VERSION }}
255252
- name: Set up the Windows environment
256253
shell: bash
257254
run: |
258-
choco install llvm openssl --no-progress
259-
if [[ -d "C:\Program Files\OpenSSL-Win64" ]]; then
260-
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >> $GITHUB_ENV
261-
else
262-
echo "OPENSSL_DIR=C:\Program Files\OpenSSL" >> $GITHUB_ENV
263-
fi
255+
cargo install cargo-vcpkg
256+
cargo vcpkg build
264257
if: runner.os == 'Windows'
265258
- name: Set up the Mac environment
266259
run: brew install autoconf automake libtool openssl@3
267260
if: runner.os == 'macOS'
268261

269-
- uses: Swatinem/rust-cache@v2
270262
- name: build rustpython
271263
run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }}
272264
- uses: actions/setup-python@v4

Cargo.toml

+10
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,13 @@ lto = "thin"
151151
[patch.crates-io]
152152
# REDOX START, Uncomment when you want to compile/check with redoxer
153153
# REDOX END
154+
155+
# Used only on Windows to build the vcpkg dependencies
156+
[package.metadata.vcpkg]
157+
git = "https://github.com/microsoft/vcpkg"
158+
# The revision of the vcpkg repository to use
159+
# https://github.com/microsoft/vcpkg/tags
160+
rev = "2024.02.14"
161+
162+
[package.metadata.vcpkg.target]
163+
x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md", dev-dependencies = ["openssl" ] }

0 commit comments

Comments
 (0)