-
Notifications
You must be signed in to change notification settings - Fork 210
Check direct rust-runtime dependency minimum versions #3980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check direct rust-runtime dependency minimum versions #3980
Conversation
lambda_http = { version = "0.8.0" } | ||
lambda_http = { version = "0.8.3" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lambda_http
was the only dependency that wasn't bumped as a result of the cargo update failure mentioned in the PR description. Rather, 0.8.0 failed to build:
lambda_http failure
Checking lambda_http v0.8.0
error[E0425]: cannot find function `run_with_streaming_response` in crate `lambda_runtime`
--> /Users/vclarksa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lambda_http-0.8.0/src/streaming.rs:33:21
|
33 | lambda_runtime::run_with_streaming_response(svc).await
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `lambda_runtime`
|
help: consider importing this function through its public re-export
|
1 + use crate::run_with_streaming_response;
|
help: if you import `run_with_streaming_response`, refer to it directly
|
33 - lambda_runtime::run_with_streaming_response(svc).await
33 + run_with_streaming_response(svc).await
|
For more information about this error, try rustc --explain E0425
.
error: could not compile lambda_http
(lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: process didn't exit successfully: /Users/vclarksa/.rustup/toolchains/1.81.0-x86_64-apple-darwin/bin/cargo check --manifest-path aws-smithy-http-server-python/Cargo.toml
(exit status: 101)
error: process didn't exit successfully: /Users/vclarksa/.rustup/toolchains/1.81.0-x86_64-apple-darwin/bin/cargo hack check
(exit status: 1)
This was fixed in awslabs/aws-lambda-rust-runtime#723, and released in 0.8.3.
version = "0.0.2" | ||
version = "0.0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package versions were bumped per check-rust-runtime for crates that were not already bumped as a result of the hyper1 branch changes.
aws/rust-runtime/Cargo.lock
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generated the cargo lock files in 1bcf198 before bumping the dependency minimum versions in 92dffbd. I generated the cargo lock files again afterwards, but no updates were made. The only cargo lock file changes made as a result of this PR are due to bumping the rust-runtime package versions. See aa28228 and 5e2cf48.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for working through the frustration here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes.
Motivation and Context
The smithy-rs minimal-versions test currently checks all transitive dependencies, which makes it difficult to satisfy the test requirements given that the minimum dependency versions specified in transitive dependencies can't be controlled. This PR updates this test to only check for direct dependencies.
Description
The smithy-rs CI runs the cargo minimal-versions test in the rust-runtime and aws/rust-runtime workspaces to make sure that the rust-runtime crates can still build even when the lowest possible version of each dependency is used. However, the minimal-versions test is not recommended by Rust:
direct-minimal-versions
can be used instead, which tests the minimum versions of only direct dependencies. This PR updates this test to use thedirect
variant of minimal-versions.Dependency minimum version changes
For some reason, the direct minimal-versions check seems to be more strict about direct minimum versions than the transitive variant. Switching to the direct variant caused many cargo update issues like the following:
Cargo update failure example
It seems that direct-minimal-versions requires that all direct dependencies within an environment be specified with the same minimum version. Additionally, if there is a direct dependency that is also specified by a transitive dependency, the direct dependency must specify a minimum version at least as high as the transitive dependency.
I resolved all such cargo update failures by choosing the highest minimum version specified somewhere in the environment, and applying this version everywhere the dependency is specified.
Testing
The modified
check-rust-runtimes
test should succeed.Some of the CI jobs are still failing. However, they appear to be unrelated to this change. These jobs also failed in the last hyper1 commit:
Also, the canary will need to be run manually if necessary for this change.
Checklist
.changelog
directory, specifying "client," "server," or both in theapplies_to
key..changelog
directory, specifying "aws-sdk-rust" in theapplies_to
key.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.