Skip to content

Commit

Permalink
Merge branch 'main' into RequestResponseStreaming
Browse files Browse the repository at this point in the history
  • Loading branch information
bretambrose committed Feb 6, 2025
2 parents 5039412 + 495dfe8 commit 87454a3
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
33 changes: 5 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,17 @@
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")
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")

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion codebuild/cd/musl-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion codebuild/cd/musl-armv7-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 10 additions & 3 deletions codebuild/cd/musl-linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,25 @@ 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/')
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
Expand Down
2 changes: 1 addition & 1 deletion codebuild/cd/musl-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion crt/aws-c-http
2 changes: 1 addition & 1 deletion crt/aws-checksums
2 changes: 1 addition & 1 deletion crt/s2n
Submodule s2n updated from 2e79e7 to 6cc9f5

0 comments on commit 87454a3

Please sign in to comment.