Skip to content

[CHERRY-PICK] BaseTools: Fix owner-aware DSC arch macro expansion [Rebase & FF] - #1904

Merged
Aaron (apop5) merged 2 commits into
microsoft:release/202511from
Bob0505:task3958267-backport-owner-aware-dsc-arch
Sep 2, 2026
Merged

[CHERRY-PICK] BaseTools: Fix owner-aware DSC arch macro expansion [Rebase & FF]#1904
Aaron (apop5) merged 2 commits into
microsoft:release/202511from
Bob0505:task3958267-backport-owner-aware-dsc-arch

Conversation

@Bob0505

@Bob0505 Bob Chen (Bob0505) commented Sep 1, 2026

Copy link
Copy Markdown

Description

This cherry-picks two upstream EDK II BaseTools fixes into release/202511:

  • tianocore/edk2#12628 expands DSC architecture macros for all component records and component-private sub-items.
  • tianocore/edk2#13022 makes that expansion owner-aware, leaves ordinary include-provenance records unchanged, resets owner mappings between post-processing runs, and adds parser regression coverage.

This preserves private LibraryClasses and PCD bindings under sections such as [Components.$(PEI_ARCH)] without applying component-specific expansion to unrelated included records. Both commits retain their original authorship and cherry picked from provenance.

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

How This Was Tested

  • Windows Python 3.12.10: python -B -m unittest BaseTools.Tests.MetaFileParserTests ΓÇö 11/11 passed.
  • Windows Python 3.12.10: python -B BaseTools\Tests\PythonToolsTests.py ΓÇö 320/320 passed.
  • WSL Ubuntu Python 3.12.3: PYTHONPATH=BaseTools/Source/Python:BaseTools/Tests python3 -B BaseTools/Tests/PythonToolsTests.py ΓÇö 320/320 passed.
  • python -B BaseTools\Scripts\PatchCheck.py e7c1a028c47981a16805ecee845db232ccf0b5a2 - code checks passed; commit-message validation reports the required release-branch [CHERRY-PICK] prefix as outside the upstream subject grammar.
  • python -B BaseTools\Scripts\PatchCheck.py fb65732b16651e6a30106c2dfc7bffe71d9b6f5d - code checks passed; commit-message validation reports the required release-branch [CHERRY-PICK] prefix as outside the upstream subject grammar.
  • python -B -m py_compile passed for all three changed Python files.
  • CRLF-aware git diff --check, UTF-8 decoding, final-newline, and trailing-whitespace checks passed.
  • Stable patch IDs match the upstream commits exactly.

Integration Instructions

N/A

@mu-automation

mu-automation Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

❌ QEMU Validation Failed

Source Dependencies

Repository Commit
mu_basecore fb65732
mu_tiano_platforms 7c27a38

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ❌ failure ⏩ skipped N/A Build Logs N/A
ArmVirt DEBUG ✅ success ✅ success 0m 14s Build Logs Boot Logs

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

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

@Bob0505

Copy link
Copy Markdown
Author

Hi Aaron (@apop5), could you please review this release/202511 BaseTools backport? It cherry-picks the merged upstream fixes from tianocore/edk2#12628 and tianocore/edk2#13022 with matching stable patch IDs. The focused parser tests passed 11/11, and the aggregate BaseTools Python suite passed 320/320 on both Windows and WSL. Thank you.

@codecov-commenter

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

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202511    #1904   +/-   ##
=================================================
  Coverage                  ?    2.23%           
=================================================
  Files                     ?     1670           
  Lines                     ?   427111           
  Branches                  ?     5079           
=================================================
  Hits                      ?     9529           
  Misses                    ?   417498           
  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.

@makubacki

Copy link
Copy Markdown
Member

Bob Chen (@Bob0505), the commit content itself looks fine to me, but please update each commit message to prepend the current commit subject line with "[CHERRY-PICK]".

@makubacki Michael Kubacki (makubacki) changed the title [CHERRY-PICK] BaseTools: Fix owner-aware DSC arch macro expansion [CHERRY-PICK] BaseTools: Fix owner-aware DSC arch macro expansion [Rebase & FF] Sep 1, 2026

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.

Approved, waiting for commit message updates.

@Bob0505

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="UST Global Singapore Pte Limited"

…parser

Signed-off-by: Kirk Chou <kirk.chou@hpe.com>
(cherry picked from commit 34a3cc8)
PR #12628 expanded architecture macros for every DSC record so
component-private records match their component. A positive raw owner can
also represent include provenance, so broad expansion changes records
outside component scope.

Expand architecture macros only for Component records and records whose
owner maps to a final Component. Reset the owner mapping whenever the
post-processed table is rebuilt to prevent stale ownership across
DoPostProcess calls.

Add regression coverage for component-private LibraryClasses and PCDs,
nested and private includes, multiple architectures, unresolved macros,
repeated sections, and repeated post-processing.

Signed-off-by: Bob Chen (UST Global Singapore Pte Limited) <v-kuanlchen@microsoft.com>
(cherry picked from commit 7b01c71a83e0bf6a89f5e803a4f60adc29c1f70f)
@Bob0505
Bob Chen (Bob0505) force-pushed the task3958267-backport-owner-aware-dsc-arch branch from 796fc02 to fb65732 Compare September 2, 2026 01:38
@Bob0505

Bob Chen (Bob0505) commented Sep 2, 2026

Copy link
Copy Markdown
Author

Hi Michael Kubacki (@makubacki), I updated both commit subjects to prepend [CHERRY-PICK] as requested and rebased the branch onto the latest release/202511. The patch content and stable patch IDs are unchanged. The focused parser suite passed 11/11, and the aggregate BaseTools Python suite passed 320/320 on both Windows and WSL. Thank you.

@apop5
Aaron (apop5) merged commit 8c90c27 into microsoft:release/202511 Sep 2, 2026
102 checks passed
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.

5 participants