Skip to content
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

Rust msrv 1.74 #3410

Merged
merged 8 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
required: false

env:
rust_version: 1.72.0
rust_version: 1.74.1
rust_toolchain_components: clippy,rustfmt
ENCRYPTED_DOCKER_PASSWORD: ${{ secrets.ENCRYPTED_DOCKER_PASSWORD }}
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claim-crate-names.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true

env:
rust_version: 1.72.1
rust_version: 1.74.1

name: Claim unpublished crate names on crates.io
run-name: ${{ github.workflow }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
name: Update GitHub Pages

env:
rust_version: 1.72.1
rust_version: 1.74.1

# Allow only one doc pages build to run at a time for the entire smithy-rs repo
concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true

env:
rust_version: 1.72.1
rust_version: 1.74.1

name: Release smithy-rs
run-name: ${{ inputs.dry_run && 'Dry run' || 'Prod run' }} - ${{ github.workflow }} ${{ inputs.stable_semantic_version }}/${{ inputs.unstable_semantic_version }} (${{ inputs.commit_sha }})
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-sdk-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.72.1
toolchain: 1.74.1
- name: Delete old SDK
run: |
- name: Generate a fresh SDK
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,16 @@
# message = "Fix typos in module documentation for generated crates"
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
# author = "rcoh"
# author = "rcoh"

[[smithy-rs]]
message = "The MSRV has been increase to 1.74.1"
references = ["smithy-rs#3410"]
meta = { "bug" = false, "breaking" = false, tada = false, target = "all" }
author = "rcoh"

[[aws-sdk-rust]]
message = "The MSRV has been increase to 1.74.1"
references = ["smithy-rs#3410"]
meta = { "bug" = false, "breaking" = false, tada = false }
author = "rcoh"
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ impl Builder {

fn validate_max_attempts(max_attempts: &str) -> Result<u32, RetryConfigError> {
match max_attempts.parse::<u32>() {
Ok(max_attempts) if max_attempts == 0 => {
Err(RetryConfigErrorKind::MaxAttemptsMustNotBeZero.into())
}
Ok(0) => Err(RetryConfigErrorKind::MaxAttemptsMustNotBeZero.into()),
Ok(max_attempts) => Ok(max_attempts),
Err(source) => Err(RetryConfigErrorKind::FailedToParseMaxAttempts { source }.into()),
}
Expand Down
4 changes: 0 additions & 4 deletions aws/rust-runtime/aws-sigv4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ serde_derive = "1.0.180"
serde_json = "1.0.104"
time = { version = "0.3.5", features = ["parsing"] }

# TODO(https://github.com/smithy-lang/smithy-rs/issues/3398): Remove clap dependency once the SDK MSRV is 1.74.
# Clap was added and pinned to 4.4.x because it is pulled in by criterion, and 4.5.x requires an MSRV of Rust 1.74.
# Since the SDK MSRV is 1.72, this causes it to fail to compile.
clap = "~4.4"
criterion = "0.5"

[target.'cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))'.dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-sigv4/src/event_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fn sign_payload<'a>(

// Generate the signed wrapper event frame
Ok(SigningOutput::new(
Message::new(message_payload.map(Bytes::from).unwrap_or_else(Bytes::new))
Message::new(message_payload.map(Bytes::from).unwrap_or_default())
.add_header(Header::new(
":chunk-signature",
HeaderValue::ByteArray(hex::decode(&signature).unwrap().into()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Compani
import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.smithyProtocolTestHelpers
import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.smithyRuntime
import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency.Companion.smithyRuntimeApiTestUtil
import software.amazon.smithy.rust.codegen.core.rustlang.CratesIo
import software.amazon.smithy.rust.codegen.core.rustlang.DependencyScope
import software.amazon.smithy.rust.codegen.core.rustlang.Writable
import software.amazon.smithy.rust.codegen.core.rustlang.writable
Expand Down Expand Up @@ -107,11 +106,6 @@ class IntegrationTestDependencies(
addDependency(TracingSubscriber)
}
if (hasBenches) {
// TODO(https://github.com/smithy-lang/smithy-rs/issues/3398): Remove clap dependency once the
// SDK MSRV is 1.74. Clap was added and pinned to 4.4.x because it is pulled in by criterion,
// and 4.5.x requires an MSRV of Rust 1.74. Since the SDK MSRV is 1.72, this causes it to fail
// to compile.
addDependency(CargoDependency("clap", CratesIo("~4.4"), DependencyScope.Dev))
addDependency(Criterion)
}
for (serviceSpecific in serviceSpecificCustomizations()) {
Expand Down
4 changes: 0 additions & 4 deletions aws/sdk/integration-tests/dynamodb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ tokio = { version = "1.23.1", features = ["full", "test-util"] }
tokio-stream = "0.1.5"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }

# TODO(https://github.com/smithy-lang/smithy-rs/issues/3398): Remove clap dependency once the SDK MSRV is 1.74.
# Clap was added and pinned to 4.4.x because it is pulled in by criterion, and 4.5.x requires an MSRV of Rust 1.74.
# Since the SDK MSRV is 1.72, this causes it to fail to compile.
clap = "~4.4"
criterion = "0.5"

[[bench]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class RequestBindingGenerator(
return when {
target.isStringShape -> {
val func = writer.format(RuntimeType.queryFormat(runtimeConfig, "fmt_string"))
"&$func(&$targetName)"
"&$func($targetName)"
}

target.isTimestampShape -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ private val allowedClippyLints =
"derive_partial_eq_without_eq",
// Keeping errors small in a backwards compatible way is challenging
"result_large_err",
// Difficult to avoid in generated code
"unnecessary_map_on_constructor",
)

private val allowedRustdocLints =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ object TestWorkspace {
// help rust select the right version when we run cargo test
// TODO(https://github.com/smithy-lang/smithy-rs/issues/2048): load this from the msrv property using a
// method as we do for runtime crate versions
"[toolchain]\nchannel = \"1.72.1\"\n",
"[toolchain]\nchannel = \"1.74.1\"\n",
)
// ensure there at least an empty lib.rs file to avoid broken crates
newProject.resolve("src").mkdirs()
Expand Down
5 changes: 1 addition & 4 deletions examples/pokemon-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ authors = ["Smithy-rs Server Team <smithy-rs-server@amazon.com>"]
description = "A smithy Rust service to retrieve information about Pokémon."

[dependencies]
# TODO(https://github.com/smithy-lang/smithy-rs/issues/3398): Unpin the clap dependency once the SDK MSRV is Rust 1.74.
# Clap was added and pinned to 4.4.x because 4.5.x requires an MSRV of Rust 1.74.
# Since the SDK MSRV is 1.72, this causes it to fail to compile.
clap = { version = "~4.4", features = ["derive"] }
clap = { version = "4", features = ["derive"] }
http = "0.2"
hyper = { version = "0.14.26", features = ["server"] }
tokio = "1.26.0"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

# Rust MSRV (entered into the generated README)
rust.msrv=1.72.1
rust.msrv=1.74.1

# To enable debug, swap out the two lines below.
# When changing this value, be sure to run `./gradlew --stop` to kill the Gradle daemon.
Expand Down
4 changes: 0 additions & 4 deletions rust-runtime/aws-smithy-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ tokio = { version = "1.23.1", features = [
tokio-stream = "0.1.5"
tempfile = "3.2.0"

# TODO(https://github.com/smithy-lang/smithy-rs/issues/3398): Remove clap dependency once the SDK MSRV is 1.74.
# Clap was added and pinned to 4.4.x because it is pulled in by criterion, and 4.5.x requires an MSRV of Rust 1.74.
# Since the SDK MSRV is 1.72, this causes it to fail to compile.
clap = "~4.4"
criterion = "0.5"

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.72.1"
channel = "1.74.1"
2 changes: 1 addition & 1 deletion tools/ci-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# This is the base Docker build image used by CI

ARG base_image=public.ecr.aws/amazonlinux/amazonlinux:2023
ARG rust_stable_version=1.72.1
ARG rust_stable_version=1.74.1
ARG rust_nightly_version=nightly-2023-10-10

FROM ${base_image} AS bare_base_image
Expand Down
4 changes: 2 additions & 2 deletions tools/ci-build/difftags/src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ fn write_line<W: Write>(mut w: W, line: &Line) -> Result<()> {
"<td class=\"lineno\"><pre>{:>5} {:>5} {}</pre></td>",
line.source_line_no
.map(|n| n.to_string())
.unwrap_or_else(|| "".to_string()),
.unwrap_or_default(),
line.target_line_no
.map(|n| n.to_string())
.unwrap_or_else(|| "".to_string()),
.unwrap_or_default(),
line.line_type
)?;
writeln!(
Expand Down
21 changes: 9 additions & 12 deletions tools/ci-build/smithy-rs-tool-common/src/release_tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,20 @@ impl fmt::Display for ReleaseTag {

impl Ord for ReleaseTag {
fn cmp(&self, other: &Self) -> Ordering {
self.partial_cmp(other)
.expect("Tag::partial_cmp never returns None")
match (self, other) {
(ReleaseTag::Date(_), ReleaseTag::Version(_)) => Ordering::Greater,
(ReleaseTag::Version(_), ReleaseTag::Date(_)) => Ordering::Less,
(ReleaseTag::Date(lhs), ReleaseTag::Date(rhs)) => {
lhs.date.cmp(&rhs.date).then(lhs.suffix.cmp(&rhs.suffix))
}
(ReleaseTag::Version(lhs), ReleaseTag::Version(rhs)) => lhs.version.cmp(&rhs.version),
}
}
}

impl PartialOrd for ReleaseTag {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
match (self, other) {
(ReleaseTag::Date(_), ReleaseTag::Version(_)) => Some(Ordering::Greater),
(ReleaseTag::Version(_), ReleaseTag::Date(_)) => Some(Ordering::Less),
(ReleaseTag::Date(lhs), ReleaseTag::Date(rhs)) => {
Some(lhs.date.cmp(&rhs.date).then(lhs.suffix.cmp(&rhs.suffix)))
}
(ReleaseTag::Version(lhs), ReleaseTag::Version(rhs)) => {
Some(lhs.version.cmp(&rhs.version))
}
}
Some(self.cmp(other))
}
}

Expand Down
Loading