diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a1f6593e2a..1758250707 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,6 +58,14 @@ jobs: New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force shell: powershell + - name: Install NASM + uses: ilammy/setup-nasm@v1 + if: matrix.mingwdir == '' + - name: Install ninja + if: matrix.mingwdir == '' + run: | + choco install ninja -y + ninja.exe --version - name: Install mingw uses: bwoodsend/setup-winlibs-action@v1 if: matrix.mingwdir != '' @@ -200,6 +208,14 @@ jobs: New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force shell: powershell + - name: Install NASM + uses: ilammy/setup-nasm@v1 + if: matrix.mingwdir == '' + - name: Install ninja + if: matrix.mingwdir == '' + run: | + choco install ninja -y + ninja.exe --version - name: Install mingw uses: bwoodsend/setup-winlibs-action@v1 if: matrix.mingwdir != '' @@ -348,6 +364,14 @@ jobs: New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force shell: powershell + - name: Install NASM + uses: ilammy/setup-nasm@v1 + if: matrix.mingwdir == '' + - name: Install ninja + if: matrix.mingwdir == '' + run: | + choco install ninja -y + ninja.exe --version - name: Install mingw uses: bwoodsend/setup-winlibs-action@v1 if: matrix.mingwdir != '' diff --git a/Cargo.lock b/Cargo.lock index 8cb1cd31c2..cc3d9799e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,6 +162,46 @@ dependencies = [ "syn", ] +[[package]] +name = "aws-lc-fips-sys" +version = "0.12.10" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#815f887c8e265f74eedd9dc8cbebcc308aaf1c15" +dependencies = [ + "bindgen", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] + +[[package]] +name = "aws-lc-rs" +version = "1.8.0" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#815f887c8e265f74eedd9dc8cbebcc308aaf1c15" +dependencies = [ + "aws-lc-fips-sys", + "aws-lc-sys", + "mirai-annotations", + "paste", + "untrusted 0.7.1", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.19.0" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#815f887c8e265f74eedd9dc8cbebcc308aaf1c15" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] + [[package]] name = "axum" version = "0.6.20" @@ -234,6 +274,29 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -305,10 +368,13 @@ dependencies = [ ] [[package]] -name = "cesu8" -version = "1.1.0" +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -331,6 +397,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "4.5.7" @@ -382,20 +459,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] -name = "colorchoice" -version = "1.0.1" +name = "cmake" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] [[package]] -name = "combine" -version = "4.6.7" +name = "colorchoice" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "content_inspector" @@ -549,6 +625,7 @@ name = "download" version = "1.27.1" dependencies = [ "anyhow", + "aws-lc-rs", "curl", "env_proxy", "http-body-util", @@ -557,7 +634,6 @@ dependencies = [ "once_cell", "reqwest", "rustls", - "rustls-platform-verifier", "tempfile", "thiserror", "tokio", @@ -708,6 +784,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures-channel" version = "0.3.30" @@ -1027,6 +1109,7 @@ dependencies = [ "hyper 1.3.1", "hyper-util", "rustls", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls", @@ -1147,26 +1230,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - [[package]] name = "jobserver" version = "0.1.31" @@ -1191,6 +1254,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.155" @@ -1207,6 +1276,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" +dependencies = [ + "cfg-if 1.0.0", + "windows-targets 0.48.5", +] + [[package]] name = "libm" version = "0.2.8" @@ -1275,6 +1354,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -1295,6 +1380,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "native-tls" version = "0.2.12" @@ -1323,6 +1414,16 @@ dependencies = [ "libc", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -1348,31 +1449,12 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-bigint" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" -dependencies = [ - "num-integer", - "num-traits", -] - [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1565,6 +1647,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1627,6 +1715,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" version = "1.0.86" @@ -1696,6 +1794,53 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -1861,7 +2006,9 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "quinn", "rustls", + "rustls-native-certs", "rustls-pemfile", "rustls-pki-types", "serde", @@ -1902,7 +2049,7 @@ dependencies = [ "getrandom", "libc", "spin", - "untrusted", + "untrusted 0.9.0", "windows-sys 0.52.0", ] @@ -1922,6 +2069,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustix" version = "0.38.34" @@ -1941,6 +2094,7 @@ version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ + "aws-lc-rs", "log", "once_cell", "ring", @@ -1979,42 +2133,16 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" -[[package]] -name = "rustls-platform-verifier" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3beb939bcd33c269f4bf946cc829fcd336370267c4a927ac0399c84a3151a1" -dependencies = [ - "core-foundation", - "core-foundation-sys", - "jni", - "log", - "once_cell", - "rustls", - "rustls-native-certs", - "rustls-platform-verifier-android", - "rustls-webpki", - "security-framework", - "security-framework-sys", - "webpki-roots", - "winapi", -] - -[[package]] -name = "rustls-platform-verifier-android" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" - [[package]] name = "rustls-webpki" version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -2137,7 +2265,6 @@ dependencies = [ "core-foundation", "core-foundation-sys", "libc", - "num-bigint", "security-framework-sys", ] @@ -2824,6 +2951,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "untrusted" version = "0.9.0" @@ -2999,12 +3132,15 @@ dependencies = [ ] [[package]] -name = "webpki-roots" -version = "0.26.3" +name = "which" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ - "rustls-pki-types", + "either", + "home", + "once_cell", + "rustix", ] [[package]] @@ -3287,6 +3423,20 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "zstd" diff --git a/Cargo.toml b/Cargo.toml index 8c992eb2d5..248b700bfe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -152,6 +152,9 @@ tracing-subscriber = "0.3.16" url = "2.4" walkdir = "2" +[patch.crates-io] +aws-lc-rs = { git = "https://github.com/justsmth/aws-lc-rs.git", branch = "more-windows-tests" } + [lib] name = "rustup" path = "src/lib.rs" diff --git a/ci/actions-templates/windows-builds-template.yaml b/ci/actions-templates/windows-builds-template.yaml index e931a1d8b3..1bf430f3ff 100644 --- a/ci/actions-templates/windows-builds-template.yaml +++ b/ci/actions-templates/windows-builds-template.yaml @@ -51,6 +51,14 @@ jobs: # skip-master skip-pr skip-stable New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force shell: powershell + - name: Install NASM + uses: ilammy/setup-nasm@v1 + if: matrix.mingwdir == '' + - name: Install ninja + if: matrix.mingwdir == '' + run: | + choco install ninja -y + ninja.exe --version - name: Install mingw uses: bwoodsend/setup-winlibs-action@v1 if: matrix.mingwdir != '' diff --git a/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile index be14c039c0..a3ce6cf30e 100644 --- a/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile +++ b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile @@ -1,4 +1,6 @@ FROM rust-armv7-unknown-linux-gnueabihf +RUN apt-get update && apt-get install -qy build-essential libclang-dev libc6-armhf-cross + ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \ - CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc + CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc diff --git a/download/Cargo.toml b/download/Cargo.toml index 4d59960770..1e3803f33d 100644 --- a/download/Cargo.toml +++ b/download/Cargo.toml @@ -9,21 +9,16 @@ default = ["reqwest-backend", "reqwest-rustls-tls", "reqwest-native-tls"] curl-backend = ["curl"] reqwest-backend = ["reqwest", "env_proxy"] reqwest-native-tls = ["reqwest/native-tls", "dep:once_cell"] -reqwest-rustls-tls = [ - "reqwest/rustls-tls-manual-roots-no-provider", - "dep:rustls", - "dep:rustls-platform-verifier", - "dep:once_cell", -] +reqwest-rustls-tls = ["reqwest/rustls-tls-native-roots", "dep:rustls", "dep:once_cell"] [dependencies] anyhow.workspace = true +aws-lc-rs = { version = "1.7", features = ["bindgen"] } curl = { version = "0.4.44", optional = true } env_proxy = { version = "0.4.1", optional = true } once_cell = { workspace = true, optional = true } reqwest = { version = "0.12", default-features = false, features = ["blocking", "gzip", "socks", "stream"], optional = true } -rustls = { version = "0.23", optional = true, default-features = false, features = ["logging", "ring", "tls12"] } -rustls-platform-verifier = { version = "0.3", optional = true } +rustls = { version = "0.23", optional = true, default-features = false, features = ["logging", "aws_lc_rs", "tls12"] } thiserror.workspace = true tokio = { workspace = true, default-features = false, features = ["sync"] } tokio-stream.workspace = true diff --git a/download/src/lib.rs b/download/src/lib.rs index 5fa4ac34df..d9ce924c76 100644 --- a/download/src/lib.rs +++ b/download/src/lib.rs @@ -294,8 +294,6 @@ pub mod reqwest_be { compile_error!("Must select a reqwest TLS backend"); use std::io; - #[cfg(feature = "reqwest-rustls-tls")] - use std::sync::Arc; use std::time::Duration; use anyhow::{anyhow, Context, Result}; @@ -303,7 +301,7 @@ pub mod reqwest_be { use once_cell::sync::Lazy; use reqwest::{header, Client, ClientBuilder, Proxy, Response}; #[cfg(feature = "reqwest-rustls-tls")] - use rustls::crypto::ring; + use rustls::crypto::aws_lc_rs; use tokio_stream::StreamExt; use url::Url; @@ -356,13 +354,9 @@ pub mod reqwest_be { #[cfg(feature = "reqwest-rustls-tls")] static CLIENT_RUSTLS_TLS: Lazy = Lazy::new(|| { let catcher = || { + let _ = aws_lc_rs::default_provider().install_default(); client_generic() - .use_preconfigured_tls( - rustls_platform_verifier::tls_config_with_provider(Arc::new( - ring::default_provider(), - )) - .expect("failed to initialize pre-configured rustls backend"), - ) + .use_rustls_tls() .user_agent(super::REQWEST_RUSTLS_TLS_USER_AGENT) .build() };