Skip to content

Commit

Permalink
Improve MSRV CI
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Jan 31, 2024
1 parent f9ce9f9 commit 554012b
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 28 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,27 +194,7 @@ jobs:
working-directory: ./aws-lc-rs
run: cargo --locked check

msrv:
name: Minimum Supported Rust Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: true

- uses: dtolnay/rust-toolchain@stable
id: toolchain

- name: Set Rust toolchain override
run: rustup override set ${{ steps.toolchain.outputs.name }}

- name: Install cargo-msrv
run: cargo install cargo-msrv

- name: Verify msrv
working-directory: ./aws-lc-rs
run: cargo msrv verify

copyright:
runs-on: ubuntu-latest
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,44 @@ jobs:
- name: ${{ matrix.crate }}
working-directory: ./${{ matrix.crate }}
run: cargo ${{ matrix.args }}

msrv:
name: Minimum Supported Rust Version
if: github.repository == 'aws/aws-lc-rs'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-12, macos-13-xlarge, windows-latest ]
features: [ 'bindgen', 'fips,bindgen' ]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: true

- name: Install NASM on Windows
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1

- name: Setup Go >=v1.18
uses: actions/setup-go@v4
with:
go-version: '>=1.18'

- name: Install ninja-build tool
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-ninja@v4

- uses: dtolnay/rust-toolchain@stable
id: toolchain

- name: Set Rust toolchain override
run: rustup override set ${{ steps.toolchain.outputs.name }}

- name: Install cargo-msrv
run: cargo install cargo-msrv

- name: Verify msrv
working-directory: ./aws-lc-rs
run: cargo msrv verify -- --features ${{ matrix.features }}
9 changes: 7 additions & 2 deletions aws-lc-fips-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ cmake = "0.1.48"
dunce = "1.0"
fs_extra = "1.3"

# Pinned dependencies to preserve Rust 1.61 as MSRV
regex = "~1.9.6"
regex-automata = "~0.3.9"
regex-syntax = "~0.7.5"

[target.'cfg(any(all(target_os = "linux", target_arch = "x86_64", target_env="gnu"), all(target_os = "linux", target_arch = "aarch64", target_env="gnu")))'.build-dependencies]
bindgen = { version = "0.69.1", optional = true }
bindgen = { version = "0.69.2", default-features = false, features = ['prettyplease', 'logging'], optional = true }

[target.'cfg(not(any(all(target_os = "linux", target_arch = "x86_64", target_env="gnu"), all(target_os = "linux", target_arch = "aarch64", target_env="gnu"))))'.build-dependencies]
bindgen = { version = "0.69.1" }
bindgen = { version = "0.69.2", default-features = false, features = ['prettyplease', 'logging'] }

[dependencies]
libc = "0.2"
Expand Down
6 changes: 5 additions & 1 deletion aws-lc-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ mirai-annotations = "1.12.0"
paste = "1.0"

[dev-dependencies]
regex = "1.6.0"
lazy_static = "1.4.0"
clap = { version = "4.1.8", features = ["derive"] }
hex = "0.4.3"

# Pinned dependencies to preserve Rust 1.61 as MSRV
regex = "~1.9.6"
regex-automata = "~0.3.9"
regex-syntax = "~0.7.5"
6 changes: 3 additions & 3 deletions aws-lc-rs/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl KeyPair for Ed25519KeyPair {
}
}

pub(crate) unsafe fn generate_key() -> Result<LcPtr<EVP_PKEY>, ()> {
pub(crate) fn generate_key() -> Result<LcPtr<EVP_PKEY>, ()> {
let pkey_ctx = LcPtr::new(unsafe { EVP_PKEY_CTX_new_id(EVP_PKEY_ED25519, null_mut()) })?;

if 1 != unsafe { EVP_PKEY_keygen_init(*pkey_ctx) } {
Expand Down Expand Up @@ -191,7 +191,7 @@ impl Ed25519KeyPair {
/// # Errors
/// `error::Unspecified` if `rng` cannot provide enough bits or if there's an internal error.
pub fn generate_pkcs8(_rng: &dyn SecureRandom) -> Result<Document, Unspecified> {
let evp_pkey = unsafe { generate_key()? };
let evp_pkey = generate_key()?;
evp_pkey.marshall_private_key(Version::V2)
}

Expand Down Expand Up @@ -228,7 +228,7 @@ impl Ed25519KeyPair {
/// # Errors
/// `error::Unspecified` if `rng` cannot provide enough bits or if there's an internal error.
pub fn generate_pkcs8v1(_rng: &dyn SecureRandom) -> Result<Document, Unspecified> {
let evp_pkey = unsafe { generate_key()? };
let evp_pkey = generate_key()?;
evp_pkey.marshall_private_key(Version::V1)
}

Expand Down
9 changes: 7 additions & 2 deletions aws-lc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,16 @@ cmake = "0.1.48"
dunce = "1.0"
fs_extra = "1.3"

# Pinned dependencies to preserve Rust 1.61 as MSRV
regex = "~1.9.6"
regex-automata = "~0.3.9"
regex-syntax = "~0.7.5"

[target.'cfg(any(all(target_os = "macos", target_arch = "x86_64"), all(target_os = "linux", target_arch = "x86", target_env="gnu"), all(target_os = "linux", target_arch = "x86_64", target_env="gnu"), all(target_os = "linux", target_arch = "aarch64", target_env="gnu")))'.build-dependencies]
bindgen = { version = "0.69.1", optional = true }
bindgen = { version = "0.69.2", default-features = false, features = ['prettyplease', 'logging'], optional = true }

[target.'cfg(not(any(all(target_os = "macos", target_arch = "x86_64"), all(target_os = "linux", target_arch = "x86", target_env="gnu"), all(target_os = "linux", target_arch = "x86_64", target_env="gnu"), all(target_os = "linux", target_arch = "aarch64", target_env="gnu"))))'.build-dependencies]
bindgen = { version = "0.69.2" }
bindgen = { version = "0.69.2", default-features = false, features = ['prettyplease', 'logging'] }


[dependencies]
Expand Down

0 comments on commit 554012b

Please sign in to comment.