Skip to content

Commit

Permalink
Add RUSTFLAGS = aws_sdk_unstable as environment variable when runni…
Browse files Browse the repository at this point in the history
…ng 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.*
  • Loading branch information
thomas-k-cameron authored Apr 26, 2023
1 parent bc4c186 commit 9f10be0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions buildSrc/src/main/kotlin/CodegenTestCommon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -244,25 +244,29 @@ fun Project.registerCargoCommandsTasks(
this.tasks.register<Exec>(Cargo.CHECK.toString) {
dependsOn(dependentTasks)
workingDir(outputDir)
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
commandLine("cargo", "check", "--lib", "--tests", "--benches", "--all-features")
}

this.tasks.register<Exec>(Cargo.TEST.toString) {
dependsOn(dependentTasks)
workingDir(outputDir)
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
commandLine("cargo", "test", "--all-features")
}

this.tasks.register<Exec>(Cargo.DOCS.toString) {
dependsOn(dependentTasks)
workingDir(outputDir)
environment("RUSTDOCFLAGS", defaultRustDocFlags)
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
commandLine("cargo", "doc", "--no-deps", "--document-private-items")
}

this.tasks.register<Exec>(Cargo.CLIPPY.toString) {
dependsOn(dependentTasks)
workingDir(outputDir)
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
commandLine("cargo", "clippy")
}
}
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/RustBuildTool.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ private fun runCli(
}
}
.copyTo(action)
action.environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
action.execute()
}
}
Expand Down

0 comments on commit 9f10be0

Please sign in to comment.