Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI fixes #36

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions patches/0007-fix-abi-test-compilation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Index: aws-lc/third_party/boringssl/CMakeLists.txt
===================================================================
--- aws-lc.orig/third_party/boringssl/CMakeLists.txt
+++ aws-lc/third_party/boringssl/CMakeLists.txt
@@ -80,6 +80,8 @@ if(NOT FIPS)
# CMake automatically connects include_directories to the NASM
# command-line, but not add_definitions.
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DBORINGSSL_DISPATCH_TEST")
+ elseif(CMAKE_BUILD_TYPE_LOWER MATCHES "rel")
+ add_definitions(-DBORINGSSL_RELEASE_BUILD)
endif()
endif()

Index: aws-lc/third_party/boringssl/crypto/cipher_extra/aead_test.cc
===================================================================
--- aws-lc.orig/third_party/boringssl/crypto/cipher_extra/aead_test.cc
+++ aws-lc/third_party/boringssl/crypto/cipher_extra/aead_test.cc
@@ -665,7 +665,7 @@ TEST_P(PerAEADTest, InvalidNonceLength)
}
}

-#if defined(SUPPORTS_ABI_TEST)
+#if defined(SUPPORTS_ABI_TEST) && !defined(BORINGSSL_RELEASE_BUILD)
// CHECK_ABI can't pass enums, i.e. |evp_aead_seal| and |evp_aead_open|. Thus
// these two wrappers.
static int aead_ctx_init_for_seal(EVP_AEAD_CTX *ctx, const EVP_AEAD *aead,
Index: aws-lc/third_party/boringssl/crypto/test/abi_test.cc
===================================================================
--- aws-lc.orig/third_party/boringssl/crypto/test/abi_test.cc
+++ aws-lc/third_party/boringssl/crypto/test/abi_test.cc
@@ -208,7 +208,8 @@ template <typename... Args>
WriteFile(stderr_handle, buf, strlen(buf), &unused, nullptr);
}
#else
- write(STDERR_FILENO, buf, strlen(buf));
+ OPENSSL_UNUSED ssize_t unused_ret =
+ write(STDERR_FILENO, buf, strlen(buf));
Comment on lines +32 to +37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to fix gcc4 related compile warning?

#endif
abort();
}
1 change: 1 addition & 0 deletions patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0004-disable-urandom-test-docker.patch
0005-fix-ssl-test-runner-output.patch
0006-fix-gcc4-compile-errors.patch
0007-fix-abi-test-compilation.patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main has 007 patch. Need to change this to 008 or 009.

20 changes: 0 additions & 20 deletions tests/c99_gcc_test.sh

This file was deleted.

6 changes: 3 additions & 3 deletions tests/ci/codebuild/centos-7_gcc-4x-x86-64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ phases:
- export CC=gcc
- export CXX=g++
- export GO111MODULE=on
# build:
# commands:
# - ./tests/ci/run_posix_tests.sh
build:
commands:
- ./tests/ci/run_posix_tests.sh
6 changes: 3 additions & 3 deletions tests/ci/codebuild/centos-7_gcc-4x-x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ phases:
- export CXX=g++
- export AWSLC_32BIT=1
- export GO111MODULE=on
# build:
# commands:
# - ./tests/ci/run_posix_tests.sh
build:
commands:
- ./tests/ci/run_posix_tests.sh
6 changes: 3 additions & 3 deletions tests/ci/codebuild/ubuntu-19.10_clang-9x_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ phases:
commands:
- export CC=clang-9
- export CXX=clang++-9
# build:
# commands:
# - ./tests/ci/run_posix_tests.sh
build:
commands:
- ./tests/ci/run_posix_tests.sh
6 changes: 3 additions & 3 deletions tests/ci/codebuild/ubuntu-19.10_clang-9x_x86-64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ phases:
commands:
- export CC=clang-9
- export CXX=clang++-9
# build:
# commands:
# - ./tests/ci/run_posix_tests.sh
build:
commands:
- ./tests/ci/run_posix_tests.sh
6 changes: 3 additions & 3 deletions tests/ci/codebuild/ubuntu-19.10_gcc-9x_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ phases:
commands:
- export CC=gcc-9
- export CXX=g++-9
# build:
# commands:
# - ./tests/ci/run_posix_tests.sh
build:
commands:
- ./tests/ci/run_posix_tests.sh
6 changes: 3 additions & 3 deletions tests/ci/codebuild/ubuntu-19.10_gcc-9x_x86-64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ phases:
- export CXX=g++-9
- export AWSLC_CODING_GUIDELINES_TEST=1
- export AWSLC_C99_TEST=1
# build:
# commands:
# - ./tests/ci/run_posix_tests.sh
build:
commands:
- ./tests/ci/run_posix_tests.sh
2 changes: 1 addition & 1 deletion tests/ci/run_posix_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

if [[ "${AWSLC_C99_TEST}" == "1" ]]; then
echo "Testing the C99 compatability of AWS-LC headers."
./tests/c99_gcc_test.sh
./tests/coding_guidelines/c99_gcc_test.sh
fi

if [[ "${AWSLC_CODING_GUIDELINES_TEST}" == "1" ]]; then
Expand Down
33 changes: 12 additions & 21 deletions tests/coding_guidelines/c99_gcc_test.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
#!/bin/bash -ex
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#!/bin/bash

# This test is aimed to run with GCC 6 and above on x86-64 architectures.
Comment on lines -2 to 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright header is needed based on open source policy.


echo "Testing the C99 compatibility of AWS-LC headers."
ROOT_DIR="./third_party/boringssl/"
INCLUDE_DIR="$ROOT_DIR/include"

AWSLC_ROOT_DIR="."
AWSLC_INC_DIR=$AWSLC_ROOT_DIR/include
INCLUDE_FILES=`ls $INCLUDE_DIR/openssl/*.h | grep -v $INCLUDE_DIR/openssl/arm_arch.h`

INC_FILES=`ls $AWSLC_INC_DIR/awslc/*.h | grep -v $AWSLC_INC_DIR/awslc/arm_arch.h`

INC_FILES_STR=""
for f in $INC_FILES; do
INC_FILES_STR+="-include $f "
done
# - This compilation line gets no source files as its input (it uses the -c flag).
# Instead it uses the force include flag (-include) to include all of headers
# except for arm_arch.h, which cannot run on x86-64 architectures.
# - The -Wpedantic flag ensures that the compiler will fault if a non C99 line
# exists in the code.
# - The -fsyntax-only tells the compiler to check the syntax without producing
# any outputs.

TMP_C_FILE_NAME=`mktemp --suffix .c`
$CC -std=c99 -c -I$INCLUDE_DIR -include $INCLUDE_FILES -Wpedantic -fsyntax-only

# - This compilation line gets no source file as its input (it uses the -c flag).
# Instead it uses the force include flag (-include) to include all of
# AWS-LC headers except for arm_arch.h, which cannot run on x86-64 architectures.
# - The -Wpedantic flag ensures that the compiler will fault if a non C99 line
# exists in the code
# - The -fsyntax-only tells the compiler to check the symtax without producing
# any outputs.
$CC -std=c99 $TMP_C_FILE_NAME -c -I$AWSLC_INC_DIR $INC_FILES_STR -Wpedantic -fsyntax-only

3 changes: 1 addition & 2 deletions tests/coding_guidelines/coding_guidelines_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
# SPDX-License-Identifier: Apache-2.0

./tests/coding_guidelines/style.sh
# TODO: re-enable c99_gcc_test.sh when header files are moved to ./include/awslc
# ./tests/coding_guidelines/c99_gcc_test.sh
./tests/coding_guidelines/c99_gcc_test.sh