Skip to content

Commit cb9cefe

Browse files
committed
Add AWS-LC to GitHub Actions
1 parent f92ec92 commit cb9cefe

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ jobs:
149149
- true
150150
- false
151151
library:
152+
- name: aws-lc
153+
version: v1.48.2
154+
- name: aws-lc
155+
version: vendored
152156
- name: boringssl
153157
version: e23fe9b6eecc10e4f9ea1f0027fea5eaee7bd6b6
154158
- name: openssl
@@ -274,18 +278,25 @@ jobs:
274278
url="https://boringssl.googlesource.com/boringssl/+archive/${{ matrix.library.version }}.tar.gz"
275279
tar_flags=""
276280
;;
281+
"aws-lc")
282+
url="https://github.com/aws/aws-lc/archive/refs/tags/${{ matrix.library.version }}.tar.gz"
283+
tar_flags="--strip-components=1"
284+
;;
277285
esac
278286
279287
case "${{ matrix.target}}" in
280288
"x86_64-unknown-linux-gnu")
289+
CPU=x86_64
281290
OS_COMPILER=linux-x86_64
282291
OS_FLAGS=""
283292
;;
284293
"i686-unknown-linux-gnu")
294+
CPU=i686
285295
OS_COMPILER=linux-elf
286296
OS_FLAGS="-m32 -msse2"
287297
;;
288298
"arm-unknown-linux-gnueabihf")
299+
CPU=armv4
289300
OS_COMPILER=linux-armv4
290301
OS_FLAGS=""
291302
export AR=arm-linux-gnueabihf-ar
@@ -315,7 +326,7 @@ jobs:
315326
cd build
316327
317328
echo "set(CMAKE_SYSTEM_NAME Linux)" > toolchain.cmake
318-
echo "set(CMAKE_SYSTEM_PROCESSOR $cpu)" >> toolchain.cmake
329+
echo "set(CMAKE_SYSTEM_PROCESSOR $CPU)" >> toolchain.cmake
319330
echo "set(triple ${{ matrix.target }})" >> toolchain.cmake
320331
echo 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} '$OS_FLAGS '" CACHE STRING "c++ flags")' >> toolchain.cmake
321332
echo 'set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} '$OS_FLAGS '" CACHE STRING "c flags")' >> toolchain.cmake
@@ -328,6 +339,22 @@ jobs:
328339
# Copy stuff around so it's all as the build system expects.
329340
cp -r ../rust/ "$OPENSSL_DIR/rust"
330341
cp -r ./ "$OPENSSL_DIR/build"
342+
;;
343+
"aws-lc")
344+
mkdir build
345+
cd build
346+
347+
echo "set(CMAKE_SYSTEM_NAME Linux)" > toolchain.cmake
348+
echo "set(CMAKE_SYSTEM_PROCESSOR $CPU)" >> toolchain.cmake
349+
echo "set(triple ${{ matrix.target }})" >> toolchain.cmake
350+
echo 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} '$OS_FLAGS '" CACHE STRING "c++ flags")' >> toolchain.cmake
351+
echo 'set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} '$OS_FLAGS '" CACHE STRING "c flags")' >> toolchain.cmake
352+
echo 'set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} '$OS_FLAGS '" CACHE STRING "asm flags")' >> toolchain.cmake
353+
354+
cmake .. -DCMAKE_INSTALL_PREFIX="${OPENSSL_DIR}" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake
355+
make -j "$(nproc)"
356+
make install
357+
;;
331358
esac
332359
333360
if: matrix.library.version != 'vendored' && !steps.openssl-cache.outputs.cache-hit
@@ -357,19 +384,23 @@ jobs:
357384
if [[ "${{ matrix.library.version }}" == "vendored" ]]; then
358385
features="--features vendored"
359386
fi
360-
if [[ "${{ matrix.bindgen }}" == "true" && "${{ matrix.library.name }}" != "boringssl" ]]; then
387+
if [[ "${{ matrix.bindgen }}" == "true" ]]; then
361388
features="$features --features bindgen"
362389
fi
363390
cargo run --manifest-path=systest/Cargo.toml --target ${{ matrix.target }} $features
364-
if: matrix.library.name != 'boringssl'
391+
if: ${{ !(matrix.library.name == 'boringssl' || matrix.library.name == 'aws-lc') }}
365392
- name: Test openssl
366393
run: |
367394
if [[ "${{ matrix.library.name }}" == "boringssl" && "${{ matrix.bindgen }}" != "true" ]]; then
368395
features="--features unstable_boringssl"
369396
BORINGSSL_BUILD_DIR="$OPENSSL_DIR/build/"
370397
fi
371398
if [[ "${{ matrix.library.version }}" == "vendored" ]]; then
372-
features="--features vendored"
399+
if [[ "${{ matrix.library.name }}" == "aws-lc"]]; then
400+
features="--features aws-lc"
401+
else
402+
features="--features vendored"
403+
fi
373404
fi
374405
if [[ "${{ matrix.bindgen }}" == "true" ]]; then
375406
features="$features --features bindgen"
@@ -384,4 +415,4 @@ jobs:
384415
features="$features --features openssl-sys/bindgen"
385416
fi
386417
cargo test --manifest-path=openssl-errors/Cargo.toml --target ${{ matrix.target }} $features
387-
if: matrix.library.name != 'boringssl'
418+
if: ${{ !(matrix.library.name == 'boringssl' || matrix.library.name == 'aws-lc') }}

openssl-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rust-version = "1.63.0"
1818
[features]
1919
vendored = ['openssl-src']
2020
unstable_boringssl = ['bssl-sys']
21-
aws-lc = ['aws-lc-sys']
21+
aws-lc = ['dep:aws-lc-sys']
2222

2323
[dependencies]
2424
libc = "0.2"

0 commit comments

Comments
 (0)