diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 872b9ed9b..e84918e96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,7 @@ jobs: ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} linux-musl-arm: - runs-on: ubuntu-24.04 # latest + runs-on: ubuntu-22.04 # temporarily downgrade to old ubuntu as 24.04 likes to segfault in the middle of the build strategy: matrix: image: diff --git a/CMakeLists.txt b/CMakeLists.txt index 11e0c451f..f0998655a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,30 +1,10 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.9...3.31) project(aws-crt-jni C) option(BUILD_DEPS "Builds aws common runtime dependencies as part of build" ON) option(CRT_FIPS "Whether to build aws-lc with FIPS compliance" OFF) -if (POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) # Enable options to get their values from normal variables -endif() - -if (DEFINED CMAKE_PREFIX_PATH) - file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH) -endif() - -if (DEFINED CMAKE_INSTALL_PREFIX) - file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX) -endif() - -if (UNIX AND NOT APPLE) - include(GNUInstallDirs) -elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) - set(CMAKE_INSTALL_LIBDIR "lib") -endif() - -if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64") - set(FIND_LIBRARY_USE_LIB64_PATHS true) -endif() +include(GNUInstallDirs) if (NOT WIN32 AND NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo") @@ -32,12 +12,6 @@ endif() message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") -# This is required in order to append /lib/cmake to each element in CMAKE_PREFIX_PATH -set(AWS_MODULE_DIR "/${CMAKE_INSTALL_LIBDIR}/cmake") -string(REPLACE ";" "${AWS_MODULE_DIR};" AWS_MODULE_PATH "${CMAKE_PREFIX_PATH}${AWS_MODULE_DIR}") -# Append that generated list to the module search path -list(APPEND CMAKE_MODULE_PATH ${AWS_MODULE_PATH}) - # Local CMake scripts list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") @@ -111,6 +85,9 @@ if (BUILD_DEPS) add_subdirectory(crt/aws-c-event-stream) add_subdirectory(crt/aws-c-s3) else() + # this is required so we can use aws-c-common's CMake modules + find_package(aws-c-common REQUIRED) + include(AwsFindPackage) include(AwsCFlags) set(IN_SOURCE_BUILD OFF) diff --git a/codebuild/cd/musl-arm64-build.yml b/codebuild/cd/musl-arm64-build.yml index a8a05264d..70bfc402a 100644 --- a/codebuild/cd/musl-arm64-build.yml +++ b/codebuild/cd/musl-arm64-build.yml @@ -8,7 +8,7 @@ phases: build: commands: - cd aws-crt-java - - ./codebuild/cd/musl-linux-build.sh aws-crt-alpine-3.16-arm64 linux-aarch_64-musl + - ./codebuild/cd/musl-linux-build.sh aws-crt-alpine-3.16-arm64 linux-aarch_64-musl linux/aarch64 post_build: commands: diff --git a/codebuild/cd/musl-armv7-build.yml b/codebuild/cd/musl-armv7-build.yml index 626ac7b94..d7cfdca74 100644 --- a/codebuild/cd/musl-armv7-build.yml +++ b/codebuild/cd/musl-armv7-build.yml @@ -9,7 +9,7 @@ phases: commands: - cd aws-crt-java - export AWS_CRT_ARCH=armv7 - - ./codebuild/cd/musl-linux-build.sh aws-crt-alpine-3.16-armv7 linux-armv7-musl + - ./codebuild/cd/musl-linux-build.sh aws-crt-alpine-3.16-armv7 linux-armv7-musl linux/arm/v7 post_build: commands: diff --git a/codebuild/cd/musl-linux-build.sh b/codebuild/cd/musl-linux-build.sh index 83731105a..8f9df78ef 100755 --- a/codebuild/cd/musl-linux-build.sh +++ b/codebuild/cd/musl-linux-build.sh @@ -6,6 +6,8 @@ IMAGE_NAME=$1 shift CLASSIFIER=$1 shift +ARCH=$1 +shift # Pry the builder version this CRT is using out of ci.yml BUILDER_VERSION=$(cat .github/workflows/ci.yml | grep 'BUILDER_VERSION:' | sed 's/\s*BUILDER_VERSION:\s*\(.*\)/\1/') @@ -13,11 +15,16 @@ echo "Using builder version ${BUILDER_VERSION}" aws ecr get-login-password | docker login 123124136734.dkr.ecr.us-east-1.amazonaws.com -u AWS --password-stdin export DOCKER_IMAGE=123124136734.dkr.ecr.us-east-1.amazonaws.com/${IMAGE_NAME}:${BUILDER_VERSION} -export QEMU_IMAGE=123124136734.dkr.ecr.us-east-1.amazonaws.com/multiarch-qemu-user-static:latest -docker run --rm --privileged ${QEMU_IMAGE} --reset -p yes + +# on x86-64 and aarch64 we run on native images in codebuild +# on other platforms we require emulation which is done through binfmt +if [ "$ARCH" != "linux/aarch64" ]; then + export QEMU_IMAGE=123124136734.dkr.ecr.us-east-1.amazonaws.com/multiarch-qemu-user-static:latest + docker run --rm --privileged ${QEMU_IMAGE} --reset -p yes +fi export BRANCH_TAG=$(git describe --tags) -docker run --mount type=bind,src=$(pwd),dst=/root/aws-crt-java --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --env AWS_DEFAULT_REGION --env CXXFLAGS --env AWS_CRT_ARCH $DOCKER_IMAGE --version=${BUILDER_VERSION} build -p aws-crt-java --classifier ${CLASSIFIER} --branch ${BRANCH_TAG} run_tests=false +docker run --mount type=bind,src=$(pwd),dst=/root/aws-crt-java --env CXXFLAGS --env AWS_CRT_ARCH --platform ${ARCH} $DOCKER_IMAGE --version=${BUILDER_VERSION} build -p aws-crt-java --classifier ${CLASSIFIER} --branch ${BRANCH_TAG} run_tests=false docker container prune -f # Upload the artifacts to S3 diff --git a/codebuild/cd/musl-x64-build.yml b/codebuild/cd/musl-x64-build.yml index b252c335c..4d9e4d6b6 100644 --- a/codebuild/cd/musl-x64-build.yml +++ b/codebuild/cd/musl-x64-build.yml @@ -8,7 +8,7 @@ phases: build: commands: - cd aws-crt-java - - ./codebuild/cd/musl-linux-build.sh aws-crt-alpine-3.16-x64 linux-x86_64-musl + - ./codebuild/cd/musl-linux-build.sh aws-crt-alpine-3.16-x64 linux-x86_64-musl linux/amd64 post_build: commands: diff --git a/crt/aws-c-cal b/crt/aws-c-cal index fbbe2612a..7299c6ab9 160000 --- a/crt/aws-c-cal +++ b/crt/aws-c-cal @@ -1 +1 @@ -Subproject commit fbbe2612a3385d1ded02a52d20ad7fd2da4501f4 +Subproject commit 7299c6ab9244595b140d604475cdd6c6921be8ae diff --git a/crt/aws-c-common b/crt/aws-c-common index 7a6f5df20..0e7637fa8 160000 --- a/crt/aws-c-common +++ b/crt/aws-c-common @@ -1 +1 @@ -Subproject commit 7a6f5df201cb4b1910932ea3221de83edaa39880 +Subproject commit 0e7637fa852a472bd4c37fc07a325a09c942a5fc diff --git a/crt/aws-c-compression b/crt/aws-c-compression index c6c1191e5..f951ab2b8 160000 --- a/crt/aws-c-compression +++ b/crt/aws-c-compression @@ -1 +1 @@ -Subproject commit c6c1191e525e5aa6ead9e1afc392e35d3b50331e +Subproject commit f951ab2b819fc6993b6e5e6cfef64b1a1554bfc8 diff --git a/crt/aws-c-event-stream b/crt/aws-c-event-stream index d2dcc9344..9422ef78a 160000 --- a/crt/aws-c-event-stream +++ b/crt/aws-c-event-stream @@ -1 +1 @@ -Subproject commit d2dcc9344dae24de320866045d85166d8a91a0d1 +Subproject commit 9422ef78aac566414d1bebb1a5431a4c53a7547c diff --git a/crt/aws-c-http b/crt/aws-c-http index fc3eded24..590c7b597 160000 --- a/crt/aws-c-http +++ b/crt/aws-c-http @@ -1 +1 @@ -Subproject commit fc3eded2465c37d07fd9cc15e9b5b011224c9c9a +Subproject commit 590c7b597f87e5edc080b8b77418690c30319832 diff --git a/crt/aws-c-io b/crt/aws-c-io index fcb38c804..3041dabfc 160000 --- a/crt/aws-c-io +++ b/crt/aws-c-io @@ -1 +1 @@ -Subproject commit fcb38c804364dd627c335da752a99a125a88f6e9 +Subproject commit 3041dabfc13fe9bc9a0467e15aa1d5a09c7fc06f diff --git a/crt/aws-c-mqtt b/crt/aws-c-mqtt index 627c3334e..83247bde8 160000 --- a/crt/aws-c-mqtt +++ b/crt/aws-c-mqtt @@ -1 +1 @@ -Subproject commit 627c3334e52021aa8d5772b6ca076884610f3219 +Subproject commit 83247bde8268905018327891fcf0147f3e438a80 diff --git a/crt/aws-c-s3 b/crt/aws-c-s3 index 21a4ab4da..6eb8be530 160000 --- a/crt/aws-c-s3 +++ b/crt/aws-c-s3 @@ -1 +1 @@ -Subproject commit 21a4ab4dacd1eaf61e6c044c7a299d68fd4c1876 +Subproject commit 6eb8be530b100fed5c6d24ca48a57ee2e6098fbf diff --git a/crt/aws-c-sdkutils b/crt/aws-c-sdkutils index ce09f7976..ba6a28fab 160000 --- a/crt/aws-c-sdkutils +++ b/crt/aws-c-sdkutils @@ -1 +1 @@ -Subproject commit ce09f79768653dbdc810fc14cad8685dd90acba1 +Subproject commit ba6a28fab7ed5d7f1b3b1d12eb672088be093824 diff --git a/crt/aws-checksums b/crt/aws-checksums index 3e4101b9f..fb8bd0b8c 160000 --- a/crt/aws-checksums +++ b/crt/aws-checksums @@ -1 +1 @@ -Subproject commit 3e4101b9f85a2c090774d27ae2131fca1082f522 +Subproject commit fb8bd0b8cff00c8c24a35d601fce1b4c611df6da diff --git a/crt/s2n b/crt/s2n index 2e79e7efe..6cc9f53d7 160000 --- a/crt/s2n +++ b/crt/s2n @@ -1 +1 @@ -Subproject commit 2e79e7efeb26f06eb59a1d4f3444ea63fc3e20c3 +Subproject commit 6cc9f53d7ab5f0427ae5f838891fff57844a9e3f