-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support multiple models/dependencies in Rust, within a single c…
…rate (#583) Modifies the polymorph code generation process for Rust to apply to all services in scope at once, to get around the fact that Dafny's Rust code generation (and hence smithy-dafny's as well) only supports a single crate at a time. The polymorph CLI now supports multiple `--namespace` options, and the makefile now requires a `MAIN_SERVICE_FOR_RUST` service name in order to still select a single primary service to generate at the top level of the crate. All other services are qualified under `deps::<service_name>`. This layout may be changed before GA but I assert it is better to merge this first in order to lock down progress in the CI. To implement this change, introduced a `MergedServicesGenerator` which instantiates a separate generator for each service. The individual generators were changed throughout to use the root path/module name for the given service. Also made several other improvements to support building the complete DB ESDK dependency graph: * Fixed several bugs in the handling of `@positional` (testing followup tracked in #599) * Handled the Smithy `Unit` type properly (testing followup tracked in #602) * Properly handled introducing a single top-level error type for SDK wrappers, and wrapping errors from dependent services. * Miscellaneous bug fixes exposed by the DB ESDK source. * Deleted generated source for several test models to avoid review noise (and CI sensitivity to non-deterministic code generation)
- Loading branch information
Showing
300 changed files
with
2,528 additions
and
11,147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
name = "dependencies" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[features] | ||
wrapped-client = [] | ||
|
||
[dependencies] | ||
aws-smithy-runtime-api = {version = "1.7.0", features = ["client"] } | ||
aws-smithy-types = "1.2.0" | ||
dafny_runtime = { path = "../../../dafny-dependencies/dafny_runtime_rust"} | ||
|
||
[dev-dependencies] | ||
dependencies = { path = ".", features = ["wrapped-client"] } | ||
|
||
[dependencies.tokio] | ||
version = "1.26.0" | ||
features = ["full"] | ||
|
||
[lib] | ||
path = "src/implementation_from_dafny.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/runtimes/rust/src/conversions/client.rs → ...geSpecificLogic/runtimes/rust/src/deps.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. | ||
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
name = "multiple_models" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[features] | ||
wrapped-client = [] | ||
|
||
[dependencies] | ||
aws-smithy-runtime-api = {version = "1.7.0", features = ["client"] } | ||
aws-smithy-types = "1.2.0" | ||
dafny_runtime = { path = "../../../dafny-dependencies/dafny_runtime_rust"} | ||
|
||
[dev-dependencies] | ||
multiple_models = { path = ".", features = ["wrapped-client"] } | ||
|
||
[dependencies.tokio] | ||
version = "1.26.0" | ||
features = ["full"] | ||
|
||
[lib] | ||
path = "src/implementation_from_dafny.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
TestModels/Positional/runtimes/rust/src/client/get_resource.rs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.