From e343725efd7fded2beda209edf5d09ccc97eb709 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 20 Jan 2025 10:05:44 +0100 Subject: [PATCH] Merge PR 5, ci: restore aws-lc-rs crypto provider, use cargo-c for librustls install commit 3280e4f49723178b2a7457d203d05cf4612c4de8 Author: Daniel McCarney Date: Sat Jan 18 10:37:15 2025 -0500 ci: restore aws-lc-rs crypto provider in matrix This works without issue with the main branch of rustls-ffi. For the 0.14.1 release when using the Makefile to install there's an upstream issue where the CFLAGS intended for the rustls-ffi client/server examples are _also_ used when building librustls and its rust dependencies. This includes aws-lc-sys, which at the version used by librustls/rustls/aws-lc-rs (0.21.1) produces errors under the pedantic settings used by rustls-ffi for its examples. The warnings have been fixed upstream, but not for the version in use by rustls-ffi 0.14.x. To work around this issue we pass CFLAGS="" when running the make install for librustls 0.14.1. commit 681edd04406fe1a25d2076b7fc5fa844e16bba04 Author: Daniel McCarney Date: Sat Jan 18 10:18:45 2025 -0500 ci: install w/ cargo-c instead of cmake cmake is only required for the client/server example binaries. For mod_tls we only need the librustls bits and can use cargo-c directly. cargo-c respects the host OS pattern of putting libs in an arch-specific subdir. To make the older 0.14.x Makefile install and the cargo-c install equivalent we override this behaviour by setting --libdir. commit 1f7376a5de19ca350c0f5aed6f5dda21c939dda0 Author: Daniel McCarney Date: Sat Jan 18 10:15:58 2025 -0500 ci: remove stale comment RE: MSRV/cargo-c The workflow is using the latest cargo-c release, not one tailored to a Minimum Supported Rust Version (MSRV). --- .github/workflows/linux.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e5d91d9..5ef0e28 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -52,7 +52,7 @@ jobs: crypto: - ring # aws-lc-sys v0.21.1 is not building due to compiler warnings - # - aws-lc-rs + - aws-lc-rs rustls-version: - v0.14.1 - main @@ -86,27 +86,27 @@ jobs: if: matrix.rustls-version != 'main' run: | cd $HOME/rustls-ffi - make DESTDIR=$HOME/rustls-ffi/build/rust CRYPTO_PROVIDER=${{ matrix.crypto }} install + make CFLAGS="" DESTDIR=$HOME/rustls-ffi/build/rust CRYPTO_PROVIDER=${{ matrix.crypto }} install - name: Install cargo-c if: matrix.rustls-version == 'main' env: - # Version picked for MSRV compat. LINK: https://github.com/lu-zero/cargo-c/releases/latest/download/ CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz run: | curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin - - name: 'build rustls-ffi (cmake)' + - name: 'build rustls-ffi (cargo-c)' if: matrix.rustls-version == 'main' run: | cd $HOME/rustls-ffi - cmake \ - -DCRYPTO_PROVIDER=${{matrix.crypto}} \ - -DDYN_LINK=on \ - -DCMAKE_BUILD_TYPE=Release \ - -S librustls -B build - cmake --build build --config "Release" + cargo capi install \ + --libdir lib \ + --prefix "$HOME/rustls-ffi/build/rust" \ + --release \ + --locked \ + --no-default-features \ + --features ${{ matrix.crypto }} - name: 'install test prereqs' run: |