Skip to content

Commit 378163b

Browse files
authored
Fix CI (#825)
* Fix clippy lints * Install careful w/ stable toolchain * No more windows-2019 GH runner * msys2 CI fix
1 parent f031c04 commit 378163b

File tree

17 files changed

+52
-50
lines changed

17 files changed

+52
-50
lines changed

.github/workflows/cross.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ jobs:
321321
fail-fast: false
322322
matrix:
323323
include:
324-
- { sys: mingw64, env: x86_64, target: x86_64-pc-windows-gnu, cc: gcc, cxx: g++ }
325-
- { sys: ucrt64, env: ucrt-x86_64, target: x86_64-pc-windows-gnu, cc: gcc, cxx: g++ }
326-
- { sys: clang64, env: clang-x86_64, target: x86_64-pc-windows-gnullvm, cc: clang, cxx: clang++ }
324+
- { sys: mingw64 }
325+
- { sys: ucrt64 }
326+
- { sys: clang64 }
327327
steps:
328328
- name: Install MSYS2
329329
uses: msys2/setup-msys2@v2
@@ -332,6 +332,8 @@ jobs:
332332
msystem: ${{ matrix.sys }}
333333
update: true
334334
pacboy: >-
335+
toolchain
336+
rust
335337
rust-bindgen
336338
ninja
337339
cc
@@ -340,22 +342,17 @@ jobs:
340342
- name: Update Environment
341343
shell: bash
342344
run: |
343-
echo "GOPATH=${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}" >> $GITHUB_ENV
344-
echo "GOROOT=${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}\lib\go" >> $GITHUB_ENV
345-
echo "CC=${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}\bin\${{ matrix.cc }}.exe" >> $GITHUB_ENV
346-
echo "CXX=${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}\bin\${{ matrix.cxx }}.exe" >> $GITHUB_ENV
345+
SYSROOT=$(cygpath -a -m '${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}')
346+
echo "BINDGEN_EXTRA_CLANG_ARGS=-target x86_64-pc-windows-gnu" >> $GITHUB_ENV
347+
echo "GOPATH=${SYSROOT}" >> $GITHUB_ENV
348+
echo "GOROOT=${SYSROOT}/lib/go" >> $GITHUB_ENV
347349
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
348-
echo "${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}\bin" >> $GITHUB_PATH
350+
cygpath -w ${SYSROOT}/bin >> $GITHUB_PATH
349351
- name: Checkout
350352
uses: actions/checkout@v4
351353
with:
352354
submodules: "recursive"
353-
- uses: dtolnay/rust-toolchain@master
354-
id: toolchain
355-
with:
356-
toolchain: stable
357-
target: ${{matrix.target}}
358355
- name: Build
359-
run: cargo build -p aws-lc-rs --target ${{matrix.target}} --features bindgen
356+
run: cargo build --verbose --features bindgen --release -p aws-lc-rs
360357
- name: Test
361-
run: cargo test -p aws-lc-rs --target ${{matrix.target}} --features bindgen
358+
run: cargo test --verbose --features bindgen -p aws-lc-rs

.github/workflows/fips.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
fail-fast: false
7171
matrix:
72-
os: [ windows-2019, windows-latest ]
72+
os: [ windows-latest ]
7373
args:
7474
- --all-targets --features fips,unstable
7575
- --all-targets --features fips,bindgen,unstable

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
fail-fast: false
9393
matrix:
9494
rust: [ stable ]
95-
os: [ windows-2019, windows-2022 ]
95+
os: [ windows-2022 ]
9696
args:
9797
- --all-targets --features unstable
9898
- --all-targets --features bindgen,unstable
@@ -466,6 +466,8 @@ jobs:
466466
with:
467467
submodules: 'recursive'
468468
lfs: true
469+
- name: Install cargo-careful
470+
run: cargo install cargo-careful
469471
- uses: dtolnay/rust-toolchain@master
470472
id: toolchain
471473
with:
@@ -478,8 +480,6 @@ jobs:
478480
echo 'LLVM_CONFIG_PATH=${{ (matrix.os == 'macos-13' && '/usr/local') || '/opt/homebrew' }}/opt/llvm/bin/llvm-config' >> $GITHUB_ENV
479481
- name: Set Rust toolchain override
480482
run: rustup override set ${{ steps.toolchain.outputs.name }}
481-
- name: Install cargo-careful
482-
run: cargo install --locked cargo-careful
483483
- uses: actions/setup-go@v4
484484
with:
485485
go-version: '>=1.18'

aws-lc-fips-sys/builder/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,13 @@ const PRELUDE: &str = r"
685685
#![allow(
686686
clippy::cast_lossless,
687687
clippy::cast_possible_truncation,
688+
clippy::cast_possible_wrap,
688689
clippy::default_trait_access,
690+
clippy::missing_safety_doc,
689691
clippy::must_use_candidate,
690692
clippy::not_unsafe_ptr_arg_deref,
691693
clippy::ptr_as_ptr,
694+
clippy::ptr_offset_with_cast,
692695
clippy::pub_underscore_fields,
693696
clippy::semicolon_if_nothing_returned,
694697
clippy::too_many_lines,
@@ -700,7 +703,8 @@ const PRELUDE: &str = r"
700703
non_camel_case_types,
701704
non_snake_case,
702705
non_upper_case_globals,
703-
unused_imports,
706+
unpredictable_function_pointer_comparisons,
707+
unused_imports
704708
)]
705709
";
706710

@@ -781,9 +785,9 @@ fn invoke_external_bindgen(
781785
bindgen_params.extend(["--raw-line", PRELUDE]);
782786
}
783787
bindgen_params.push("--");
784-
clang_args
785-
.iter()
786-
.for_each(|x| bindgen_params.push(x.as_str()));
788+
for x in &clang_args {
789+
bindgen_params.push(x.as_str());
790+
}
787791
let cmd_params: Vec<OsString> = bindgen_params.iter().map(OsString::from).collect();
788792
let cmd_params: Vec<&OsStr> = cmd_params.iter().map(OsString::as_os_str).collect();
789793

aws-lc-fips-sys/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ platform_binding!(
5858
#[allow(
5959
clippy::cast_lossless,
6060
clippy::cast_possible_truncation,
61+
clippy::cast_possible_wrap,
6162
clippy::default_trait_access,
63+
clippy::missing_safety_doc,
6264
clippy::must_use_candidate,
6365
clippy::not_unsafe_ptr_arg_deref,
6466
clippy::ptr_as_ptr,
67+
clippy::ptr_offset_with_cast,
6568
clippy::pub_underscore_fields,
6669
clippy::semicolon_if_nothing_returned,
6770
clippy::too_many_lines,
@@ -73,6 +76,7 @@ platform_binding!(
7376
non_camel_case_types,
7477
non_snake_case,
7578
non_upper_case_globals,
79+
unpredictable_function_pointer_comparisons,
7680
unused_imports
7781
)]
7882
mod generated {

aws-lc-rs/src/cipher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub enum OperatingMode {
284284
}
285285

286286
impl OperatingMode {
287-
fn evp_cipher(&self, algorithm: &Algorithm) -> ConstPointer<EVP_CIPHER> {
287+
fn evp_cipher(&self, algorithm: &Algorithm) -> ConstPointer<'_, EVP_CIPHER> {
288288
unsafe {
289289
ConstPointer::new_static(match (self, algorithm.id) {
290290
(OperatingMode::CBC, AlgorithmId::Aes128) => EVP_aes_128_cbc(),

aws-lc-rs/src/cipher/streaming.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ impl StreamingEncryptingKey {
206206
pub fn finish(
207207
mut self,
208208
output: &mut [u8],
209-
) -> Result<(DecryptionContext, BufferUpdate), Unspecified> {
209+
) -> Result<(DecryptionContext, BufferUpdate<'_>), Unspecified> {
210210
if output.len() < self.algorithm().block_len() {
211211
return Err(Unspecified);
212212
}
@@ -423,7 +423,7 @@ impl StreamingDecryptingKey {
423423
/// # Errors
424424
/// * Returns an error if the `output` buffer is smaller than the algorithm's
425425
/// block length.
426-
pub fn finish(mut self, output: &mut [u8]) -> Result<BufferUpdate, Unspecified> {
426+
pub fn finish(mut self, output: &mut [u8]) -> Result<BufferUpdate<'_>, Unspecified> {
427427
if output.len() < self.algorithm().block_len() {
428428
return Err(Unspecified);
429429
}

aws-lc-rs/src/digest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ pub const MAX_OUTPUT_LEN: usize = 512 / 8;
340340
pub const MAX_CHAINING_LEN: usize = MAX_OUTPUT_LEN;
341341

342342
/// Match digest types for `EVP_MD` functions.
343-
pub(crate) fn match_digest_type(algorithm_id: &AlgorithmID) -> ConstPointer<EVP_MD> {
343+
pub(crate) fn match_digest_type(algorithm_id: &AlgorithmID) -> ConstPointer<'_, EVP_MD> {
344344
unsafe {
345345
ConstPointer::new_static(match algorithm_id {
346346
AlgorithmID::SHA1 => EVP_sha1(),

aws-lc-rs/src/evp_pkey.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ impl ConstPointer<'_, EVP_PKEY> {
9595
}
9696

9797
#[allow(dead_code)]
98-
pub(crate) fn get_ec_key(&self) -> Result<ConstPointer<EC_KEY>, KeyRejected> {
98+
pub(crate) fn get_ec_key(&self) -> Result<ConstPointer<'_, EC_KEY>, KeyRejected> {
9999
self.project_const_lifetime(unsafe { |evp_pkey| EVP_PKEY_get0_EC_KEY(**evp_pkey) })
100100
.map_err(|()| KeyRejected::wrong_algorithm())
101101
}
102102

103-
pub(crate) fn get_rsa(&self) -> Result<ConstPointer<RSA>, KeyRejected> {
103+
pub(crate) fn get_rsa(&self) -> Result<ConstPointer<'_, RSA>, KeyRejected> {
104104
self.project_const_lifetime(unsafe { |evp_pkey| EVP_PKEY_get0_RSA(**evp_pkey) })
105105
.map_err(|()| KeyRejected::wrong_algorithm())
106106
}

aws-lc-rs/src/kdf/kbkdf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl KbkdfCtrHmacAlgorithm {
6161
}
6262

6363
#[must_use]
64-
fn get_evp_md(&self) -> ConstPointer<EVP_MD> {
64+
fn get_evp_md(&self) -> ConstPointer<'_, EVP_MD> {
6565
match_digest_type(match self.id {
6666
KbkdfCtrHmacAlgorithmId::Sha224 => &AlgorithmID::SHA224,
6767
KbkdfCtrHmacAlgorithmId::Sha256 => &AlgorithmID::SHA256,

0 commit comments

Comments
 (0)