Skip to content

ci: add opt out env variable to temporarily prevent using build-dir v2 in nightly runs - #707

Merged
Alan632 merged 7 commits into
microsoft:mainfrom
Alan632:mitigate-cargo-build_dir_v2
Aug 4, 2026
Merged

ci: add opt out env variable to temporarily prevent using build-dir v2 in nightly runs#707
Alan632 merged 7 commits into
microsoft:mainfrom
Alan632:mitigate-cargo-build_dir_v2

Conversation

@Alan632

@Alan632 Alan632 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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-wdk can be updated to support the build-dir layout v2.

reference PR's:

info on the new build directory layout:

GitHub Issue Link: #709

@Alan632 Alan632 self-assigned this Jul 31, 2026
Copilot AI review requested due to automatic review settings July 31, 2026 21:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=1 at the workflow level for the test workflow.
  • Set __CARGO_TEMPORARY_BUILD_DIR_NEW_LAYOUT_OPT_OUT=1 at 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.

Comment thread .github/workflows/build.yaml Outdated
Comment thread .github/workflows/test.yaml Outdated
Copilot AI review requested due to automatic review settings July 31, 2026 21:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.47%. Comparing base (66223e9) to head (1c34c7e).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

gurry
gurry previously approved these changes Aug 1, 2026
Comment thread .github/workflows/build.yaml Outdated
Comment thread .github/workflows/build.yaml Outdated
Co-authored-by: Melvin Wang <melvin.mc.wang@gmail.com>
Signed-off-by: Alan632 <aln.noda7@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_LAYOUT does 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=1 as 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>
Copilot AI review requested due to automatic review settings August 3, 2026 17:04
Alan632 added 2 commits August 3, 2026 10:05
Signed-off-by: Alan632 <aln.noda7@gmail.com>
Signed-off-by: Alan632 <aln.noda7@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=1 as 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'

Copilot AI review requested due to automatic review settings August 3, 2026 17:08
wmmc88
wmmc88 previously approved these changes Aug 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@wmmc88 wmmc88 changed the title ci: add opt out env variable to prevent using build-dir v2 in nightly runs ci: add opt out env variable to temporarily prevent using build-dir v2 in nightly runs Aug 3, 2026
…e logic which selects which env vars to sanitize in the test workflow
Copilot AI review requested due to automatic review settings August 3, 2026 19:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@Alan632
Alan632 enabled auto-merge August 3, 2026 23:22
@Alan632
Alan632 added this pull request to the merge queue Aug 4, 2026
Merged via the queue into microsoft:main with commit 2d1f89b Aug 4, 2026
229 checks passed
@Alan632
Alan632 deleted the mitigate-cargo-build_dir_v2 branch August 4, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants