Skip to content

feat: add --inf2cat-args passthrough to customize inf2cat options - #702

Draft
svasista-ms wants to merge 4 commits into
microsoft:mainfrom
svasista-ms:feature/inf2cat-os-versions
Draft

feat: add --inf2cat-args passthrough to customize inf2cat options#702
svasista-ms wants to merge 4 commits into
microsoft:mainfrom
svasista-ms:feature/inf2cat-os-versions

Conversation

@svasista-ms

@svasista-ms svasista-ms commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Adds a --inf2cat-args passthrough to cargo wdk build so users can customize the options forwarded to inf2cat (e.g. target OS versions) instead of being locked to the built-in defaults.

  • When provided, tokens are forwarded to inf2cat verbatim and replace the defaults.
  • When omitted or empty, cargo-wdk uses its defaults: /os: /uselocaltime.

NOTE: cargo-wdk always supplies /driver:; a user-supplied /driver: / /drv: switch is rejected at parse time, as are unterminated quotes.

Resolves #91

Screenshots

  1. Default Build / Empty inf2cat-args result in the same args being passed:
01-default-build 05-empty-fallback
  1. Custom OS Versions
02-custom-os-versions
  1. Invalid OS (Inf2cat fails)
03-invalid-os
  1. CLI Validation Errors
04-cli-validation

Copilot AI review requested due to automatic review settings July 13, 2026 04:49

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 new cargo wdk build CLI option (--inf2cat-args) to forward user-supplied arguments to inf2cat during catalog generation, threading those arguments through the build/package action pipeline and documenting the behavior.

Changes:

  • Added --inf2cat-args to the build CLI, including parsing/tokenization logic and unit tests.
  • Plumbed inf2cat_args through BuildActionParamsPackageTaskParams and updated inf2cat invocation to either use defaults or forward caller-provided switches.
  • Updated build/package tests and the cargo-wdk README to mention the new option.

Reviewed changes

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

Show a summary per file
File Description
crates/cargo-wdk/src/cli.rs Adds --inf2cat-args, tokenization parser, and CLI plumbing into BuildActionParams; adds unit tests.
crates/cargo-wdk/src/actions/build/mod.rs Adds inf2cat_args to build action params/state and forwards into packaging.
crates/cargo-wdk/src/actions/build/package_task.rs Stores forwarded inf2cat_args and changes inf2cat argument construction behavior; adds tests.
crates/cargo-wdk/src/actions/build/tests.rs Updates build action test initialization for the new parameter.
crates/cargo-wdk/README.md Documents the new CLI flag and describes inf2cat customization.

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

Comment thread crates/cargo-wdk/src/cli.rs Outdated
Comment thread crates/cargo-wdk/src/cli.rs Outdated
Comment thread crates/cargo-wdk/src/cli.rs Outdated
Comment thread crates/cargo-wdk/src/cli.rs Outdated
Comment thread crates/cargo-wdk/README.md Outdated
Comment thread crates/cargo-wdk/README.md Outdated
@codecov-commenter

codecov-commenter commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #702      +/-   ##
==========================================
+ Coverage   80.47%   81.14%   +0.66%     
==========================================
  Files          26       26              
  Lines        5722     5923     +201     
  Branches     5722     5923     +201     
==========================================
+ Hits         4605     4806     +201     
  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.

Copilot AI review requested due to automatic review settings July 14, 2026 04:52

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

Comment thread crates/cargo-wdk/src/actions/build/package_task.rs
Comment thread crates/cargo-wdk/README.md Outdated
Comment thread crates/cargo-wdk/src/cli.rs
docs: use better example for `inf2cat-args` usage
Copilot AI review requested due to automatic review settings July 14, 2026 12:00

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

…versions

# Conflicts:
#	crates/cargo-wdk/src/actions/build/mod.rs
#	crates/cargo-wdk/src/actions/build/package_task.rs
#	crates/cargo-wdk/src/cli.rs
Copilot AI review requested due to automatic review settings July 28, 2026 03: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 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread crates/cargo-wdk/src/cli.rs
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.

Add support for specifying specific OS'es to sign for in inf2cat task

3 participants