feat: enhance cargo metadata parsing to respect config.toml#451
feat: enhance cargo metadata parsing to respect config.toml#451wmmc88 merged 13 commits intomicrosoft:mainfrom
Conversation
- 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.
…rrect typo in documentation
There was a problem hiding this comment.
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-buildto runcargo_metadatafrom the top-level workspace directory to respect.cargo/config.tomlsettings - 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 |
…espect-config-toml
There was a problem hiding this comment.
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.
Signed-off-by: Melvin Wang <melvin.mc.wang@gmail.com>
There was a problem hiding this comment.
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.
This pull request improves how the build system and the
wdk-buildcrate handle Cargo workspace configuration, particularly with respect to customconfig.tomlfiles 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:
wdk-buildto always runcargo_metadatafrom 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 inbindgen.rsandlib.rs. [1] [2] [3] [4] [5]Continuous Integration (CI) enhancements:
cargo make, ensuring the new configuration is tested in CI. [1] [2]Testing for custom config.toml and patched dependencies:
customized-config-toml-workspaceundertests/, which demonstrates and verifies that[patch.crates-io]entries in.cargo/config.tomlare 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 respectconfig.tomlconfigurations and add build and package steps for tests in GitHub workflows. Introduce a new library crate and a workspace to facilitate these changes.