From 80b743b51a237aad2ae11f95671a1271d36f4605 Mon Sep 17 00:00:00 2001 From: Loong Date: Sun, 10 Dec 2023 22:27:42 +0800 Subject: [PATCH] ci: use vendored openssl only when cross compiling --- .github/actions/setup/action.yml | 2 +- .github/workflows/ci.yml | 7 +- Cargo.lock | 113 ------------------------------- maa-cli/Cargo.toml | 12 +--- 4 files changed, 5 insertions(+), 129 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 2c6505f2..e1200726 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -40,7 +40,7 @@ runs: if: inputs.arch == 'aarch64' shell: bash run: rustup target add $CARGO_BUILD_TARGET - - name: Cross Compile Dependencies (Linux) + - name: Cross Compile Dependencies (Linux x86_64 to Linux aarch64) if: inputs.arch == 'aarch64' && startsWith(inputs.os, 'ubuntu') shell: bash run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a2beb25..8fda8f73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: cargo build --package maa-cli --locked - name: Lint (clippy) run: | - cargo clippy --all-targets --all-features -- -D warnings + cargo clippy -- -D warnings - name: Lint (rustfmt) run: | cargo fmt --all -- --check @@ -111,13 +111,12 @@ jobs: if: ${{ startsWith(matrix.os, 'ubuntu') }} run: | cargo build --package maa-cli --locked \ - --no-default-features \ - --features git2-vendored-openssl,git2-vendored-libgit2,reqwest_rustls_tls,cli_installer,core_installer,git2 + --features git2/vendored-openssl,reqwest/native-tls-vendored - name: Build (macOS) if: ${{ startsWith(matrix.os, 'macos') }} run: | cargo build --package maa-cli --locked \ - --features git2-vendored-openssl,git2-vendored-libgit2 + --features git2/vendored-openssl features: name: Build and Test (no default features) diff --git a/Cargo.lock b/Cargo.lock index f79ca6c5..33d7ed96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -632,20 +632,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - [[package]] name = "hyper-tls" version = "0.5.0" @@ -1002,15 +988,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-src" -version = "300.1.5+3.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "559068e4c12950d7dcaa1857a61725c0d38d4fc03ff8e070ab31a75d6e316491" -dependencies = [ - "cc", -] - [[package]] name = "openssl-sys" version = "0.9.97" @@ -1019,7 +996,6 @@ checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" dependencies = [ "cc", "libc", - "openssl-src", "pkg-config", "vcpkg", ] @@ -1137,7 +1113,6 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -1147,15 +1122,12 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", "tokio-util", "tower-service", "url", @@ -1163,25 +1135,9 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots", "winreg", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin", - "untrusted", - "web-sys", - "winapi", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -1201,37 +1157,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rustls" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" -dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" -dependencies = [ - "base64", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "ryu" version = "1.0.15" @@ -1247,16 +1172,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "security-framework" version = "2.9.2" @@ -1422,12 +1337,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "strsim" version = "0.10.0" @@ -1551,16 +1460,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - [[package]] name = "tokio-util" version = "0.7.9" @@ -1679,12 +1578,6 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "url" version = "2.4.1" @@ -1818,12 +1711,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - [[package]] name = "winapi" version = "0.3.9" diff --git a/maa-cli/Cargo.toml b/maa-cli/Cargo.toml index 71b1bd95..182f9402 100644 --- a/maa-cli/Cargo.toml +++ b/maa-cli/Cargo.toml @@ -9,7 +9,7 @@ repository.workspace = true license.workspace = true [features] -default = ["cli_installer", "core_installer", "git2", "reqwest_native_tls"] +default = ["cli_installer", "core_installer", "git2"] # Features used to install and update MAA Core core_installer = ["__installer"] @@ -31,15 +31,6 @@ __installer = [ "reqwest/stream", ] -# TLS backend used by reqwest (no default, must choose one when build) -reqwest_native_tls = ["reqwest/native-tls"] -reqwest_native_tls_vendored = ["reqwest/native-tls-vendored"] -reqwest_rustls_tls = ["reqwest/rustls-tls"] - -# Use vendored libgit2 and openssl of git2-rs -git2-vendored-libgit2 = ["git2/vendored-libgit2"] -git2-vendored-openssl = ["git2/vendored-openssl"] - [[bin]] name = "maa" path = "src/main.rs" @@ -96,7 +87,6 @@ features = ["rt"] [dependencies.reqwest] version = "0.11" -default-features = false features = ["blocking", "json"] [dev-dependencies]