Skip to content

Commit b8813c1

Browse files
committed
Merge branch 'main' of https://github.com/awslabs/aws-crt-nodejs into revert_tls13
2 parents 77c693a + d4d56a1 commit b8813c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+11676
-206
lines changed

.builder/actions/crt_size_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def run(self, env):
1111
# Maximum package size (for current platform) in bytes
1212
# NOTE: if you increase this, you might also need to increase the
1313
# limit in continuous-delivery/pack.sh
14-
max_size = 8_000_000
14+
max_size = 9_000_000
1515
# size of current folder
1616
folder_size = 0
1717
# total size in bytes

.github/workflows/ci.yml

+94-58
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ on:
77
- 'docs'
88

99
env:
10-
BUILDER_VERSION: v0.9.62
10+
BUILDER_VERSION: v0.9.73
1111
BUILDER_SOURCE: releases
1212
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
1313
PACKAGE_NAME: aws-crt-nodejs
1414
LINUX_BASE_IMAGE: ubuntu-18-x64
1515
RUN: ${{ github.run_id }}-${{ github.run_number }}
16-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
17-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18-
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
19-
AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
16+
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
17+
AWS_DEFAULT_REGION: us-east-1
2018

21-
jobs:
19+
permissions:
20+
id-token: write # This is required for requesting the JWT
2221

22+
jobs:
2323
linux-compat:
24-
runs-on: ubuntu-20.04 # latest
24+
runs-on: ubuntu-24.04
2525
strategy:
2626
fail-fast: false
2727
matrix:
@@ -35,54 +35,56 @@ jobs:
3535
- rhel8-x64
3636
- raspbian-bullseye
3737
steps:
38-
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
38+
- uses: aws-actions/configure-aws-credentials@v4
39+
with:
40+
role-to-assume: ${{ env.CRT_CI_ROLE }}
41+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
42+
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
3943
- name: Build ${{ env.PACKAGE_NAME }}
4044
run: |
4145
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
42-
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
46+
docker run --privileged --rm tonistiigi/binfmt --install all
4347
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
4448
4549
musl-linux:
46-
runs-on: ubuntu-20.04 # latest
50+
runs-on: ubuntu-24.04 # latest
4751
strategy:
4852
fail-fast: false
4953
matrix:
5054
image:
5155
- alpine-3.16-x64
5256
steps:
53-
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
54-
- name: Build ${{ env.PACKAGE_NAME }}
55-
run: |
56-
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
57-
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
58-
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
59-
60-
61-
linux-musl-armv7:
62-
runs-on: ubuntu-20.04 # latest
63-
strategy:
64-
fail-fast: false
65-
matrix:
66-
image:
67-
- alpine-3.16-x64
68-
steps:
69-
- name: Install qemu/docker
70-
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
71-
- name: Checkout Sources
72-
uses: actions/checkout@v2
73-
with:
74-
submodules: true
75-
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
76-
- name: Build ${{ env.PACKAGE_NAME }}
77-
run: |
78-
export AWS_CRT_ARCH=armv7
79-
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
80-
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-alpine-3.16-armv7 build -p ${{ env.PACKAGE_NAME }}
81-
57+
- uses: aws-actions/configure-aws-credentials@v4
58+
with:
59+
role-to-assume: ${{ env.CRT_CI_ROLE }}
60+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
61+
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
62+
- name: Build ${{ env.PACKAGE_NAME }}
63+
run: |
64+
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
65+
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
8266
67+
linux-musl-armv8:
68+
runs-on: codebuild-aws-crt-nodejs-arm64-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large
69+
strategy:
70+
fail-fast: false
71+
steps:
72+
- uses: aws-actions/configure-aws-credentials@v4
73+
with:
74+
role-to-assume: ${{ env.CRT_CI_ROLE }}
75+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
76+
- name: Checkout Sources
77+
uses: actions/checkout@v4
78+
with:
79+
submodules: true
80+
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
81+
- name: Build ${{ env.PACKAGE_NAME }}
82+
run: |
83+
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
84+
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-alpine-3.16-arm64 build -p ${{ env.PACKAGE_NAME }}
8385
8486
linux-compiler-compat:
85-
runs-on: ubuntu-20.04 # latest
87+
runs-on: ubuntu-24.04 # latest
8688
strategy:
8789
fail-fast: false
8890
matrix:
@@ -93,14 +95,20 @@ jobs:
9395
clang-9,
9496
clang-10,
9597
clang-11,
98+
clang-15,
9699
gcc-4.8,
97100
gcc-5,
98101
gcc-6,
99102
gcc-7,
100-
gcc-8
103+
gcc-8,
104+
gcc-11
101105
]
102106
steps:
103-
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
107+
- uses: aws-actions/configure-aws-credentials@v4
108+
with:
109+
role-to-assume: ${{ env.CRT_CI_ROLE }}
110+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
111+
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
104112
- name: Build ${{ env.PACKAGE_NAME }}
105113
run: |
106114
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
@@ -109,6 +117,10 @@ jobs:
109117
windows:
110118
runs-on: windows-2022 # latest
111119
steps:
120+
- uses: aws-actions/configure-aws-credentials@v4
121+
with:
122+
role-to-assume: ${{ env.CRT_CI_ROLE }}
123+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
112124
- name: Build ${{ env.PACKAGE_NAME }} + consumers
113125
run: |
114126
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
@@ -117,6 +129,10 @@ jobs:
117129
windows-vc14-x86:
118130
runs-on: windows-2019 # windows-2019 is last env with Visual Studio 2015 (v14.0)
119131
steps:
132+
- uses: aws-actions/configure-aws-credentials@v4
133+
with:
134+
role-to-assume: ${{ env.CRT_CI_ROLE }}
135+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
120136
- name: Build ${{ env.PACKAGE_NAME }} + consumers
121137
env:
122138
AWS_CMAKE_TOOLSET: v140
@@ -132,6 +148,10 @@ jobs:
132148
macos:
133149
runs-on: macos-14 # latest
134150
steps:
151+
- uses: aws-actions/configure-aws-credentials@v4
152+
with:
153+
role-to-assume: ${{ env.CRT_CI_ROLE }}
154+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
135155
- name: Build ${{ env.PACKAGE_NAME }} + consumers
136156
run: |
137157
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
@@ -145,6 +165,10 @@ jobs:
145165
macos-x64:
146166
runs-on: macos-14-large # latest
147167
steps:
168+
- uses: aws-actions/configure-aws-credentials@v4
169+
with:
170+
role-to-assume: ${{ env.CRT_CI_ROLE }}
171+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
148172
- name: Build ${{ env.PACKAGE_NAME }} + consumers
149173
run: |
150174
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
@@ -165,19 +189,27 @@ jobs:
165189
166190
# check that docs can still build
167191
check-docs:
168-
runs-on: ubuntu-20.04 # latest
192+
runs-on: ubuntu-24.04 # latest
169193
steps:
170-
- uses: actions/checkout@v4
171-
with:
172-
submodules: true
173-
- name: Check docs
174-
run: |
175-
npm ci
176-
./make-docs.sh
194+
- uses: aws-actions/configure-aws-credentials@v4
195+
with:
196+
role-to-assume: ${{ env.CRT_CI_ROLE }}
197+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
198+
- uses: actions/checkout@v4
199+
with:
200+
submodules: true
201+
- name: Check docs
202+
run: |
203+
npm ci
204+
./make-docs.sh
177205
178206
check-submodules:
179-
runs-on: ubuntu-20.04 # latest
207+
runs-on: ubuntu-24.04 # latest
180208
steps:
209+
- uses: aws-actions/configure-aws-credentials@v4
210+
with:
211+
role-to-assume: ${{ env.CRT_CI_ROLE }}
212+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
181213
- name: Checkout Source
182214
uses: actions/checkout@v4
183215
with:
@@ -189,11 +221,15 @@ jobs:
189221
uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main
190222

191223
check-lockfile-version:
192-
runs-on: ubuntu-20.04 # latest
224+
runs-on: ubuntu-24.04 # latest
193225
steps:
194-
- uses: actions/checkout@v4
195-
with:
196-
fetch-depth: 0
197-
- name: Check for edits to package-lock.json
198-
run: |
199-
test `jq -r '.lockfileVersion' package-lock.json` = 1
226+
- uses: aws-actions/configure-aws-credentials@v4
227+
with:
228+
role-to-assume: ${{ env.CRT_CI_ROLE }}
229+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
230+
- uses: actions/checkout@v4
231+
with:
232+
fetch-depth: 0
233+
- name: Check for edits to package-lock.json
234+
run: |
235+
test `jq -r '.lockfileVersion' package-lock.json` = 1

.github/workflows/docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ on:
99

1010
jobs:
1111
update-docs-branch:
12-
runs-on: ubuntu-20.04 # latest
12+
runs-on: ubuntu-24.04 # latest
1313
permissions:
1414
contents: write # allow push
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
with:
1919
submodules: true
2020

CMakeLists.txt

+5-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.9)
1+
cmake_minimum_required(VERSION 3.9...3.31)
22
project(aws-crt-nodejs C)
33
option(BUILD_DEPS "Builds aws common runtime dependencies as part of build, only do this if you don't want to control your dependency chain." ON)
44

@@ -14,21 +14,7 @@ if (NOT CMAKE_BUILD_TYPE)
1414
set(CMAKE_BUILD_TYPE RelWithDebInfo)
1515
endif()
1616

17-
if (UNIX AND NOT APPLE)
18-
include(GNUInstallDirs)
19-
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
20-
set(CMAKE_INSTALL_LIBDIR "lib")
21-
endif()
22-
23-
if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
24-
set(FIND_LIBRARY_USE_LIB64_PATHS true)
25-
endif()
26-
27-
# This is required in order to append /lib/cmake to each element in CMAKE_PREFIX_PATH
28-
set(AWS_MODULE_DIR "/${CMAKE_INSTALL_LIBDIR}/cmake")
29-
string(REPLACE ";" "${AWS_MODULE_DIR};" AWS_MODULE_PATH "${CMAKE_PREFIX_PATH}${AWS_MODULE_DIR}")
30-
# Append that generated list to the module search path
31-
list(APPEND CMAKE_MODULE_PATH ${AWS_MODULE_PATH})
17+
include(GNUInstallDirs)
3218

3319
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/dist")
3420

@@ -76,12 +62,13 @@ if (BUILD_DEPS)
7662

7763
set(BUILD_TESTING ${BUILD_TESTING_PREV})
7864
else()
65+
# this is required so we can use aws-c-common's CMake modules
66+
find_package(aws-c-common REQUIRED)
67+
7968
include(AwsFindPackage)
8069
set(IN_SOURCE_BUILD OFF)
8170
endif()
8271

83-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
84-
8572
include(AwsCFlags)
8673
include(AwsSharedLibSetup)
8774
include(AwsSanitizers)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 0.2
2+
phases:
3+
install:
4+
commands:
5+
build:
6+
commands:
7+
- mkdir linux-arm64-musl
8+
- cd aws-crt-nodejs
9+
- ./continuous-delivery/generic-linux-build.sh aws-crt-alpine-3.16-arm64
10+
- cp -r dist/bin/linux-arm64-musl/* ../linux-arm64-musl/
11+
12+
post_build:
13+
commands:
14+
15+
artifacts:
16+
files:
17+
- 'linux-arm64-musl/**/*'
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
IMAGE_NAME=$1
6+
shift
7+
8+
# Pry the builder version this CRT is using out of ci.yml
9+
BUILDER_VERSION=$(cat .github/workflows/ci.yml | grep 'BUILDER_VERSION:' | sed 's/\s*BUILDER_VERSION:\s*\(.*\)/\1/')
10+
echo "Using builder version ${BUILDER_VERSION}"
11+
12+
aws ecr get-login-password | docker login 123124136734.dkr.ecr.us-east-1.amazonaws.com -u AWS --password-stdin
13+
export DOCKER_IMAGE=123124136734.dkr.ecr.us-east-1.amazonaws.com/${IMAGE_NAME}:${BUILDER_VERSION}
14+
15+
export BRANCH_TAG=$(git describe --tags)
16+
docker run --mount type=bind,src=$(pwd),dst=/root/aws-crt-nodejs --env CXXFLAGS $DOCKER_IMAGE --version=${BUILDER_VERSION} build -p aws-crt-nodejs --branch ${BRANCH_TAG} run_tests=false
17+
docker container prune -f

continuous-delivery/pack.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mkdir $UNZIP
3939
tar -xf aws-crt-$CURRENT_TAG.tgz -C $UNZIP
4040
PACK_FILE_SIZE_KB=$(du -sk $UNZIP | awk '{print $1}')
4141
echo "Current package size: ${PACK_FILE_SIZE_KB}"
42-
if expr $PACK_FILE_SIZE_KB \> "$((26000))" ; then
42+
if expr $PACK_FILE_SIZE_KB \> "$((33000))" ; then
4343
# the package size is too large, return -1
4444
echo "Package size is too large!"
4545
exit -1

crt/aws-lc

crt/s2n

Submodule s2n updated from ffe0bf4 to 21cefc1

0 commit comments

Comments
 (0)