Skip to content

Commit

Permalink
testing build
Browse files Browse the repository at this point in the history
  • Loading branch information
anwayde committed Jun 25, 2024
1 parent 63dabdb commit eada0fa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:

- name: Start build
run: |
contrib/build.sh \
--no-deps --no-clang \
--targets $targets \
--gcc-versions $gcc \
--machines $machines
contrib/build.sh --no-deps \
--targets $targets --machines $machines \
--gcc-versions ${{ gcc || 'none --no-gcc' \
--clang-versions ${{ clang || 'none --no-clang'
40 changes: 26 additions & 14 deletions contrib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,42 @@ FD_REPO_DIR=$(realpath $(dirname $(realpath "$0"))/..)
TEST_TARGETS=( unit-test fuzz-test integration-test )
BUILD_TARGETS=( all )
EXTRA_TARGETS=( asm ppp seccomp-policies )

BINARY_TARGETS=( fdctl fddev )
NONBINARY_TARGETS=( ${BUILD_TARGETS[@]} ${EXTRA_TARGETS[@]} ${TEST_TARGETS[@]} )

declare -A CUSTOM_TARGETS=()

CUSTOM_TARGETS+=( ["linux_gcc_minimal"]="${BUILD_TARGETS[@]} ${EXTRA_TARGETS[@]} ${TEST_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_gcc_noarch64"]="${BUILD_TARGETS[@]} ${EXTRA_TARGETS[@]} ${TEST_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_gcc_noarch128"]="${BUILD_TARGETS[@]} ${EXTRA_TARGETS[@]} ${TEST_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_gcc_minimal"]="${NONBINARY_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_gcc_noarch64"]="${NONBINARY_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_gcc_noarch128"]="${NONBINARY_TARGETS[@]}" )

CUSTOM_TARGETS+=( ["macos_clang_m1"]="${BUILD_TARGETS[@]} ${EXTRA_TARGETS[@]} ${TEST_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_clang_minimal"]="${BUILD_TARGETS[@]} ${EXTRA_TARGETS[@]} ${TEST_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_clang_noarch64"]="${BUILD_TARGETS[@]} ${EXTRA_TARGETS[@]} ${TEST_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_clang_noarch128"]="${BUILD_TARGETS[@]} ${EXTRA_TARGETS[@]} ${TEST_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["freebsd_clang_noarch128"]="${BUILD_TARGETS[@]} ${EXTRA_TARGETS[@]} ${TEST_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["macos_clang_m1"]="${NONBINARY_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_clang_minimal"]="${NONBINARY_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_clang_noarch64"]="${NONBINARY_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["linux_clang_noarch128"]="${NONBINARY_TARGETS[@]}" )
CUSTOM_TARGETS+=( ["freebsd_clang_noarch128"]="${NONBINARY_TARGETS[@]}" )

FAIL=0

if [[ ${#GCC[@]} -eq 0 ]]; then
if [[ $NO_GCC -ne 1 ]]; then
if [[ $NO_GCC -ne 1 ]]; then
if [[ ${#GCC[@]} -eq 0 ]]; then
for gcc in $(ls /opt/gcc); do
GCC+=( $gcc )
done
fi
else
GCC=()
fi

if [[ ${#CLANG[@]} -eq 0 ]]; then
if [[ $NO_CLANG -ne 1 ]]; then
if [[ $NO_CLANG -ne 1 ]]; then
if [[ ${#CLANG[@]} -eq 0 ]]; then
for clang in $(ls /opt/clang); do
CLANG+=( $clang )
done
fi
else
CLANG=()
fi

if [[ ${#MACHINES[@]} -eq 0 ]]; then
Expand Down Expand Up @@ -117,6 +123,10 @@ if [[ $NO_GCC -ne 1 ]]; then
START=$(date +%s)
echo "Starting gcc builds..."
for compiler in "${GCC[@]}"; do
if [[ ! -f /opt/gcc/$compiler/activate ]]; then
echo "Environment activate script not found at /opt/gcc/$compiler... exiting."
exit 2
fi
for machine in "${MACHINES[@]}"; do
MACHINE="${machine%.mk}"
if [[ "$MACHINE" != *"clang"* ]]; then
Expand All @@ -130,7 +140,6 @@ if [[ $NO_GCC -ne 1 ]]; then
TARGETS+=( "${BINARY_TARGETS[@]}" )
fi
fi
test -f /opt/gcc/$compiler/activate || (echo "$compiler not found... exiting." && exit 2)
source /opt/gcc/$compiler/activate
echo "Starting builds for $MACHINE with $compiler..."
FAILED=()
Expand Down Expand Up @@ -164,6 +173,10 @@ if [[ $NO_CLANG -ne 1 ]]; then
START=$(date +%s)
echo "Starting clang builds..."
for compiler in "${CLANG[@]}"; do
if [[ ! -f /opt/clang/$compiler/activate ]]; then
echo "Environment activate script not found at /opt/clang/$compiler... exiting."
exit 2
fi
for machine in "${MACHINES[@]}"; do
MACHINE="${machine%.mk}"
if [[ "$MACHINE" != *"gcc"* ]]; then
Expand All @@ -177,7 +190,6 @@ if [[ $NO_CLANG -ne 1 ]]; then
TARGETS+=( "${BINARY_TARGETS[@]}" )
fi
fi
test -f /opt/gcc/$compiler/activate || (echo "$compiler not found... exiting." && exit 2)
source /opt/clang/$compiler/activate
echo "Starting builds for $MACHINE with $compiler..."
FAILED=()
Expand Down

0 comments on commit eada0fa

Please sign in to comment.