Skip to content

Commit 9f10be0

Browse files
Add RUSTFLAGS = aws_sdk_unstable as environment variable when running Cargo from kotlin (#2614)
## Motivation and Context This PR set `aws_sdk_unstable` to RUSTFALGS when running cargo from kotlin. It is required to enable test gated features introduced on RFC30. No breaking changers are introduced. ## Description add `RUSTFLAGS = aws_sdk_unstable` when running cargo from kotlin. ## Parent PR This PR is listed as one of prerequisite PRs on this PR. - #2615 ## Testing NA. ---- *By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.*
1 parent bc4c186 commit 9f10be0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

buildSrc/src/main/kotlin/CodegenTestCommon.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,25 +244,29 @@ fun Project.registerCargoCommandsTasks(
244244
this.tasks.register<Exec>(Cargo.CHECK.toString) {
245245
dependsOn(dependentTasks)
246246
workingDir(outputDir)
247+
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
247248
commandLine("cargo", "check", "--lib", "--tests", "--benches", "--all-features")
248249
}
249250

250251
this.tasks.register<Exec>(Cargo.TEST.toString) {
251252
dependsOn(dependentTasks)
252253
workingDir(outputDir)
254+
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
253255
commandLine("cargo", "test", "--all-features")
254256
}
255257

256258
this.tasks.register<Exec>(Cargo.DOCS.toString) {
257259
dependsOn(dependentTasks)
258260
workingDir(outputDir)
259261
environment("RUSTDOCFLAGS", defaultRustDocFlags)
262+
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
260263
commandLine("cargo", "doc", "--no-deps", "--document-private-items")
261264
}
262265

263266
this.tasks.register<Exec>(Cargo.CLIPPY.toString) {
264267
dependsOn(dependentTasks)
265268
workingDir(outputDir)
269+
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
266270
commandLine("cargo", "clippy")
267271
}
268272
}

buildSrc/src/main/kotlin/RustBuildTool.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ private fun runCli(
2828
}
2929
}
3030
.copyTo(action)
31+
action.environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
3132
action.execute()
3233
}
3334
}

0 commit comments

Comments
 (0)