Skip to content

Commit

Permalink
Trousers integration
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Dec 18, 2023
1 parent 37e5e9c commit d3d7749
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,13 @@ jobs:
- name: Run integration build
run: |
./tests/ci/integration/run_tcpdump_integration.sh
trousers:
runs-on: ubuntu-latest
steps:
- name: Install OS Dependencies
run: |
sudo apt-get update && sudo apt-get -y --no-install-recommends install cmake gcc ninja-build golang make
- uses: actions/checkout@v3
- name: Run trousers build
run: |
./tests/ci/integration/run_trousers_integration.sh
60 changes: 60 additions & 0 deletions tests/ci/integration/run_trousers_integration.sh
Original file line number Diff line number Diff line change
@@ -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


0 comments on commit d3d7749

Please sign in to comment.