fix!: remove linker map file from driver packages - #735
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Some functional tests in build_command_test.rs still assert that <driver>.map exists in the package directory and will fail with the new packaging behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates cargo-wdk’s packaging flow to stop copying the linker map file (<driver>.map) into the <pkg>_package/ directory, avoiding a hard dependency on Cargo’s legacy target/<profile>/deps/ layout and preventing packaging failures under Cargo build-dir layout v2.
Changes:
- Remove
.mapsource/destination paths and the copy step from the packaging task implementation. - Update
cargo-wdkunit-test harness/mocks to stop expecting a map-file copy. - Update the main package-verification helper to stop asserting the map file exists (but some functional tests still need updating).
File summaries
| File | Description |
|---|---|
crates/cargo-wdk/tests/build_command_test.rs |
Updates package file verification helper to no longer require .map in the package directory. |
crates/cargo-wdk/src/actions/build/tests.rs |
Removes mocked expectations and helper code for copying the .map file during packaging. |
crates/cargo-wdk/src/actions/build/package_task.rs |
Removes .map path fields and stops copying the linker map into the package directory. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟢 Approval recommended
The map file copy path was fully removed from packaging and all related tests/mocks were updated consistently, with no remaining .map references in cargo-wdk.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #735 +/- ##
==========================================
- Coverage 82.93% 78.52% -4.41%
==========================================
Files 25 30 +5
Lines 6685 7105 +420
Branches 6685 7105 +420
==========================================
+ Hits 5544 5579 +35
- Misses 1029 1407 +378
- Partials 112 119 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Melvin Wang (wmmc88)
left a comment
There was a problem hiding this comment.
LGTM. but the PR description says it resolved #709, but this alone won't resolve that issue
There was a problem hiding this comment.
🟡 Changes recommended
CI still disables layout v2, leaving the targeted regression untested.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
|
Shravan Vasista (@svasista-ms) As per Alan's comment #709 (comment), all the changes he made in PR #707 need to be completely undone so that |
reverts changes added in PR microsoft#707 to disable build-dir layout v2
There was a problem hiding this comment.
🟡 Changes recommended
Cargo-make can retain stale map files in existing package directories, and tests do not explicitly verify map-file absence.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 2
- Review effort level: Balanced
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes consistently remove map packaging while preserving map generation and exercising the default Cargo layout in CI.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Balanced
This PR updates the packaging flow in both
cargo-wdkandcargo-maketo stop copying the<pkg>.mapfile to the final package. This PR also reverts the changes made in #707.Resolves #709
Details
Currently,
cargo-wdkpackages the map file. In Cargo'sbuild-dirlayout v2 (rust-lang/cargo#15947, stabilized in 1.100.0 via rust-lang/cargo#17354) the map file is located at<build-dir>/<profile>/build/<pkg>/<unit-hash>/out/<pkg>.map, instead oftarget/<profile>/deps/<driver_name>.map. This causes the build to fail.Since the package contains a
pdbalong with thesys/dll, ifmapfiles are omitted,cargo-wdkwill be able to support both v2 and v1 (legacy) directory layouts. This PR proposes this change.Package contents before vs after
NOTE: Map file is still produced by the build —
wdk-buildcontinues to emit/MAPand/MAPINFO:EXPORTStarget/<profile>/deps/<driver_name>.maptarget/<profile>/build/<pkg>/<unit-hash>/out/<driver_name>.map