Skip to content

Commit d694399

Browse files
authored
chore(dafny-rust): setup and test check-in polymorph rust code (commented out for now); fix windows tests (#688)
1 parent a0d261a commit d694399

File tree

6 files changed

+42
-35
lines changed

6 files changed

+42
-35
lines changed

.github/actions/polymorph_codegen/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ runs:
109109
run: |
110110
make polymorph_dotnet ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }}
111111
112+
# TODO: Uncomment when checking in polymorph_rust code
113+
# - name: Regenerate Rust code using smithy-dafny
114+
# working-directory: ./${{ inputs.library }}
115+
# shell: bash
116+
# run: |
117+
# make polymorph_rust ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }}
118+
112119
- name: Check regenerated code against commited code
113120
# Composite action inputs seem to not actually support booleans properly for some reason
114121
if: inputs.diff-generated-code == 'true'

.github/workflows/library_rust_tests.yml

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ on:
1414
default: false
1515
type: boolean
1616

17-
# env:
18-
# Used for Test Vectors
19-
# VECTORS_URL: https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip
20-
2117
jobs:
2218
testRust:
2319
strategy:
@@ -62,19 +58,12 @@ jobs:
6258
# TODO - uncomment this after Rust formatter works
6359
# - name: Rustfmt Check
6460
# uses: actions-rust-lang/rustfmt@v1
65-
61+
62+
# TODO: Use setup-dafny-actions with correct version when Dafny releases 4.8.2
6663
- name: Setup Dafny
67-
# TODO: Use setup-dafny-actions@v1.7.0 for Rust instead of rust-unsound branch
68-
# uses: dafny-lang/setup-dafny-action@v1.7.0
69-
# with:
70-
# dafny-version: ${{ inputs.dafny }}
71-
shell: bash
72-
run: |
73-
git clone https://github.com/dafny-lang/dafny.git --recurse-submodules
74-
cd dafny/
75-
make exe
76-
77-
echo $PWD/Scripts >> $GITHUB_PATH
64+
uses: dafny-lang/setup-dafny-action@v1.7.0
65+
with:
66+
dafny-version: nightly-latest
7867

7968
# TODO: Remove this after the formatting in Rust starts working
8069
- name: smithy-dafny Rust hacks
@@ -92,6 +81,9 @@ jobs:
9281
distribution: "corretto"
9382
java-version: "17"
9483

84+
- name: Setup NASM for Windows (aws-lc-sys)
85+
uses: ilammy/setup-nasm@v1
86+
9587
- name: Install Smithy-Dafny codegen dependencies
9688
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
9789

@@ -119,7 +111,7 @@ jobs:
119111
CORES=$(node -e 'console.log(os.cpus().length)')
120112
make transpile_rust TRANSPILE_TESTS_IN_RUST=1 CORES=$CORES
121113
122-
# Remove Rust hacks
114+
# Remove Rust hacks once Dafny fixes this
123115
- name: Update implementation_from_dafny.rs to add deps
124116
shell: bash
125117
working-directory: ./AwsEncryptionSDK/runtimes/rust/src
@@ -138,14 +130,6 @@ jobs:
138130
' implementation_from_dafny.rs
139131
fi
140132
141-
# - name: Compile MPL TestVectors implementation
142-
# shell: bash
143-
# working-directory: ./mpl/TestVectorsAwsCryptographicMaterialProviders
144-
# run: |
145-
# # This works because `node` is installed by default on GHA runners
146-
# CORES=$(node -e 'console.log(os.cpus().length)')
147-
# make transpile_rust CORES=$CORES
148-
149133
- name: Test Rust
150134
working-directory: ./AwsEncryptionSDK
151135
shell: bash
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
target
22
Cargo.lock
3+
src/implementation_from_dafny.rs
4+
client.rs
5+
src/client/
6+
conversions.rs
7+
src/conversions/
8+
deps.rs
9+
src/deps/
10+
error.rs
11+
src/error/
12+
operation.rs
13+
src/operation/
14+
standard_library_conversions.rs
15+
standard_library_externs.rs
16+
types.rs
17+
src/types/
18+
*.pem

AwsEncryptionSDK/runtimes/rust/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ readme = "README.md"
1616
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1717

1818
[dependencies]
19-
aws-config = "1.5.6"
20-
aws-lc-rs = "1.9.0"
21-
aws-lc-sys = "0.21.2"
22-
aws-sdk-dynamodb = "1.47.0"
23-
aws-sdk-kms = "1.44.0"
19+
aws-config = "1.5.9"
20+
aws-lc-rs = "1.10.0"
21+
aws-lc-sys = "0.22.0"
22+
aws-sdk-dynamodb = "1.51.0"
23+
aws-sdk-kms = "1.48.0"
2424
aws-smithy-runtime-api = {version = "1.7.2", features = ["client"] }
25-
aws-smithy-types = "1.2.6"
25+
aws-smithy-types = "1.2.8"
2626
chrono = "0.4.38"
2727
dafny_runtime = { path = "dafny_runtime_rust"}
2828
dashmap = "6.1.0"
2929
pem = "3.0.4"
3030
rand = "0.8.5"
31-
tokio = {version = "1.40.0", features = ["full"] }
32-
uuid = { version = "1.10.0", features = ["v4"] }
31+
tokio = {version = "1.41.0", features = ["full"] }
32+
uuid = { version = "1.11.0", features = ["v4"] }
3333

3434
[lib]
3535
path = "src/implementation_from_dafny.rs"

mpl

Submodule mpl updated from 4b7cc5f to 745d83a

smithy-dafny

0 commit comments

Comments
 (0)