Skip to content

[Squash On Rebase] RustPackageHelper.py: Update __set_members to avoid duplicates - #1916

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

Aaron (apop5) merged 1 commit into
microsoft:release/202608from
antklein:rust_package_helper_members_2608

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

@antklein

Copy link
Copy Markdown
Contributor Author

release/202608 targeted change for #1915
Aaron (@apop5) FYI

@mu-automation

mu-automation Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

❌ QEMU Validation Failed

Source Dependencies

Repository Commit
mu_basecore 01fe425
mu_tiano_platforms d966ff0

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ❌ failure ⏩ skipped N/A Build Logs N/A
ArmVirt DEBUG ❌ failure ⏩ skipped N/A Build Logs N/A

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

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/202608@a3101e9). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202608    #1916   +/-   ##
=================================================
  Coverage                  ?    1.70%           
=================================================
  Files                     ?     1674           
  Lines                     ?   417227           
  Branches                  ?        0           
=================================================
  Hits                      ?     7121           
  Misses                    ?   410106           
  Partials                  ?        0           
Flag Coverage Δ
FmpDevicePkg 8.54% <ø> (?)
MdeModulePkg 0.89% <ø> (?)
MdePkg 4.84% <ø> (?)
NetworkPkg 0.50% <ø> (?)
PolicyServicePkg 28.75% <ø> (?)
SecurityPkg 1.46% <ø> (?)
StandaloneMmPkg 0.47% <ø> (?)
UefiCpuPkg 4.17% <ø> (?)
UnitTestFrameworkPkg 16.29% <ø> (?)

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.

@apop5 Aaron (apop5) changed the title RustPackageHelper.py: Update __set_members to avoid duplicates [Squash On Rebase] RustPackageHelper.py: Update __set_members to avoid duplicates Sep 16, 2026
Deduplicate crates listed as both workspace members and path dependencies. Add tests covering duplicate paths, dependency filtering, and empty workspaces.
@apop5
Aaron (apop5) merged commit 653882e into microsoft:release/202608 Sep 16, 2026
98 checks passed
@antklein
Antaeus Kleinert-Strand (antklein) deleted the rust_package_helper_members_2608 branch September 16, 2026 20:26
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