Skip to content

Commit 8ff37a7

Browse files
author
Shubham Chaturvedi
committed
Merge branch 'mainline' into Golang/dev
2 parents 0836d44 + 735f08c commit 8ff37a7

File tree

1,680 files changed

+205495
-387
lines changed

Some content is hidden

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

1,680 files changed

+205495
-387
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: ".github/workflows"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "cargo"
8+
directory: "AwsEncryptionSDK/runtimes/rust"
9+
schedule:
10+
interval: "daily"

.github/workflows/daily_ci.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
1212
uses: ./.github/workflows/library_codegen.yml
1313
with:
14-
dafny: '4.8.1'
14+
dafny: '4.9.0'
1515
daily-ci-verification:
1616
# Don't run the cron builds on forks
1717
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
1818
uses: ./.github/workflows/library_dafny_verification.yml
1919
with:
20-
dafny: '4.8.1'
20+
dafny: '4.9.0'
2121
# daily-ci-java:
2222
# if: github.event_name != 'schedule' || github.repository_owner == 'aws'
2323
# uses: ./.github/workflows/library_java_tests.yml
@@ -27,15 +27,27 @@ jobs:
2727
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
2828
uses: ./.github/workflows/library_net_tests.yml
2929
with:
30-
dafny: '4.8.1'
30+
dafny: '4.9.0'
3131
daily-ci-rust:
3232
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
3333
uses: ./.github/workflows/library_rust_tests.yml
3434
with:
35-
dafny: '4.8.1'
35+
dafny: '4.9.0'
3636

3737
daily-ci-interop-tests:
3838
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
3939
uses: ./.github/workflows/library_interop_tests.yml
4040
with:
41-
dafny: '4.8.1'
41+
dafny: '4.9.0'
42+
43+
daily-dafny-test-vectors:
44+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
45+
uses: ./.github/workflows/library_interop_test_vectors.yml
46+
with:
47+
dafny: '4.9.0'
48+
49+
daily-dafny-legacy-test-vectors:
50+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
51+
uses: ./.github/workflows/library_legacy_interop_test_vectors.yml
52+
with:
53+
dafny: '4.9.0'

.github/workflows/library_interop_test_vectors.yml

Lines changed: 107 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
ubuntu-latest,
2626
macos-13,
2727
]
28-
language: [java, net]
28+
language: [java, net, rust]
2929
# https://taskei.amazon.dev/tasks/CrypTool-5284
3030
dotnet-version: ["6.0.x"]
3131
runs-on: ${{ matrix.os }}
@@ -38,6 +38,14 @@ jobs:
3838
run: |
3939
git config --global core.longpaths true
4040
41+
# TestVectors will call KMS
42+
- name: Configure AWS Credentials
43+
uses: aws-actions/configure-aws-credentials@v2
44+
with:
45+
aws-region: us-west-2
46+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
47+
role-session-name: InterOpTests
48+
4149
- uses: actions/checkout@v3
4250
# Not all submodules are needed.
4351
# We manually pull the submodule we DO need.
@@ -51,15 +59,40 @@ jobs:
5159
with:
5260
dotnet-version: ${{ matrix.dotnet-version }}
5361

62+
# Setup Java in Rust is needed for running polymorph
5463
- name: Setup Java 17
55-
if: matrix.language == 'java'
64+
if: matrix.language == 'java' || matrix.language == 'rust'
5665
uses: actions/setup-java@v3
5766
with:
5867
distribution: "corretto"
5968
java-version: 17
6069

70+
- name: Setup Rust Toolchain for GitHub CI
71+
if: matrix.language == 'rust'
72+
uses: actions-rust-lang/[email protected]
73+
with:
74+
components: rustfmt
75+
# TODO - uncomment this after Rust formatter works
76+
# - name: Rustfmt Check
77+
# uses: actions-rust-lang/rustfmt@v1
78+
79+
# TODO: Remove this after the formatting in Rust starts working
80+
- name: smithy-dafny Rust hacks
81+
if: matrix.language == 'rust'
82+
shell: bash
83+
run: |
84+
if [ "$RUNNER_OS" == "macOS" ]; then
85+
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
86+
else
87+
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
88+
fi
89+
90+
- name: Setup NASM for Windows in Rust (aws-lc-sys)
91+
if: matrix.language == 'rust' && matrix.os == 'windows-latest'
92+
uses: ilammy/setup-nasm@v1
93+
6194
- name: Setup Dafny
62-
uses: dafny-lang/setup-dafny-action@v1.6.1
95+
uses: dafny-lang/setup-dafny-action@v1.7.0
6396
with:
6497
dafny-version: ${{ inputs.dafny }}
6598

@@ -89,21 +122,33 @@ jobs:
89122
# This works because `node` is installed by default on GHA runners
90123
CORES=$(node -e 'console.log(os.cpus().length)')
91124
make transpile_net
92-
125+
126+
- name: Install Smithy-Dafny codegen dependencies
127+
if: matrix.language == 'rust'
128+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
129+
130+
# TODO: Remove this after checking in Rust polymorph code
131+
- name: Run make polymorph_rust
132+
if: matrix.language == 'rust'
133+
shell: bash
134+
working-directory: ./${{ matrix.library }}
135+
run: |
136+
make polymorph_rust
137+
138+
- name: Build ${{ matrix.library }} implementation in Rust
139+
if: matrix.language == 'rust'
140+
shell: bash
141+
working-directory: ./${{ matrix.library }}
142+
run: |
143+
CORES=$(node -e 'console.log(os.cpus().length)')
144+
make transpile_rust CORES=$CORES
145+
93146
- name: Setup gradle
94147
if: matrix.language == 'java'
95148
uses: gradle/gradle-build-action@v2
96149
with:
97150
gradle-version: 7.2
98151

99-
# TestVectors will call KMS
100-
- name: Configure AWS Credentials
101-
uses: aws-actions/configure-aws-credentials@v2
102-
with:
103-
aws-region: us-west-2
104-
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
105-
role-session-name: InterOpTests
106-
107152
- name: Create Manifests
108153
working-directory: ./${{ matrix.library }}
109154
run: make test_generate_vectors_${{ matrix.language }}
@@ -132,8 +177,8 @@ jobs:
132177
ubuntu-latest,
133178
macos-13,
134179
]
135-
encrypting_language: [java, net]
136-
decrypting_language: [java, net]
180+
encrypting_language: [java, net, rust]
181+
decrypting_language: [java, net, rust]
137182
# https://taskei.amazon.dev/tasks/CrypTool-5284
138183
dotnet-version: ["6.0.x"]
139184
runs-on: ${{ matrix.os }}
@@ -145,6 +190,7 @@ jobs:
145190
- name: Support longpaths on Git checkout
146191
run: |
147192
git config --global core.longpaths true
193+
148194
# TestVectors will call KMS
149195
- name: Configure AWS Credentials
150196
uses: aws-actions/configure-aws-credentials@v2
@@ -159,19 +205,45 @@ jobs:
159205
- run: git submodule update --init libraries
160206
- run: git submodule update --init --recursive mpl
161207

208+
# Set up runtimes
162209
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
163210
if: matrix.decrypting_language == 'net'
164211
uses: actions/setup-dotnet@v3
165212
with:
166213
dotnet-version: ${{ matrix.dotnet-version }}
167214

215+
# Setup Java in Rust is needed for running polymorph
168216
- name: Setup Java 17
169-
if: matrix.decrypting_language == 'java'
217+
if: matrix.decrypting_language == 'java' || matrix.decrypting_language == 'rust'
170218
uses: actions/setup-java@v3
171219
with:
172220
distribution: "corretto"
173221
java-version: 17
174222

223+
- name: Setup Rust Toolchain for GitHub CI
224+
if: matrix.decrypting_language == 'rust'
225+
uses: actions-rust-lang/[email protected]
226+
with:
227+
components: rustfmt
228+
# TODO - uncomment this after Rust formatter works
229+
# - name: Rustfmt Check
230+
# uses: actions-rust-lang/rustfmt@v1
231+
232+
# TODO: Remove this after the formatting in Rust starts working
233+
- name: smithy-dafny Rust hacks
234+
if: matrix.decrypting_language == 'rust'
235+
shell: bash
236+
run: |
237+
if [ "$RUNNER_OS" == "macOS" ]; then
238+
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
239+
else
240+
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
241+
fi
242+
243+
- name: Setup NASM for Windows in Rust (aws-lc-sys)
244+
if: matrix.decrypting_language == 'rust' && matrix.os == 'windows-latest'
245+
uses: ilammy/setup-nasm@v1
246+
175247
- name: Setup Dafny
176248
uses: dafny-lang/[email protected]
177249
with:
@@ -204,6 +276,26 @@ jobs:
204276
CORES=$(node -e 'console.log(os.cpus().length)')
205277
make transpile_net
206278
279+
- name: Install Smithy-Dafny codegen dependencies
280+
if: matrix.decrypting_language == 'rust'
281+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
282+
283+
# TODO: Remove this after checking in Rust polymorph code
284+
- name: Run make polymorph_rust
285+
if: matrix.decrypting_language == 'rust'
286+
shell: bash
287+
working-directory: ./${{ matrix.library }}
288+
run: |
289+
make polymorph_rust
290+
291+
- name: Build ${{ matrix.library }} implementation in Rust
292+
if: matrix.decrypting_language == 'rust'
293+
shell: bash
294+
working-directory: ./${{ matrix.library }}
295+
run: |
296+
CORES=$(node -e 'console.log(os.cpus().length)')
297+
make transpile_rust CORES=$CORES
298+
207299
- name: Download Encrypt Manifest Artifact
208300
uses: actions/download-artifact@v4
209301
with:

0 commit comments

Comments
 (0)