From c50123f350452a6bee5f7f2fb0322e484f40b481 Mon Sep 17 00:00:00 2001 From: Justin W Smith <103147162+justsmth@users.noreply.github.com> Date: Mon, 18 Dec 2023 08:45:11 -0500 Subject: [PATCH] Trousers integration --- .github/workflows/integrations.yml | 7 +++ .../integration/run_trousers_integration.sh | 60 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100755 tests/ci/integration/run_trousers_integration.sh diff --git a/.github/workflows/integrations.yml b/.github/workflows/integrations.yml index a9c22e27f9f..144d9366800 100644 --- a/.github/workflows/integrations.yml +++ b/.github/workflows/integrations.yml @@ -46,3 +46,10 @@ jobs: - name: Run integration build run: | ./tests/ci/integration/run_tcpdump_integration.sh + trousers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run trousers build + run: | + ./tests/ci/integration/run_trousers_integration.sh diff --git a/tests/ci/integration/run_trousers_integration.sh b/tests/ci/integration/run_trousers_integration.sh new file mode 100755 index 00000000000..f393c17de43 --- /dev/null +++ b/tests/ci/integration/run_trousers_integration.sh @@ -0,0 +1,60 @@ +#!/bin/bash -exu +# +# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 OR ISC +# + +source tests/ci/common_posix_setup.sh + +# Set up environment. + +# SYS_ROOT +# | +# - SRC_ROOT(aws-lc) +# | +# - SCRATCH_FOLDER +# | +# - trousers +# - trousers-install +# - AWS_LC_BUILD_FOLDER +# - AWS_LC_INSTALL_FOLDER + +# Assumes script is executed from the root of aws-lc directory +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +SCRATCH_FOLDER=${SYS_ROOT}/"TROUSERS_SCRATCH" +TROUSERS_SRC_FOLDER="${SCRATCH_FOLDER}/trousers" +TROUSERS_INSTALL_FOLDER="${SCRATCH_FOLDER}/trousers-install" +AWS_LC_BUILD_FOLDER="${SCRATCH_FOLDER}/aws-lc-build" +AWS_LC_INSTALL_FOLDER="${SCRATCH_FOLDER}/aws-lc-install" + +mkdir -p "${SCRATCH_FOLDER}" +rm -rf "${SCRATCH_FOLDER:?}"/* + +pushd "${SCRATCH_FOLDER}" + +function trousers_build() { + #git apply "${SCRIPT_DIR}/trousers_patch/aws-lc-trousers.patch" + sh ./bootstrap.sh + ./configure --with-gui=none --prefix="${TROUSERS_INSTALL_FOLDER}" --with-openssl="${AWS_LC_INSTALL_FOLDER}" + make -j "${NUM_CPU_THREADS}" + make install + ldd "${TROUSERS_INSTALL_FOLDER}/sbin/tcsd" | grep "${AWS_LC_INSTALL_FOLDER}/lib/libcrypto.so" || exit 1 +} + + +# Get latest trousers version. +git clone https://git.code.sf.net/p/trousers/trousers "${TROUSERS_SRC_FOLDER}" +mkdir -p "${AWS_LC_BUILD_FOLDER}" "${AWS_LC_INSTALL_FOLDER}" "${TROUSERS_INSTALL_FOLDER}" +ls + +aws_lc_build "${SRC_ROOT}" "${AWS_LC_BUILD_FOLDER}" "${AWS_LC_INSTALL_FOLDER}" -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo +export PKG_CONFIG_PATH="${AWS_LC_INSTALL_FOLDER}"/lib/pkgconfig +export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:${AWS_LC_INSTALL_FOLDER}/lib/" + +pushd "${TROUSERS_SRC_FOLDER}" +trousers_build +popd + +popd + +