Skip to content

RustPackageHelper.py: Update __set_members to avoid duplicates - #1915

Merged
Aaron (apop5) merged 1 commit into
microsoft:release/202511from
antklein:rust_package_helper_members
Sep 16, 2026
Merged

Aaron (apop5) merged 1 commit into
microsoft:release/202511from
antklein:rust_package_helper_members

Conversation

@antklein

@antklein Antaeus Kleinert-Strand (antklein) commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Updates RustPackageHelper to deduplicate Cargo workspace members by path before constructing RustPackage objects.
  • Adds unit tests for the __set_members function.
  • Also replaces the direct type(...) != str comparison with isinstance() when identifying path-based workspace dependencies.

Some local crates are declared both as Cargo workspace members and as path-based workspace dependencies. The previous implementation placed RustPackage instances in a set, but RustPackage does not define value-based equality or hashing. Separate instances representing the same path were therefore retained as distinct entries.

Collecting Path objects in the set provides value-based deduplication and ensures each workspace package is tested once.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Ran the Rust host-based unit test runner through stuart_ci_build.
Verified that each crate appears only once in the generated Cargo coverage command.
All unit tests are passing.

Integration Instructions

N/A

@mu-automation

mu-automation Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ QEMU Validation Passed

Source Dependencies

Repository Commit
mu_basecore 8fcbf07
mu_tiano_platforms d966ff0

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ✅ success ✅ success 0m 20s Build Logs Boot Logs
ArmVirt DEBUG ✅ success ✅ success 0m 13s Build Logs Boot Logs

Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/35126023232

This comment was automatically generated by the Mu QEMU PR Validation workflow.

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/202511@9a00f76). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202511    #1915   +/-   ##
=================================================
  Coverage                  ?    2.23%           
=================================================
  Files                     ?     1670           
  Lines                     ?   427108           
  Branches                  ?     5079           
=================================================
  Hits                      ?     9529           
  Misses                    ?   417495           
  Partials                  ?       84           
Flag Coverage Δ
FmpDevicePkg 9.53% <ø> (?)
MdeModulePkg 1.65% <ø> (?)
MdePkg 5.44% <ø> (?)
NetworkPkg 0.55% <ø> (?)
PolicyServicePkg 30.42% <ø> (?)
SecurityPkg 1.56% <ø> (?)
StandaloneMmPkg 0.50% <ø> (?)
UefiCpuPkg 4.78% <ø> (?)
UnitTestFrameworkPkg 11.70% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would benefit from unit tests, but I don't think it's necessary given there are currently none in the plugin.

@antklein

Copy link
Copy Markdown
Contributor Author

This would benefit from unit tests, but I don't think it's necessary given there are currently none in the plugin.

It was simple enough to add unit tests for __set_members. I modeled it after the DebugMacroCheckPlugin test design.

Deduplicate crates listed as both workspace members and path dependencies. Add tests covering duplicate paths, dependency filtering, and empty workspaces.
auto-merge was automatically disabled September 16, 2026 16:57

Head branch was pushed to by a user without write access

@apop5
Aaron (apop5) merged commit 829190d into microsoft:release/202511 Sep 16, 2026
96 checks passed
@antklein
Antaeus Kleinert-Strand (antklein) deleted the rust_package_helper_members branch September 16, 2026 18:35
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.

4 participants