diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4f31ba74c..e14749780 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -123,22 +123,18 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: clippy + - uses: Swatinem/rust-cache@v2 + - name: Set up the Windows environment shell: bash run: | - choco install llvm openssl --no-progress - if [[ -d "C:\Program Files\OpenSSL-Win64" ]]; then - echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >> $GITHUB_ENV - else - echo "OPENSSL_DIR=C:\Program Files\OpenSSL" >> $GITHUB_ENV - fi + cargo install --target-dir=target -v cargo-vcpkg + cargo vcpkg -v build if: runner.os == 'Windows' - name: Set up the Mac environment run: brew install autoconf automake libtool if: runner.os == 'macOS' - - uses: Swatinem/rust-cache@v2 - - name: run clippy run: cargo clippy ${{ env.CARGO_ARGS }} --workspace --exclude rustpython_wasm -- -Dwarnings @@ -249,24 +245,20 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 - uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} - name: Set up the Windows environment shell: bash run: | - choco install llvm openssl --no-progress - if [[ -d "C:\Program Files\OpenSSL-Win64" ]]; then - echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >> $GITHUB_ENV - else - echo "OPENSSL_DIR=C:\Program Files\OpenSSL" >> $GITHUB_ENV - fi + cargo install cargo-vcpkg + cargo vcpkg build if: runner.os == 'Windows' - name: Set up the Mac environment run: brew install autoconf automake libtool openssl@3 if: runner.os == 'macOS' - - uses: Swatinem/rust-cache@v2 - name: build rustpython run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }} - uses: actions/setup-python@v4 diff --git a/Cargo.toml b/Cargo.toml index 541a5aa3f..bfc882fdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -151,3 +151,13 @@ lto = "thin" [patch.crates-io] # REDOX START, Uncomment when you want to compile/check with redoxer # REDOX END + +# Used only on Windows to build the vcpkg dependencies +[package.metadata.vcpkg] +git = "https://github.com/microsoft/vcpkg" +# The revision of the vcpkg repository to use +# https://github.com/microsoft/vcpkg/tags +rev = "2024.02.14" + +[package.metadata.vcpkg.target] +x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md", dev-dependencies = ["openssl" ] }