ci: add opt out env variable to temporarily prevent using build-dir v2 in nightly runs - #707
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a Cargo opt-out environment variable to the CI workflows to keep using the legacy (v1) temporary build directory layout, working around Rust nightly’s new build-dir layout v2 that currently breaks cargo-wdk tooling in this repository.
Changes:
- Set
__CARGO_TEMPORARY_BUILD_DIR_NEW_LAYOUT_OPT_OUT=1at the workflow level for the test workflow. - Set
__CARGO_TEMPORARY_BUILD_DIR_NEW_LAYOUT_OPT_OUT=1at the workflow level for the build workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/test.yaml | Adds the Cargo build-dir layout v2 opt-out env var for CI test runs. |
| .github/workflows/build.yaml | Adds the Cargo build-dir layout v2 opt-out env var for CI build runs (alongside existing RUSTFLAGS). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #707 +/- ##
=======================================
Coverage 80.47% 80.47%
=======================================
Files 26 26
Lines 5722 5722
Branches 5722 5722
=======================================
Hits 4605 4605
Misses 989 989
Partials 128 128 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Melvin Wang <melvin.mc.wang@gmail.com> Signed-off-by: Alan632 <aln.noda7@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/workflows/build.yaml:18
CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUTdoes not appear to be a Cargo-recognized env var for opting out of build-dir layout v2, so this likely has no effect and nightly builds may still use layout v2. Upstream Cargo uses__CARGO_TEMPORARY_BUILD_DIR_NEW_LAYOUT_OPT_OUT=1as the temporary opt-out flag.
env:
# TODO: Remove when cargo-wdk supports Cargo build-dir layout v2.
CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT: 'false'
Signed-off-by: Alan632 <aln.noda7@gmail.com>
Signed-off-by: Alan632 <aln.noda7@gmail.com>
Signed-off-by: Alan632 <aln.noda7@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/test.yaml:18
- The env var being set here (CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT) does not appear to be Cargo’s opt-out for the nightly-default build-dir layout v2. Cargo’s own implementation uses
__CARGO_TEMPORARY_BUILD_DIR_NEW_LAYOUT_OPT_OUT=1as the temporary opt-out, so this workflow may not actually prevent layout v2 from being used.
env:
# TODO: Remove when cargo-wdk supports Cargo build-dir layout v2 (see https://github.com/microsoft/windows-drivers-rs/issues/709).
CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT: 'false'
.github/workflows/build.yaml:21
- This sets
CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT, but Cargo’s nightly-default build-dir layout v2 opt-out is implemented via__CARGO_TEMPORARY_BUILD_DIR_NEW_LAYOUT_OPT_OUT=1. Using the temporary opt-out env var here is more likely to reliably force the legacy (v1) layout in nightly.
env:
# TODO: Remove when cargo-wdk supports Cargo build-dir layout v2 (see https://github.com/microsoft/windows-drivers-rs/issues/709).
CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT: 'false'
…e logic which selects which env vars to sanitize in the test workflow
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
crates/cargo-wdk/tests/test_utils/mod.rs:316
- The TODO references removal from
test.yaml, but this env var is also set in other workflows (e.g., build.yaml). To avoid the comment becoming misleading, consider wording it in terms of CI/workflows generally rather than a specific file name.
// TODO: Remove this whitelist once the env var is removed from test.yaml (see https://github.com/microsoft/windows-drivers-rs/issues/709)
Summary
The new build-dir v2 layout was added in Rust nightly by this pr rust-lang/rust#159857 which breaks tooling in our cargo-wdk and pipeline.
This PR sets the opt out environment variable in the build and test workflows to continue using the v1 build-dir layout until
cargo-wdkcan be updated to support the build-dir layout v2.reference PR's:
info on the new build directory layout:
GitHub Issue Link: #709