Skip to content

Commit 093b499

Browse files
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

18 files changed

+100
-41
lines changed

aws/rust-runtime/Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-runtime/Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-runtime/aws-smithy-async/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-smithy-async"
3-
version = "1.2.9"
3+
version = "1.2.10"
44
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "John DiSanti <jdisanti@amazon.com>"]
55
description = "Async runtime agnostic abstractions for smithy-rs."
66
edition = "2021"

rust-runtime/aws-smithy-checksums/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-smithy-checksums"
3-
version = "0.64.1"
3+
version = "0.64.2"
44
authors = [
55
"AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
66
"Zelda Hessler <zhessler@amazon.com>",

rust-runtime/aws-smithy-compression/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-smithy-compression"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = [
55
"AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
66
"Zelda Hessler <zhessler@amazon.com>",

rust-runtime/aws-smithy-dns/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-smithy-dns"
3-
version = "0.1.7"
3+
version = "0.1.8"
44
authors = [
55
"AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
66
]

rust-runtime/aws-smithy-eventstream/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "aws-smithy-eventstream"
33
# <IMPORTANT> Only patch releases can be made to this runtime crate until https://github.com/smithy-lang/smithy-rs/issues/3370 is resolved
4-
version = "0.60.16"
4+
version = "0.60.17"
55
# </IMPORTANT>
66
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "John DiSanti <jdisanti@amazon.com>"]
77
description = "Event stream logic for smithy-rs."

rust-runtime/aws-smithy-http-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "aws-smithy-http-client"
33
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
44
description = "HTTP client abstractions for generated smithy clients"
5-
version = "1.1.7"
5+
version = "1.1.8"
66
license = "Apache-2.0"
77
edition = "2021"
88
repository = "https://github.com/smithy-lang/smithy-rs"

rust-runtime/aws-smithy-http/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-smithy-http"
3-
version = "0.63.1"
3+
version = "0.63.2"
44
authors = [
55
"AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
66
"Russell Cohen <rcoh@amazon.com>",

rust-runtime/aws-smithy-json/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-smithy-json"
3-
version = "0.62.1"
3+
version = "0.62.2"
44
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "John DiSanti <jdisanti@amazon.com>"]
55
description = "Token streaming JSON parser for smithy-rs."
66
edition = "2021"

0 commit comments

Comments
 (0)