windows-drivers-rs icon indicating copy to clipboard operation
windows-drivers-rs copied to clipboard

Fix: cargo wdk new now respects default VCS behavior

Open tw4 opened this issue 2 months ago • 3 comments

This pull request makes a small change to the arguments passed when running the cargo new command in the NewAction implementation. The --vcs none option has been removed, so the default version control system will now be used when creating new projects.

Changes

  • Removed the --vcs none argument from the cargo new command in NewAction::run_cargo_new, allowing Cargo to use its default version control system when initializing new projects.

Fixes #558

tw4 avatar Nov 12 '25 12:11 tw4

Thanks for the PR @tw4. Can you please also update the tests by adding this check for the .git folder:

assert!(tmp_dir.join(&driver_name).join(".git").is_dir());

right after this line: https://github.com/microsoft/windows-drivers-rs/blob/1716d4a5d34acc0fbb1e0a4effad57530aad4bae/crates/cargo-wdk/tests/new_command_test.rs#L147

gurry avatar Nov 13 '25 02:11 gurry

Thanks for the PR @tw4. Can you please also update the tests by adding this check for the .git folder:

assert!(tmp_dir.join(&driver_name).join(".git").is_dir());

right after this line:

https://github.com/microsoft/windows-drivers-rs/blob/1716d4a5d34acc0fbb1e0a4effad57530aad4bae/crates/cargo-wdk/tests/new_command_test.rs#L147

Hello, thank you very much for your response. I'll add it right away.

tw4 avatar Nov 13 '25 04:11 tw4

@tw4 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

tw4 avatar Nov 13 '25 04:11 tw4

Thanks for the PR @tw4. The changes LGTM. I tested the changes by creating new driver packages.

In case of standalone projects, the default VCS (git) was initialized as expected.

image

With workspaces, I tried two scenarios:

  1. VCS initialized at workspace root - Driver package added via cargo wdk new used the workspace's VCS.
image
  1. No VCS initialized at workspace root - Each Driver package added via cargo wdk new used separate VCSs (git). Without this fix, cargo wdk new would create new packages without VCS, which deviated from cargo new's behavior.
image

svasista-ms avatar Nov 18 '25 05:11 svasista-ms