diff --git a/buildSrc/src/main/kotlin/CodegenTestCommon.kt b/buildSrc/src/main/kotlin/CodegenTestCommon.kt index 2173c237a6..e42d7e5ed2 100644 --- a/buildSrc/src/main/kotlin/CodegenTestCommon.kt +++ b/buildSrc/src/main/kotlin/CodegenTestCommon.kt @@ -244,12 +244,14 @@ fun Project.registerCargoCommandsTasks( this.tasks.register(Cargo.CHECK.toString) { dependsOn(dependentTasks) workingDir(outputDir) + environment("RUSTFLAGS", "--cfg aws_sdk_unstable") commandLine("cargo", "check", "--lib", "--tests", "--benches", "--all-features") } this.tasks.register(Cargo.TEST.toString) { dependsOn(dependentTasks) workingDir(outputDir) + environment("RUSTFLAGS", "--cfg aws_sdk_unstable") commandLine("cargo", "test", "--all-features") } @@ -257,12 +259,14 @@ fun Project.registerCargoCommandsTasks( dependsOn(dependentTasks) workingDir(outputDir) environment("RUSTDOCFLAGS", defaultRustDocFlags) + environment("RUSTFLAGS", "--cfg aws_sdk_unstable") commandLine("cargo", "doc", "--no-deps", "--document-private-items") } this.tasks.register(Cargo.CLIPPY.toString) { dependsOn(dependentTasks) workingDir(outputDir) + environment("RUSTFLAGS", "--cfg aws_sdk_unstable") commandLine("cargo", "clippy") } } diff --git a/buildSrc/src/main/kotlin/RustBuildTool.kt b/buildSrc/src/main/kotlin/RustBuildTool.kt index 1e67995648..b8a1a15fb1 100644 --- a/buildSrc/src/main/kotlin/RustBuildTool.kt +++ b/buildSrc/src/main/kotlin/RustBuildTool.kt @@ -28,6 +28,7 @@ private fun runCli( } } .copyTo(action) + action.environment("RUSTFLAGS", "--cfg aws_sdk_unstable") action.execute() } }