diff --git a/aws/sdk-adhoc-test/build.gradle.kts b/aws/sdk-adhoc-test/build.gradle.kts index c5459b1244..930ef5a0f5 100644 --- a/aws/sdk-adhoc-test/build.gradle.kts +++ b/aws/sdk-adhoc-test/build.gradle.kts @@ -29,6 +29,8 @@ configure { outputDirectory = layout.buildDirectory.dir(workingDirUnderBuildDir).get().asFile } +val checkedInSdkLockfile = rootProject.projectDir.resolve("aws/sdk/Cargo.lock") + dependencies { implementation(project(":aws:sdk-codegen")) implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion") @@ -83,9 +85,10 @@ val allCodegenTests = listOf( project.registerGenerateSmithyBuildTask(rootProject, pluginName, allCodegenTests) project.registerGenerateCargoWorkspaceTask(rootProject, pluginName, allCodegenTests, workingDirUnderBuildDir) project.registerGenerateCargoConfigTomlTask(layout.buildDirectory.dir(workingDirUnderBuildDir).get().asFile) +project.registerCopyCheckedInCargoLockfileTask(checkedInSdkLockfile, layout.buildDirectory.dir(workingDirUnderBuildDir).get().asFile) tasks["smithyBuild"].dependsOn("generateSmithyBuild") -tasks["assemble"].finalizedBy("generateCargoWorkspace") +tasks["assemble"].dependsOn("generateCargoWorkspace").finalizedBy("copyCheckedInCargoLockfile") project.registerModifyMtimeTask() project.registerCargoCommandsTasks(layout.buildDirectory.dir(workingDirUnderBuildDir).get().asFile) diff --git a/buildSrc/src/main/kotlin/CodegenTestCommon.kt b/buildSrc/src/main/kotlin/CodegenTestCommon.kt index 8e0fd36447..1ee6ee7972 100644 --- a/buildSrc/src/main/kotlin/CodegenTestCommon.kt +++ b/buildSrc/src/main/kotlin/CodegenTestCommon.kt @@ -4,6 +4,7 @@ */ import org.gradle.api.Project +import org.gradle.api.tasks.Copy import org.gradle.api.tasks.Exec import org.gradle.kotlin.dsl.extra import org.gradle.kotlin.dsl.register @@ -295,6 +296,17 @@ fun Project.registerGenerateCargoConfigTomlTask(outputDir: File) { } } +fun Project.registerCopyCheckedInCargoLockfileTask( + lockfile: File, + destinationDir: File, +) { + this.tasks.register("copyCheckedInCargoLockfile") { + description = "copy checked-in `Cargo.lock` to the destination directory" + from(lockfile) + into(destinationDir) + } +} + const val PREVIOUS_BUILD_HASHES_KEY = "previousBuildHashes" fun Project.registerModifyMtimeTask() { diff --git a/codegen-client-test/build.gradle.kts b/codegen-client-test/build.gradle.kts index d963166895..8dfb53e4b3 100644 --- a/codegen-client-test/build.gradle.kts +++ b/codegen-client-test/build.gradle.kts @@ -21,6 +21,8 @@ fun getSmithyRuntimeMode(): String = properties.get("smithy.runtime.mode") ?: "o val pluginName = "rust-client-codegen" val workingDirUnderBuildDir = "smithyprojections/codegen-client-test/" +val checkedInSmithyRuntimeLockfile = rootProject.projectDir.resolve("rust-runtime/Cargo.lock") + dependencies { implementation(project(":codegen-client")) implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion") @@ -124,11 +126,12 @@ val allCodegenTests = listOf( project.registerGenerateSmithyBuildTask(rootProject, pluginName, allCodegenTests) project.registerGenerateCargoWorkspaceTask(rootProject, pluginName, allCodegenTests, workingDirUnderBuildDir) project.registerGenerateCargoConfigTomlTask(layout.buildDirectory.dir(workingDirUnderBuildDir).get().asFile) +project.registerCopyCheckedInCargoLockfileTask(checkedInSmithyRuntimeLockfile, layout.buildDirectory.dir(workingDirUnderBuildDir).get().asFile) tasks["generateSmithyBuild"].inputs.property("smithy.runtime.mode", getSmithyRuntimeMode()) tasks["smithyBuild"].dependsOn("generateSmithyBuild") -tasks["assemble"].finalizedBy("generateCargoWorkspace") +tasks["assemble"].finalizedBy("generateCargoWorkspace", "copyCheckedInCargoLockfile") project.registerModifyMtimeTask() project.registerCargoCommandsTasks(layout.buildDirectory.dir(workingDirUnderBuildDir).get().asFile) diff --git a/tools/ci-cdk/canary-runner/src/build_bundle.rs b/tools/ci-cdk/canary-runner/src/build_bundle.rs index c4e5f172bb..d55f67a1d0 100644 --- a/tools/ci-cdk/canary-runner/src/build_bundle.rs +++ b/tools/ci-cdk/canary-runner/src/build_bundle.rs @@ -143,6 +143,11 @@ wit-bindgen = { version = "0.16.0", features = ["macros", "realloc"] } wasmtime = { version = "17.0.1", features = ["component-model"] } wasmtime-wasi = "17.0.1" wasmtime-wasi-http = "17.0.1" + +# TODO(MSRV): Version 1.4.0 uses `error_in_core` and is considered unstable library feature in our MSRV of 1.78.0. +# Remove this version constraint once we upgrade to a future MSRV that stabilizes `error_in_core`. +arbitrary = "=1.3.2" + "#; lazy_static! { @@ -599,6 +604,11 @@ wit-bindgen = { version = "0.16.0", features = ["macros", "realloc"] } wasmtime = { version = "17.0.1", features = ["component-model"] } wasmtime-wasi = "17.0.1" wasmtime-wasi-http = "17.0.1" + +# TODO(MSRV): Version 1.4.0 uses `error_in_core` and is considered unstable library feature in our MSRV of 1.78.0. +# Remove this version constraint once we upgrade to a future MSRV that stabilizes `error_in_core`. +arbitrary = "=1.3.2" + aws-config = { path = "some/sdk/path/aws-config", features = ["behavior-version-latest"] } aws-sdk-s3 = { path = "some/sdk/path/s3" } aws-sdk-ec2 = { path = "some/sdk/path/ec2" } @@ -657,6 +667,11 @@ wit-bindgen = { version = "0.16.0", features = ["macros", "realloc"] } wasmtime = { version = "17.0.1", features = ["component-model"] } wasmtime-wasi = "17.0.1" wasmtime-wasi-http = "17.0.1" + +# TODO(MSRV): Version 1.4.0 uses `error_in_core` and is considered unstable library feature in our MSRV of 1.78.0. +# Remove this version constraint once we upgrade to a future MSRV that stabilizes `error_in_core`. +arbitrary = "=1.3.2" + aws-config = { version = "0.46.0", features = ["behavior-version-latest"] } aws-sdk-s3 = { version = "0.20.0" } aws-sdk-ec2 = { version = "0.19.0" } diff --git a/tools/ci-scripts/check-semver-hazards b/tools/ci-scripts/check-semver-hazards index 88765f398b..9d5d66e187 100755 --- a/tools/ci-scripts/check-semver-hazards +++ b/tools/ci-scripts/check-semver-hazards @@ -24,6 +24,9 @@ runtime-versioner patch-runtime \ --sdk-path "$(pwd)/aws-sdk-rust" \ --smithy-rs-path "$(pwd)/smithy-rs" +echo -e "${C_YELLOW}# Copying the SDK lockfile to aws-sdk-rust...${C_RESET}" +cp "$(pwd)/smithy-rs/aws/sdk/Cargo.lock" "$(pwd)/aws-sdk-rust/" + echo -e "${C_YELLOW}# Testing SDK...${C_RESET}" for sdk in aws-sdk-rust/sdk/*; do if ls "$sdk/tests" | grep -v '^endpoint_tests\.rs$'; then diff --git a/tools/ci-scripts/codegen-diff/semver-checks.py b/tools/ci-scripts/codegen-diff/semver-checks.py index 07ad33346b..f8a55284cf 100755 --- a/tools/ci-scripts/codegen-diff/semver-checks.py +++ b/tools/ci-scripts/codegen-diff/semver-checks.py @@ -44,7 +44,6 @@ def main(skip_generation=False): elif get_cmd_status(f'git cat-file -e base:{sdk_directory}/{path}/Cargo.toml') != 0: eprint(f'skipping {path} because it does not exist in base') else: - get_cmd_output('cargo generate-lockfile', quiet=True) (_, out, _) = get_cmd_output('cargo pkgid', cwd=path, quiet=True) pkgid = parse_package_id(out) (status, out, err) = get_cmd_output(f'cargo semver-checks check-release '