Skip to content

Conversation

DavidSouther
Copy link
Contributor

The project has a single main workspace, but this doesn't work for wasm or for lambda runtime. Rather than have those as one-offs, this refactor moves the cross-service, applications, and "other" pieces to dedicated top-level workspaces.

Closes #4996


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@DavidSouther
Copy link
Contributor Author

Copy link
Contributor

@lkdavies lkdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorial comments

The project has a single main workspace, but this doesn't work for wasm or for lambda runtime. Rather than have those as one-offs, this refactor moves the cross-service, applications, and "other" pieces to dedicated top-level workspaces.

Closes awsdocs#4996
@DavidSouther DavidSouther force-pushed the rust/refactor/workspaces branch from b25e7f1 to 011243b Compare June 30, 2023 05:55
Copy link
Contributor

@rlhagerm rlhagerm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one issue to fix that I found. But I also see a path in .doc_gen\readmes\config.py, does this need updating?:
'service_folder': 'rust_dev_preview/{{service["name"]}}',

@rlhagerm rlhagerm merged commit 4d63b1a into awsdocs:main Jun 30, 2023
github-merge-queue bot pushed a commit to smithy-lang/smithy-rs that referenced this pull request Jun 30, 2023
## Motivation and Context
When the WebAssembly SDK example was added some months ago, we changed
the build process to make each SDK example its own Cargo workspace. This
allowed the `.cargo/config.toml` that changed the compiler target to
work correctly. However, this has led to other issues: dependency
compilation is no longer shared between examples which greatly increases
the time it takes for that CI step to run, and now it is even running
out of disk space on the GitHub Actions runners.

This PR adds support for a new workspace layout where the
[`aws-doc-sdk-examples`](https://github.com/awsdocs/aws-doc-sdk-examples)
repo gets to decide how the workspaces are logically grouped. If a
`Cargo.toml` file exists at the example root, then the build system
assumes that the _old_ "one example, one workspace" layout should be
used. If there is no root `Cargo.toml`, then it assumes the new layout
should be used.

The `sdk-versioner` tool had to be adapted to support more complex
relative path resolution to make this work, and the `publisher
fix-manifests` subcommand had to be fixed to ignore workspace-only
`Cargo.toml` files.

The build system in this PR needs to work for both the old and new
examples layout so that the `sdk-sync` process will succeed. #2810 has
been filed to track removing the old example layout at a later date.


[aws-doc-sdk-examples#4997](awsdocs/aws-doc-sdk-examples#4997)
changes the workspace structure of the actual examples to the new one.

## Testing
- [x] Generated a full SDK with the old example layout, manually
examined the output, and spot checked that some examples compile
- [x] Generated a full SDK with the new example layout, manually
examined the output, and spot checked that some examples compile
- [x] Examples pass in CI with the old example layout
- [x] Examples pass in CI with the new example layout

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
@DavidSouther DavidSouther deleted the rust/refactor/workspaces branch September 11, 2023 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rust: Refactor to several workspaces.
4 participants