Merge branch 'master' into rustls-0.23

This commit is contained in:
Rob Ede 2024-05-11 17:40:18 +01:00 committed by GitHub
commit ff5ef8e865
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 103 additions and 62 deletions

View File

@ -2,8 +2,6 @@
lint = "clippy --workspace --tests --examples --bins -- -Dclippy::todo" lint = "clippy --workspace --tests --examples --bins -- -Dclippy::todo"
lint-all = "clippy --workspace --all-features --tests --examples --bins -- -Dclippy::todo" lint-all = "clippy --workspace --all-features --tests --examples --bins -- -Dclippy::todo"
ci-doctest = "test --workspace --all-features --doc --no-fail-fast -- --nocapture"
# just check the library (without dev deps) # just check the library (without dev deps)
ci-check-min = "hack --workspace check --no-default-features" ci-check-min = "hack --workspace check --no-default-features"
ci-check-lib = "hack --workspace --feature-powerset --depth=2 --exclude-features=io-uring check" ci-check-lib = "hack --workspace --feature-powerset --depth=2 --exclude-features=io-uring check"
@ -19,8 +17,5 @@ ci-test-rustls-020 = "hack --feature-powerset --depth=2 --exclude-features=io-ur
ci-test-rustls-021 = "hack --feature-powerset --depth=2 --exclude-features=io-uring,rustls-0_20,rustls-0_22 test --lib --tests --no-fail-fast -- --nocapture" ci-test-rustls-021 = "hack --feature-powerset --depth=2 --exclude-features=io-uring,rustls-0_20,rustls-0_22 test --lib --tests --no-fail-fast -- --nocapture"
ci-test-rustls-022 = "hack --feature-powerset --depth=2 --exclude-features=io-uring,rustls-0_20,rustls-0_21 test --lib --tests --no-fail-fast -- --nocapture" ci-test-rustls-022 = "hack --feature-powerset --depth=2 --exclude-features=io-uring,rustls-0_20,rustls-0_21 test --lib --tests --no-fail-fast -- --nocapture"
# tests avoiding io-uring feature on Windows
ci-test-win = "hack --feature-powerset --depth=2 --exclude-features=io-uring test --lib --tests --no-fail-fast -- --nocapture"
# test with io-uring feature # test with io-uring feature
ci-test-linux = "hack --feature-powerset --depth=2 --exclude-features=rustls-0_20 test --lib --tests --no-fail-fast -- --nocapture" ci-test-linux = "hack --feature-powerset --depth=2 --exclude-features=rustls-0_20,rustls-0_21 test --lib --tests --no-fail-fast -- --nocapture"

View File

@ -56,10 +56,10 @@ jobs:
with: with:
toolchain: ${{ matrix.version }} toolchain: ${{ matrix.version }}
- name: Install cargo-hack and cargo-ci-cache-clean - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
uses: taiki-e/install-action@v2.33.12 uses: taiki-e/install-action@v2.33.17
with: with:
tool: cargo-hack,cargo-ci-cache-clean tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
- name: check lib - name: check lib
if: > if: >
@ -84,10 +84,8 @@ jobs:
run: cargo ci-check-linux run: cargo ci-check-linux
- name: tests - name: tests
if: > if: matrix.target.os != 'ubuntu-latest'
matrix.target.os != 'ubuntu-latest' run: just test
&& matrix.target.triple != 'x86_64-pc-windows-gnu'
run: cargo ci-test
- name: tests - name: tests
if: matrix.target.os == 'ubuntu-latest' if: matrix.target.os == 'ubuntu-latest'
run: >- run: >-
@ -115,7 +113,7 @@ jobs:
toolchain: nightly toolchain: nightly
- name: Install cargo-hack & cargo-minimal-versions - name: Install cargo-hack & cargo-minimal-versions
uses: taiki-e/install-action@v2.33.12 uses: taiki-e/install-action@v2.33.17
with: with:
tool: cargo-hack,cargo-minimal-versions tool: cargo-hack,cargo-minimal-versions
@ -132,7 +130,7 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
- name: Install cargo-nextest - name: Install cargo-nextest
uses: taiki-e/install-action@v2.33.12 uses: taiki-e/install-action@v2.33.17
with: with:
tool: cargo-nextest tool: cargo-nextest

View File

@ -25,7 +25,7 @@ jobs:
- { name: Windows (MinGW), os: windows-latest, triple: x86_64-pc-windows-gnu } - { name: Windows (MinGW), os: windows-latest, triple: x86_64-pc-windows-gnu }
- { name: Windows (32-bit), os: windows-latest, triple: i686-pc-windows-msvc } - { name: Windows (32-bit), os: windows-latest, triple: i686-pc-windows-msvc }
version: version:
- { name: msrv, version: 1.65.0 } - { name: msrv, version: 1.70.0 }
- { name: stable, version: stable } - { name: stable, version: stable }
name: ${{ matrix.target.name }} / ${{ matrix.version.name }} name: ${{ matrix.target.name }} / ${{ matrix.version.name }}
@ -62,17 +62,17 @@ jobs:
with: with:
toolchain: ${{ matrix.version.version }} toolchain: ${{ matrix.version.version }}
- name: Install just, cargo-hack, cargo-ci-cache-clean - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
uses: taiki-e/install-action@v2.33.12 uses: taiki-e/install-action@v2.33.17
with: with:
tool: just,cargo-hack,cargo-ci-cache-clean tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
- name: Generate Cargo.lock - name: Generate Cargo.lock
run: cargo generate-lockfile run: cargo generate-lockfile
- name: workaround MSRV issues - name: workaround MSRV issues
if: matrix.version.name == 'msrv' if: matrix.version.name == 'msrv'
run: just downgrade-msrv run: just downgrade-for-msrv
- name: check lib - name: check lib
if: > if: >
@ -83,7 +83,7 @@ jobs:
if: matrix.target.os == 'ubuntu-latest' if: matrix.target.os == 'ubuntu-latest'
run: cargo ci-check-lib-linux run: cargo ci-check-lib-linux
- name: check lib - name: check lib
if: matrix.target.triple == 'x86_64-pc-windows-gnu' if: matrix.target.triple != 'x86_64-pc-windows-gnu'
run: cargo ci-check-min run: cargo ci-check-min
- name: check full - name: check full
@ -97,30 +97,15 @@ jobs:
run: cargo ci-check-linux run: cargo ci-check-linux
- name: tests - name: tests
if: matrix.target.os == 'macos-latest' run: just test
run: cargo ci-test
- name: tests # TODO: re-instate some io-uring tests for PRs
if: >
matrix.target.os == 'windows-latest'
&& matrix.target.triple != 'x86_64-pc-windows-gnu'
run: cargo ci-test-win
- name: tests
if: matrix.target.os == 'ubuntu-latest'
run: >-
sudo bash -c "
ulimit -Sl 512
&& ulimit -Hl 512
&& PATH=$PATH:/usr/share/rust/.cargo/bin
&& RUSTUP_TOOLCHAIN=${{ matrix.version.version }} cargo ci-test-rustls-020
&& RUSTUP_TOOLCHAIN=${{ matrix.version.version }} cargo ci-test-rustls-021
&& RUSTUP_TOOLCHAIN=${{ matrix.version.version }} cargo ci-test-linux
"
- name: CI cache clean - name: CI cache clean
run: cargo-ci-cache-clean run: cargo-ci-cache-clean
rustdoc: docs:
name: rustdoc name: Documentation
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -131,6 +116,10 @@ jobs:
with: with:
toolchain: nightly toolchain: nightly
- name: doc tests io-uring - name: Install just
run: | uses: taiki-e/install-action@v2.33.17
sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && PATH=$PATH:/usr/share/rust/.cargo/bin && RUSTUP_TOOLCHAIN=nightly cargo ci-doctest" with:
tool: just
- name: doc tests
run: just test-docs

View File

@ -23,7 +23,7 @@ jobs:
components: llvm-tools-preview components: llvm-tools-preview
- name: Install cargo-llvm-cov - name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2.33.12 uses: taiki-e/install-action@v2.33.17
with: with:
tool: cargo-llvm-cov tool: cargo-llvm-cov
@ -31,7 +31,7 @@ jobs:
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.3.0 uses: codecov/codecov-action@v4.3.1
with: with:
files: codecov.json files: codecov.json
fail_ci_if_error: true fail_ci_if_error: true

View File

@ -55,7 +55,7 @@ jobs:
toolchain: nightly-2023-10-10 toolchain: nightly-2023-10-10
- name: Install just - name: Install just
uses: taiki-e/install-action@v2.33.12 uses: taiki-e/install-action@v2.33.17
with: with:
tool: just tool: just

View File

@ -17,7 +17,7 @@ members = [
[workspace.package] [workspace.package]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.65" rust-version = "1.70"
[patch.crates-io] [patch.crates-io]
actix-codec = { path = "actix-codec" } actix-codec = { path = "actix-codec" }

View File

@ -2,6 +2,8 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.70.
## 0.5.2 ## 0.5.2
- Minimum supported Rust version (MSRV) is now 1.65. - Minimum supported Rust version (MSRV) is now 1.65.

View File

@ -2,6 +2,8 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.70.
## 0.2.4 ## 0.2.4
- Update `syn` dependency to `2`. - Update `syn` dependency to `2`.

View File

@ -33,5 +33,6 @@ proc-macro2 = "1.0.60"
actix-rt = "2" actix-rt = "2"
futures-util = { version = "0.3.17", default-features = false } futures-util = { version = "0.3.17", default-features = false }
rustversion = "1" # rustversion = "1"
rustversion = { path = "/Users/rob/Development/forks/rustversion" }
trybuild = "1" trybuild = "1"

View File

@ -1,4 +1,4 @@
#[rustversion::stable(1.65)] // MSRV #[rustversion::stable(1.70)] // MSRV
#[test] #[test]
fn compile_macros() { fn compile_macros() {
let t = trybuild::TestCases::new(); let t = trybuild::TestCases::new();

View File

@ -2,6 +2,8 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.70.
## 2.9.0 ## 2.9.0
- Add `actix_rt::System::runtime()` method to retrieve the underlying `actix_rt::Runtime` runtime. - Add `actix_rt::System::runtime()` method to retrieve the underlying `actix_rt::Runtime` runtime.

View File

@ -2,6 +2,8 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.70.
## 2.3.0 ## 2.3.0
- Add support for MultiPath TCP (MPTCP) with `MpTcp` enum and `ServerBuilder::mptcp()` method. - Add support for MultiPath TCP (MPTCP) with `MpTcp` enum and `ServerBuilder::mptcp()` method.

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.65. - Minimum supported Rust version (MSRV) is now 1.70.
## 2.0.2 ## 2.0.2

View File

@ -3,6 +3,7 @@
## Unreleased ## Unreleased
- Add `rustls-0_23` crate feature which excludes any root certificate methods or re-exports. - Add `rustls-0_23` crate feature which excludes any root certificate methods or re-exports.
- Minimum supported Rust version (MSRV) is now 1.70.
## 3.3.0 ## 3.3.0

View File

@ -34,6 +34,8 @@ pub mod reexports {
/// Returns root certificates via `rustls-native-certs` crate as a rustls certificate store. /// Returns root certificates via `rustls-native-certs` crate as a rustls certificate store.
/// ///
/// See [`rustls_native_certs::load_native_certs()`] for more info on behavior and errors. /// See [`rustls_native_certs::load_native_certs()`] for more info on behavior and errors.
///
/// [`rustls_native_certs::load_native_certs()`]: rustls_native_certs_06::load_native_certs()
#[cfg(feature = "rustls-0_20-native-roots")] #[cfg(feature = "rustls-0_20-native-roots")]
pub fn native_roots_cert_store() -> io::Result<RootCertStore> { pub fn native_roots_cert_store() -> io::Result<RootCertStore> {
let mut root_certs = RootCertStore::empty(); let mut root_certs = RootCertStore::empty();

View File

@ -34,6 +34,8 @@ pub mod reexports {
/// Returns root certificates via `rustls-native-certs` crate as a rustls certificate store. /// Returns root certificates via `rustls-native-certs` crate as a rustls certificate store.
/// ///
/// See [`rustls_native_certs::load_native_certs()`] for more info on behavior and errors. /// See [`rustls_native_certs::load_native_certs()`] for more info on behavior and errors.
///
/// [`rustls_native_certs::load_native_certs()`]: rustls_native_certs_06::load_native_certs()
#[cfg(feature = "rustls-0_21-native-roots")] #[cfg(feature = "rustls-0_21-native-roots")]
pub fn native_roots_cert_store() -> io::Result<RootCertStore> { pub fn native_roots_cert_store() -> io::Result<RootCertStore> {
let mut root_certs = RootCertStore::empty(); let mut root_certs = RootCertStore::empty();

View File

@ -34,6 +34,8 @@ pub mod reexports {
/// Returns root certificates via `rustls-native-certs` crate as a rustls certificate store. /// Returns root certificates via `rustls-native-certs` crate as a rustls certificate store.
/// ///
/// See [`rustls_native_certs::load_native_certs()`] for more info on behavior and errors. /// See [`rustls_native_certs::load_native_certs()`] for more info on behavior and errors.
///
/// [`rustls_native_certs::load_native_certs()`]: rustls_native_certs_07::load_native_certs()
#[cfg(feature = "rustls-0_22-native-roots")] #[cfg(feature = "rustls-0_22-native-roots")]
pub fn native_roots_cert_store() -> io::Result<tokio_rustls::rustls::RootCertStore> { pub fn native_roots_cert_store() -> io::Result<tokio_rustls::rustls::RootCertStore> {
let mut root_certs = tokio_rustls::rustls::RootCertStore::empty(); let mut root_certs = tokio_rustls::rustls::RootCertStore::empty();

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.65. - Minimum supported Rust version (MSRV) is now 1.70.
## 0.1.0 ## 0.1.0

View File

@ -27,6 +27,6 @@ actix-utils = "3"
tracing = "0.1.35" tracing = "0.1.35"
tracing-futures = "0.2" tracing-futures = "0.2"
[dev_dependencies] [dev-dependencies]
actix-rt = "2" actix-rt = "2"
slab = "0.4" slab = "0.4"

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.65. - Minimum supported Rust version (MSRV) is now 1.70.
## 3.0.1 ## 3.0.1

View File

@ -2,6 +2,8 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.70.
## 1.3.1 ## 1.3.1
- No significant changes since `1.3.0`. - No significant changes since `1.3.0`.

View File

@ -3,7 +3,7 @@ _list:
# Downgrade dev-dependencies necessary to run MSRV checks/tests. # Downgrade dev-dependencies necessary to run MSRV checks/tests.
[private] [private]
downgrade-msrv: downgrade-for-msrv:
cargo update -p=ciborium --precise=0.2.1 cargo update -p=ciborium --precise=0.2.1
cargo update -p=ciborium-ll --precise=0.2.1 cargo update -p=ciborium-ll --precise=0.2.1
cargo update -p=time --precise=0.3.16 cargo update -p=time --precise=0.3.16
@ -12,14 +12,51 @@ downgrade-msrv:
cargo update -p=anstyle --precise=1.0.2 cargo update -p=anstyle --precise=1.0.2
cargo update -p=trybuild --precise=1.0.89 cargo update -p=trybuild --precise=1.0.89
msrv := ```
cargo metadata --format-version=1 \
| jq -r 'first(.packages[] | select(.source == null and .name == "actix-tls")) | .rust_version'
```
msrv_full := msrv + ".0" # comment out if the MSRV has a patch version specified
msrv_rustup := "+" + msrv_full
non_linux_all_features_list := ```
cargo metadata --format-version=1 \
| jq '.packages[] | select(.source == null) | .features | keys' \
| jq -r --slurp \
--arg exclusions "tokio-uring,io-uring" \
'add | unique | . - ($exclusions | split(",")) | join(",")'
```
all_crate_features := if os() == "linux" {
"--all-features"
} else {
"--features='" + non_linux_all_features_list + "'"
}
# Test workspace code.
test toolchain="":
cargo {{ toolchain }} test --lib --tests --package=actix-macros
cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros --no-default-features
cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros {{ all_crate_features }}
# Test workspace using MSRV.
test-msrv: downgrade-for-msrv (test msrv_rustup)
# Test workspace docs.
test-docs toolchain="": && doc
cargo {{ toolchain }} test --doc --workspace {{ all_crate_features }} --no-fail-fast -- --nocapture
# Test workspace.
test-all toolchain="": (test toolchain) (test-docs)
# Document crates in workspace. # Document crates in workspace.
doc: doc *args:
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --features=rustls,openssl RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --no-deps --workspace {{ all_crate_features }} {{ args }}
# Document crates in workspace and watch for changes. # Document crates in workspace and watch for changes.
doc-watch: doc-watch:
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --features=rustls-0_20,rustls-0_21,rustls-0_20-native-roots,rustls-0_21-native-roots,openssl --open @just doc --open
cargo watch -- RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --features=rustls-0_20,rustls-0_21,rustls-0_20-native-roots,rustls-0_21-native-roots,openssl cargo watch -- just doc
# Check for unintentional external type exposure on all crates in workspace. # Check for unintentional external type exposure on all crates in workspace.
check-external-types-all toolchain="+nightly": check-external-types-all toolchain="+nightly":
@ -27,7 +64,7 @@ check-external-types-all toolchain="+nightly":
set -euo pipefail set -euo pipefail
exit=0 exit=0
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
if ! just check-external-types-manifest "$f" {{toolchain}}; then exit=1; fi if ! just check-external-types-manifest "$f" {{ toolchain }}; then exit=1; fi
echo echo
echo echo
done done
@ -40,9 +77,9 @@ check-external-types-all-table toolchain="+nightly":
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
echo echo
echo "Checking for $f" echo "Checking for $f"
just check-external-types-manifest "$f" {{toolchain}} --output-format=markdown-table just check-external-types-manifest "$f" {{ toolchain }} --output-format=markdown-table
done done
# Check for unintentional external type exposure on a crate. # Check for unintentional external type exposure on a crate.
check-external-types-manifest manifest_path toolchain="+nightly" *extra_args="": check-external-types-manifest manifest_path toolchain="+nightly" *extra_args="":
cargo {{toolchain}} check-external-types --manifest-path "{{manifest_path}}" {{extra_args}} cargo {{ toolchain }} check-external-types --manifest-path "{{ manifest_path }}" {{ extra_args }}

View File

@ -2,6 +2,8 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.70.
## 0.1.5 ## 0.1.5
- No significant changes since `0.1.4`. - No significant changes since `0.1.4`.

View File

@ -2,6 +2,8 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.70.
## 0.1.4 ## 0.1.4
- Minimum supported Rust version (MSRV) is now 1.65. - Minimum supported Rust version (MSRV) is now 1.65.