Commit 093b499
authored
Update sdk-versioner to properly find underlying crate name when depdendency has an alias (#4509)
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
We recently experienced some failing [smithy-rs releases
](https://github.com/smithy-lang/smithy-rs/actions/runs/21495302587/job/61935829887),
the logs for which look like:
```
2026-01-29T22:59:56.566904Z INFO publisher::cargo::publish: cargo publish failed for aws-smithy-legacy-http-server-0.65.11
Stdout:
Stderr:
\x1b[1m\x1b[32m Updating\x1b[0m crates.io index
\x1b[1m\x1b[32m Packaging\x1b[0m aws-smithy-legacy-http-server v0.65.11 (/home/runner/work/smithy-rs/smithy-rs/smithy-rs-release/crates-to-publish/aws-smithy-legacy-http-server)
\x1b[1m\x1b[32m Updating\x1b[0m crates.io index
\x1b[1m\x1b[31merror\x1b[0m\x1b[1m:\x1b[0m failed to prepare local package for uploading
Caused by:
failed to select a version for the requirement `aws-smithy-legacy-http = "^0.63.1"`
candidate versions found which didn't match: 0.62.8, 0.62.7, 0.62.6
location searched: crates.io index
required by package `aws-smithy-legacy-http-server v0.65.11 (/home/runner/work/smithy-rs/smithy-rs/smithy-rs-release/crates-to-publish/aws-smithy-legacy-http-server)`
2026-01-29T23:00:56.745127Z INFO pub
```
This is odd because the version of `aws-smithy-legacy-http` in main is:
```toml
[package]
name = "aws-smithy-legacy-http"
version = "0.62.8"
```
Looking at the Cargo.toml of `aws-smithy-legacy-http-server` it has this
entry:
```toml
aws-smithy-http = { path = "../aws-smithy-legacy-http", features = ["rt-tokio"], package = "aws-smithy-legacy-http" }
```
And that points us to the actual issue. The current version of
`aws-smithy-http` is:
```toml
[package]
name = "aws-smithy-http"
version = "0.63.1"
```
And that `0.63.1` is what we were seeing injected into
`aws-smithy-legacy-http-server` as the incorrect version for
`aws-smithy-legacy-http`.
When a dependency had an alias (ex: `alias = {package =
"the-real-package"}`) our `sdk-versioner` tooling was accepting that
alias as the real crate name. When that alias happened to be name of
another valid SDK crate this led to it inserting the incorrect version
number in the generated Cargol.toml. We hadn't encountered this
previously because:
* We only recently published a crate that aliased an `aws-smithy-*`
crate
* Prior to this release the version of the alias crate and the
underlying crate were both the same so, by chance, the replacement
worked
## Description
<!--- Describe your changes in detail -->
This change adds a new `extract_real_crate_name` function to the
`sdk-versioner` that pulls out the underlying crate name if a dependency
has an alias. This real name is then used for all subsequent steps.
Note: I also bumped the dependencies that were already published as part
of the failed release to get around the audit failure which would block
another release attempt
## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
Added a new test to confirm that this behavior works as expected. Also
ran `sdk-versioner` on a local build of the SDK that included
`aws-smithy-legacy-http-server` and it generated the expected dependency
version:
```toml
aws-smithy-http= { version = "0.62.8", package = "aws-smithy-legacy-http", features = ["rt-tokio"] }
```
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._1 parent e52b425 commit 093b499
File tree
18 files changed
+100
-41
lines changed- aws/rust-runtime
- rust-runtime
- aws-smithy-async
- aws-smithy-checksums
- aws-smithy-compression
- aws-smithy-dns
- aws-smithy-eventstream
- aws-smithy-http-client
- aws-smithy-http
- aws-smithy-json
- aws-smithy-legacy-http
- aws-smithy-observability-otel
- aws-smithy-observability
- aws-smithy-protocol-test
- aws-smithy-query
- aws-smithy-runtime-api
- aws-smithy-types
- tools/ci-build/sdk-versioner/src
18 files changed
+100
-41
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments