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

Bump MSRV to 1.81.0 #3936

Merged
merged 15 commits into from
Dec 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 @@ -38,7 +38,7 @@ on:
required: false

env:
rust_version: 1.78.0
rust_version: 1.81.0
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.78.0
rust_version: 1.81.0

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.78.0
rust_version: 1.81.0

# 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.78.0
rust_version: 1.81.0

name: Release smithy-rs
on:
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.78.0
toolchain: 1.81.0
- name: Delete old SDK
run: |
- name: Generate a fresh SDK
Expand Down
6 changes: 3 additions & 3 deletions aws/rust-runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions aws/rust-runtime/aws-config/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion aws/rust-runtime/aws-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-config"
version = "1.5.10"
version = "1.5.11"
authors = [
"AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
"Russell Cohen <rcoh@amazon.com>",
Expand All @@ -19,6 +19,7 @@ default = ["client-hyper", "rustls", "rt-tokio", "credentials-process", "sso"]
rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-runtime/rt-tokio", "tokio/rt"]
rustls = ["aws-smithy-runtime/tls-rustls", "client-hyper"]
sso = ["dep:aws-sdk-sso", "dep:aws-sdk-ssooidc", "dep:ring", "dep:hex", "dep:zeroize", "aws-smithy-runtime-api/http-auth"]
test-util = ["aws-runtime/test-util"]

# deprecated: this feature does nothing
allow-compilation = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ mod test {
#[cfg(all(feature = "sso", not(windows)))]
make_test!(sso_no_token_file);

#[cfg(feature = "credentials-sso")]
#[cfg(feature = "sso")]
make_test!(e2e_fips_and_dual_stack_sso);

#[tokio::test]
Expand Down
10 changes: 5 additions & 5 deletions aws/rust-runtime/aws-config/src/ecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
//! URL to load credentials. The URL MUST satisfy one of the following three properties:
//! 1. The URL begins with `https`
//! 2. The URL refers to an allowed IP address. If a URL contains a domain name instead of an IP address,
//! a DNS lookup will be performed. ALL resolved IP addresses MUST refer to an allowed IP address, or
//! the credentials provider will return `CredentialsError::InvalidConfiguration`. Valid IP addresses are:
//! a DNS lookup will be performed. ALL resolved IP addresses MUST refer to an allowed IP address, or
//! the credentials provider will return `CredentialsError::InvalidConfiguration`. Valid IP addresses are:
//! a) Loopback interfaces
//! b) The [ECS Task Metadata V2](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v2.html)
//! address ie 169.254.170.2.
Expand Down Expand Up @@ -416,9 +416,9 @@ impl From<InvalidFullUriErrorKind> for InvalidFullUriError {
/// Either:
/// 1. The URL is uses `https`
/// 2. The URL refers to an allowed IP. If a URL contains a domain name instead of an IP address,
/// a DNS lookup will be performed. ALL resolved IP addresses MUST refer to an allowed IP, or
/// the credentials provider will return `CredentialsError::InvalidConfiguration`. Allowed IPs
/// are the loopback interfaces, and the known ECS/EKS container IPs.
/// a DNS lookup will be performed. ALL resolved IP addresses MUST refer to an allowed IP, or
/// the credentials provider will return `CredentialsError::InvalidConfiguration`. Allowed IPs
/// are the loopback interfaces, and the known ECS/EKS container IPs.
async fn validate_full_uri(
uri: &str,
dns: Option<SharedDnsResolver>,
Expand Down
6 changes: 3 additions & 3 deletions aws/rust-runtime/aws-config/src/imds/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn user_agent() -> AwsUserAgent {
/// ```
///
/// 2. The `AWS_EC2_METADATA_SERVICE_ENDPOINT` environment variable. Note: If this environment variable
/// is set, it MUST contain to a valid URI or client construction will fail.
/// is set, it MUST contain to a valid URI or client construction will fail.
///
/// 3. The `ec2_metadata_service_endpoint` field in `~/.aws/config`:
/// ```ini
Expand All @@ -113,10 +113,10 @@ fn user_agent() -> AwsUserAgent {
/// ```
///
/// 5. An [endpoint mode](EndpointMode) loaded from the `AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE` environment
/// variable. Valid values: `IPv4`, `IPv6`
/// variable. Valid values: `IPv4`, `IPv6`
///
/// 6. An [endpoint mode](EndpointMode) loaded from the `ec2_metadata_service_endpoint_mode` field in
/// `~/.aws/config`:
/// `~/.aws/config`:
/// ```ini
/// [default]
/// # ... other configuration
Expand Down
4 changes: 2 additions & 2 deletions aws/rust-runtime/aws-config/src/profile/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
//!
//! This module contains two sub modules:
//! - `repr` which contains an abstract representation of a provider chain and the logic to
//! build it from `~/.aws/credentials` and `~/.aws/config`.
//! build it from `~/.aws/credentials` and `~/.aws/config`.
//! - `exec` which contains a chain representation of providers to implement passing bootstrapped credentials
//! through a series of providers.
//! through a series of providers.

use crate::profile::cell::ErrorTakingOnceCell;
#[allow(deprecated)]
Expand Down
23 changes: 15 additions & 8 deletions aws/rust-runtime/aws-config/src/profile/credentials/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,16 @@ fn credential_process_from_profile(

#[cfg(test)]
mod tests {

#[cfg(feature = "test-util")]
use super::ProfileChain;
use crate::profile::credentials::repr::BaseProvider;
use crate::sensitive_command::CommandWithSensitiveArgs;
use serde::Deserialize;
#[cfg(feature = "test-util")]
use std::collections::HashMap;

#[cfg(feature = "test-utils")]
#[cfg(feature = "test-util")]
#[test]
fn run_test_cases() -> Result<(), Box<dyn std::error::Error>> {
let test_cases: Vec<TestCase> = serde_json::from_str(&std::fs::read_to_string(
Expand All @@ -487,14 +492,16 @@ mod tests {
Ok(())
}

#[cfg(feature = "test-utils")]
#[cfg(feature = "test-util")]
fn check(test_case: TestCase) {
use aws_runtime::profile::profile_set::ProfileSet;
crate::profile::credentials::repr::resolve_chain;
let source = ProfileSet::new(
use super::resolve_chain;
use aws_runtime::env_config::property::Properties;
use aws_runtime::env_config::section::EnvConfigSections;
let source = EnvConfigSections::new(
test_case.input.profiles,
test_case.input.selected_profile,
test_case.input.sso_sessions,
Properties::new(),
);
let actual = resolve_chain(&source);
let expected = test_case.output;
Expand All @@ -515,24 +522,24 @@ mod tests {
}
}

#[cfg(feature = "test-utils")]
#[derive(Deserialize)]
#[cfg(feature = "test-util")]
struct TestCase {
docs: String,
input: TestInput,
output: TestOutput,
}

#[cfg(feature = "test-utils")]
#[derive(Deserialize)]
#[cfg(feature = "test-util")]
struct TestInput {
profiles: HashMap<String, HashMap<String, String>>,
selected_profile: String,
#[serde(default)]
sso_sessions: HashMap<String, HashMap<String, String>>,
}

#[cfg(feature = "test-utils")]
#[cfg(feature = "test-util")]
fn to_test_output(profile_chain: ProfileChain<'_>) -> Vec<Provider> {
let mut output = vec![];
match profile_chain.base {
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/src/sso/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn cached_token_path(identifier: &str, home: &str) -> PathBuf {
let mut out = PathBuf::with_capacity(home.len() + "/.aws/sso/cache".len() + ".json".len() + 40);
out.push(home);
out.push(".aws/sso/cache");
out.push(&hex::encode(digest::digest(
out.push(hex::encode(digest::digest(
&digest::SHA1_FOR_LEGACY_USE_ONLY,
identifier.as_bytes(),
)));
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-runtime"
version = "1.5.0"
version = "1.5.1"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
description = "Runtime support code for the AWS SDK. This crate isn't intended to be used directly."
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-runtime/src/env_config/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Error for EnvConfigParseError {}
///
/// - Sub-properties looks like regular properties (`k=v`) that are nested within an existing property.
/// - Sub-properties must be validated for compatibility with other SDKs, but they are not actually
/// parsed into structured data.
/// parsed into structured data.
fn validate_subproperty(value: &str, location: Location) -> Result<(), EnvConfigParseError> {
if value.trim_matches(WHITESPACE).is_empty() {
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-runtime/src/env_config/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl EnvConfigSections {
/// Create a new Profile set directly from a HashMap
///
/// This method creates a ProfileSet directly from a hashmap with no normalization for test purposes.
#[cfg(test)]
#[cfg(any(test, feature = "test-util"))]
pub fn new(
profiles: HashMap<String, HashMap<String, String>>,
selected_profile: impl Into<Cow<'static, str>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ data class InfallibleEnumType(
"""
impl ::std::str::FromStr for ${context.enumName} {
type Err = ::std::convert::Infallible;

fn from_str(s: &str) -> #{Result}<Self, <Self as ::std::str::FromStr>::Err> {
#{Ok}(${context.enumName}::from(s))
}
Expand Down Expand Up @@ -162,7 +162,12 @@ data class InfallibleEnumType(

override fun additionalDocs(context: EnumGeneratorContext): Writable =
writable {
renderForwardCompatibilityNote(context.enumName, context.sortedMembers, UNKNOWN_VARIANT, UNKNOWN_VARIANT_VALUE)
renderForwardCompatibilityNote(
context.enumName,
context.sortedMembers,
UNKNOWN_VARIANT,
UNKNOWN_VARIANT_VALUE,
)
}

override fun additionalEnumMembers(context: EnumGeneratorContext): Writable =
Expand Down Expand Up @@ -269,6 +274,7 @@ data class InfallibleEnumType(
- It might inadvertently shadow other intended match arms.
""".trimIndent(),
)
docs("")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private fun RustWriter.docWithNote(
doc?.also { docs(escape(it)) }
note?.also {
// Add a blank line between the docs and the note to visually differentiate
doc?.also { write("///") }
write("///")
docs("_Note: ${it}_")
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#
# Rust MSRV (entered into the generated README)
rust.msrv=1.78.0
rust.msrv=1.81.0
# To enable debug, swap out the two lines below.
# When changing this value, be sure to run `./gradlew --stop` to kill the Gradle daemon.
# org.gradle.jvmargs=-Xmx1024M -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:5006
Expand Down
Loading
Loading