Skip to content

Conversation

@wmmc88
Copy link
Collaborator

@wmmc88 wmmc88 commented Aug 9, 2025

This pull request improves how the build system and the wdk-build crate handle Cargo workspace configuration, particularly with respect to custom config.toml files and patched dependencies. It also adds a new test workspace to verify these behaviors and updates the CI workflows to build and test this new setup.

Build system and metadata resolution improvements:

  • Updated wdk-build to always run cargo_metadata from the top-level Cargo workspace directory, ensuring that custom .cargo/config.toml (including [patch] tables) are respected for dependency resolution. This includes adding debug-level tracing and more robust path handling in bindgen.rs and lib.rs. [1] [2] [3] [4] [5]

Continuous Integration (CI) enhancements:

  • Modified the GitHub Actions workflows to build and package the new test workspace and to run its tests using cargo make, ensuring the new configuration is tested in CI. [1] [2]

Testing for custom config.toml and patched dependencies:

  • Added a new test workspace customized-config-toml-workspace under tests/, which demonstrates and verifies that [patch.crates-io] entries in .cargo/config.toml are honored during build and metadata resolution. This includes a patched dependency, a test crate, and a build script that exercises the new logic. [1] [2] [3] [4] [5] [6] [7] [8]Improve handling of cargo metadata to respect config.toml configurations and add build and package steps for tests in GitHub workflows. Introduce a new library crate and a workspace to facilitate these changes.

wmmc88 added 3 commits August 9, 2025 12:28
- Updated `bindgen.rs` to respect `config.toml` overrides by running `cargo_metadata` in the top-level manifest directory.
- Added tracing instrumentation for debugging purposes in `get_rust_edition` and `from_env_auto` functions.
- Modified `Makefile.toml` to include `customized-config-toml-workspace` as a workspace member.
- Created a new `customized-config-toml-workspace` with necessary Cargo files and dependencies.
- Implemented a new library crate `lib-crate` that utilizes a patched dependency defined in `config.toml`.
- Added a simple `build.rs` to trigger the WDK library build configuration.
- Introduced a new path dependency `config-toml-patched-dep` to demonstrate the patching mechanism.
@wmmc88 wmmc88 requested a review from Copilot August 9, 2025 20:20

This comment was marked as outdated.

@wmmc88 wmmc88 requested a review from a team August 9, 2025 20:24
@wmmc88 wmmc88 marked this pull request as draft August 9, 2025 21:44
@wmmc88 wmmc88 marked this pull request as ready for review August 11, 2025 02:55
@wmmc88 wmmc88 requested a review from Copilot August 11, 2025 02:55
Copy link
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 pull request enhances cargo metadata parsing to respect custom config.toml files and workspace configurations. The main goal is to ensure that wdk-build properly handles patched dependencies and custom Cargo configurations by running cargo_metadata from the correct working directory.

Key changes:

  • Modified wdk-build to run cargo_metadata from the top-level workspace directory to respect .cargo/config.toml settings
  • Added comprehensive test workspace to verify patched dependency resolution through custom config.toml
  • Updated CI workflows to build and test the new configuration scenarios

Reviewed Changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/wdk-build/src/lib.rs Enhanced Config::from_env_auto() to run cargo metadata from workspace root directory
crates/wdk-build/src/bindgen.rs Updated get_rust_edition() to respect workspace-level config.toml
crates/cargo-wdk/src/providers/exec.rs Added working directory parameter to command execution
tests/customized-config-toml-workspace/ New test workspace with patched dependencies via config.toml
.github/workflows/ Updated CI to build and test new workspace configurations
Various test files Updated mock function signatures to match new command execution interface

gurry
gurry previously approved these changes Aug 11, 2025
gurry
gurry previously approved these changes Aug 12, 2025
@wmmc88 wmmc88 dismissed stale reviews from krishnakumar4a4 and gurry via 6453da7 September 9, 2025 04:22
Copilot AI review requested due to automatic review settings September 11, 2025 18:38
@wmmc88 wmmc88 dismissed stale reviews from krishnakumar4a4 and gurry via 04b04b2 September 11, 2025 18:38
@wmmc88 wmmc88 enabled auto-merge September 11, 2025 18:39
Copy link
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 19 out of 20 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

gurry
gurry previously approved these changes Sep 12, 2025
@wmmc88 wmmc88 added this pull request to the merge queue Sep 12, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2025
@wmmc88 wmmc88 dismissed stale reviews from gurry and krishnakumar4a4 via 627f7fc September 12, 2025 06:43
Copilot AI review requested due to automatic review settings September 12, 2025 06:43
Copy link
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 19 out of 20 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@wmmc88 wmmc88 enabled auto-merge September 15, 2025 00:24
@wmmc88 wmmc88 requested review from a team, gurry and krishnakumar4a4 September 15, 2025 00:25
@wmmc88 wmmc88 added this pull request to the merge queue Sep 19, 2025
Merged via the queue into microsoft:main with commit 51d5eac Sep 19, 2025
229 checks passed
@wmmc88 wmmc88 deleted the fix-cargometdata-reespect-config-toml branch September 19, 2025 17:42
@leon-xd leon-xd mentioned this pull request Oct 17, 2025
@wmmc88 wmmc88 mentioned this pull request Nov 6, 2025
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.

3 participants