Skip to content

feat: add manifest options support for cargo build invocations#656

Open
svasista-ms wants to merge 5 commits into
microsoft:mainfrom
svasista-ms:648-support-locked-option
Open

feat: add manifest options support for cargo build invocations#656
svasista-ms wants to merge 5 commits into
microsoft:mainfrom
svasista-ms:648-support-locked-option

Conversation

@svasista-ms
Copy link
Copy Markdown
Contributor

@svasista-ms svasista-ms commented May 12, 2026

This PR adds support for forwarding Cargo “manifest options” (--locked, --offline, --frozen) from cargo wdk build down to the underlying Cargo build invocations, improving reproducibility/offline support.

Resolves #648

Changes

  1. Introduces a ManifestOptions clap args struct and exposes it on the build CLI via #[command(flatten)] [1]
  2. Threads ManifestOptions through BuildAction/BuildTask and forwards flags to cargo metadata, cargo build and cargo rustc invocations in the build action. [2] [3] [4]
  3. Adds/updates unit tests and one system level test to validate the forwarding behavior. [5] [6]

Screenshots

  1. cargo wdk build --help showing Manifest Options:
image
  1. cargo wdk build --locked --sample on the /examples emulated workspace:
image

Copilot AI review requested due to automatic review settings May 12, 2026 09:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 support for forwarding Cargo “manifest options” (--locked, --offline, --frozen) from cargo wdk build down to the underlying Cargo build invocations, improving reproducibility/offline support.

Changes:

  • Introduces a ManifestOptions clap args struct and exposes it on the build CLI via #[command(flatten)].
  • Threads ManifestOptions through BuildAction/BuildTask and forwards flags to cargo build and cargo rustc.
  • Adds/updates unit tests to validate the forwarding behavior.

Reviewed changes

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

Show a summary per file
File Description
crates/cargo-wdk/src/cli.rs Adds flattened manifest-related CLI flags to the build subcommand and passes them into the build action.
crates/cargo-wdk/src/actions/mod.rs Defines ManifestOptions and a helper to convert the selected options into Cargo CLI args.
crates/cargo-wdk/src/actions/build/mod.rs Stores/propagates ManifestOptions within BuildAction and forwards them to cargo rustc target-probing.
crates/cargo-wdk/src/actions/build/build_task.rs Forwards ManifestOptions into the cargo build command args; adds focused tests for forwarding.
crates/cargo-wdk/src/actions/build/tests.rs Extends build action tests to cover manifest option forwarding in higher-level orchestration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/cargo-wdk/src/actions/mod.rs
Comment thread crates/cargo-wdk/src/actions/build/tests.rs
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 12, 2026

Codecov Report

❌ Patch coverage is 99.12281% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.85%. Comparing base (74b1da7) to head (b57d075).

Files with missing lines Patch % Lines
crates/cargo-wdk/src/actions/build/mod.rs 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #656      +/-   ##
==========================================
+ Coverage   79.45%   79.85%   +0.40%     
==========================================
  Files          26       26              
  Lines        5500     5610     +110     
  Branches     5500     5610     +110     
==========================================
+ Hits         4370     4480     +110     
  Misses       1001     1001              
  Partials      129      129              

☔ View full report in Codecov by Sentry.
📢 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.

Copilot AI review requested due to automatic review settings May 13, 2026 07:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread crates/cargo-wdk/src/providers/metadata.rs
Copilot AI review requested due to automatic review settings May 21, 2026 04:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 8 out of 8 changed files in this pull request and generated no new comments.

@svasista-ms svasista-ms marked this pull request as ready for review May 21, 2026 06:55
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.

Support --locked passthrough in cargo wdk

3 participants