Skip to content

[Build] Skip XamlC when no XAML files need XamlC processing#34972

Open
davidnguyen-tech wants to merge 11 commits into
dotnet:net11.0from
davidnguyen-tech:feature/xamlc-skip-empty-sg-xc
Open

[Build] Skip XamlC when no XAML files need XamlC processing#34972
davidnguyen-tech wants to merge 11 commits into
dotnet:net11.0from
davidnguyen-tech:feature/xamlc-skip-empty-sg-xc

Conversation

@davidnguyen-tech

@davidnguyen-tech davidnguyen-tech commented Apr 15, 2026

Copy link
Copy Markdown
Member

Summary

Skip the XamlC MSBuild target when no XAML files use the XamlC or Runtime inflator — i.e., when all XAML uses the default SourceGen inflator.

Motivation

With SourceGen as the default inflator in .NET 11, the XamlC MSBuild target has nothing to do on a default build: there are no _MauiXaml_XC or _MauiXaml_RT items to process. Previously XamlC still ran (in ValidateOnly=True mode for Debug), loading the assembly via Cecil, parsing XAML, validating, and discarding results — all redundant because the Source Generator already validates XAML at compile time.

Changes

  • Microsoft.Maui.Controls.targets (1 line): Added AND ('@(_MauiXaml_XC)' != '' OR '@(_MauiXaml_RT)' != '') to the XamlC target Condition, so it only runs when there are files that actually need XamlC processing.
  • MSBuildTests.cs:
    • Skip tests (BuildAProject, LinkedFile, RandomXml, RandomEmbeddedResource, NoXamlFiles) assert XamlC.stamp does NOT exist under the default SourceGen inflator.
    • Added XamlCRunsWhenDeprecatedInflatorUsed — a [Theory] covering both MauiXamlInflator=XamlC and =Runtime, asserting XamlC still runs (covers both branches of the new OR condition).
    • Restored the XamlC-subject tests (TargetsShouldSkip, Clean, DesignTimeBuild, AddNewFile; TouchXamlFile kept [Skip]), adapted to explicitly opt into the XamlC inflator via the new XamlCOptIn constant.

Target Ordering

_MauiXamlComputeInflator (which populates _MauiXaml_XC/_MauiXaml_RT) runs before Compile via PrepareResourcesDependsOn. XamlC runs AfterTargets="AfterCompile", so the condition is evaluated after the item groups are fully populated.

Impact

  • Default builds (SourceGen inflator) skip the XamlC target entirely — saves the Cecil load + XAML parse overhead.
  • Explicit MauiXamlInflator=XamlC or MauiXamlInflator=Runtime builds continue to work unchanged.

@github-actions

github-actions Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34972

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34972"

@davidnguyen-tech davidnguyen-tech changed the base branch from main to net11.0 April 15, 2026 09:47
@davidnguyen-tech davidnguyen-tech force-pushed the feature/xamlc-skip-empty-sg-xc branch 3 times, most recently from b38cbcf to 00912c6 Compare April 21, 2026 11:13
@davidnguyen-tech davidnguyen-tech force-pushed the feature/xamlc-skip-empty-sg-xc branch 4 times, most recently from 28daf7d to 921a0c2 Compare April 22, 2026 13:35
davidnguyen-tech added a commit to davidnguyen-tech/maui that referenced this pull request Apr 23, 2026
Replace the single-line header comment with a block that makes explicit the contract the surviving tests protect: SourceGen is the net11.0 default and the XamlC target must not run on default builds. Addresses reviewer feedback on dotnet#34972 that future contributors had no in-file guidance that these are negative tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kubaflo

kubaflo commented May 24, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/refactor-copilot-yml

@MauiBot

MauiBot commented May 24, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Merge Conflict Detected — This PR has merge conflicts with its target branch. Please rebase onto the target branch and resolve the conflicts.

@kubaflo

kubaflo commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

AI code review for net11.0 target

Verdict: Needs changes (also still a Draft)

Adds a condition so the legacy XamlC MSBuild target is skipped when no XAML files require it (default SourceGen path self-validates). The core idea is reasonable and the test edits correctly assert SourceGen builds no longer emit XamlC.stamp.

Key findings (description ↔ implementation mismatches)

  • The actual targets condition added is AND ('@(_MauiXaml_XC)' != '' OR '@(_MauiXaml_RT)' != ''), but the PR description states it added AND ('@(_MauiXaml_SG)' != '' OR '@(_MauiXaml_XC)' != ''). These are not equivalent (SG vs RT), and the SG-based version would contradict the new tests (which prove SourceGen now skips XamlC). The description's quoted condition is inaccurate — please reconcile so reviewers can verify intended semantics for Runtime-inflator (_MauiXaml_RT) files.
  • The description claims two new tests were added (XamlCSkippedWhenRuntimeInflatorOnly, XamlCRunsWhenXamlCInflatorUsed), but the diff shows tests were removed (TargetsShouldSkip, Clean, DesignTimeBuild, AddNewFile, TouchXamlFile) and several existing ones flipped to AssertDoesNotExist. No such new tests appear. Please align the description with the actual test changes.
  • Confirm the intended behavior for the Runtime inflator: the condition keeps XamlC running when _MauiXaml_RT is non-empty — is that desired (the motivation text only talks about SG redundancy)?
  • The added comment references ~/.copilot/lessons/dotnet/maui/xamlc-test-opt-in.md, a machine-local path that won't exist for other contributors; consider linking the PR/issue instead.

CI note: AOT integration tests fail on Windows and macOS. Because this PR changes XamlC/build-target behavior and AOT is sensitive to inflator/codegen, these should be verified as not PR-caused before merge.

Confidence: Medium-high on the description/implementation mismatches; the AOT failures need confirmation.

This is an automated, non-approval review comment, not a GitHub approval/request-changes. A human must make the merge decision.

@kubaflo

kubaflo commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

AI code review refresh for net11.0 target

Head reviewed: 710be9ba7fca7cd8f9ff2d3cf5a4496e73ebf946 (this resolves to the current PR head 85e2fd39960c6157f6fe00e8c9f89c67e1ae4249, a rebased commit with the same author timestamp 2026-06-01T19:17:24Z). Target branch: net11.0. State: OPEN / Draft.

Verdict: Needs changes — the newly added test is failing in CI for a PR-caused reason.

This round-two pass focuses on the new commit since the previous fleet review: "Add positive test: XamlC runs when XamlC inflator is used" (which added XamlCRunsWhenXamlCInflatorUsed). That test was a good response to round-one feedback, but as written it does not pass.

Blocking finding

  • XamlCRunsWhenXamlCInflatorUsed fails on every Helix unit-test leg (Windows + macOS, Debug + Release). Root cause from the work-item console log:
    MSBUILD : error MSB1001: Unknown switch.
    Switch: -warnaserror-:MAUI1001
    
    The test calls Build(projectFile, additionalArgs: "-p:MauiXamlInflator=XamlC -warnaserror-:MAUI1001"), but the Build harness invokes MSBuild.exe, and -warnaserror-:<code> is a Roslyn/csc switch, not an MSBuild CLI switch. MSBuild rejects it, the build exits with code 1, and the test fails at Assert.Equal(0, p.ExitCode) (MSBuildTests.cs:255) before it ever reaches the XamlC.stamp assertion. The whole Microsoft.Maui.Controls.Xaml.UnitTests.dll work item is then reported as failed.
    • Suggested fix: drop the invalid switch and instead exclude the code via an MSBuild property, e.g. -p:MSBuildWarningsNotAsErrors=MAUI1001 (or -p:WarningsNotAsErrors=MAUI1001). If MAUI1001 isn't actually escalated to an error in this test build, the switch can simply be removed.

Production change assessment (non-blocking)

  • The targets change itself is sound. Gating the legacy XamlC target with AND ('@(_MauiXaml_XC)' != '' OR '@(_MauiXaml_RT)' != '') correctly skips XamlC on the default SourceGen path and keeps it running for the XamlC/Runtime inflators. _MauiXaml_XC/_MauiXaml_RT are populated in _MauiXamlComputeInflator, which runs (via _MauiInjectXamlCssAdditionalFiles and _MauiAddXamlEmbeddedResources/PrepareResourcesDependsOn) before the AfterCompile-scheduled XamlC target's condition is evaluated, so the items are available. The passing BuildAProject/LinkedFile/RandomXml/RandomEmbeddedResource/NoXamlFiles tests validate the skip path. No production-code regression found.
  • Test-coverage note (non-blocking): the removed DesignTimeBuild, Clean, AddNewFile, and TargetsShouldSkip tests previously covered design-time-build skipping, IncrementalClean/Clean of generated files, and incremental no-op behavior for the XamlC target. That coverage is now gone. Since the XamlC target still carries '$(DesignTimeBuild)' != 'True' and incremental stamp logic, consider re-expressing at least the design-time and incremental cases with MauiXamlInflator=XamlC rather than dropping them.

CI note

Required maui-pr is failing. The Windows/macOS Helix Unit Tests (Debug & Release) failures are directly attributable to this PR (the new XamlCRunsWhenXamlCInflatorUsed test, as detailed above). Separately, AOT macOS, some RunOniOS_…TrimFull legs, and a Build macOS (Release) step are also red; these were not conclusively tied to this change here and should be confirmed as not PR-caused (or pre-existing/infra) before merge.

Confidence: High on the failing-test root cause (deterministic MSB1001 reproduced on all four Helix legs). Medium on the non–unit-test CI failures, which need separate confirmation.

This is an automated, non-approval review comment — not a GitHub approval or request-changes. A human must make the merge decision.

davidnguyen-tech and others added 7 commits June 2, 2026 15:00
XamlC's validate-only pass (Debug default) is the only build-time
XAML validation for files using the Runtime or XamlC inflators.
SourceGen-only files are validated by XSG itself, so XamlC is
redundant for them.

Gate the XamlC target on '@(_MauiXaml_XC)' != '' OR '@(_MauiXaml_RT)' != ''
(equivalent to '@(_MauiXaml_AsEmbeddedResource)' != ''). Projects
using SourceGen exclusively — the default in net11.0 — now skip
XamlC entirely.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tests that don't care about XamlC now lock in the SourceGen default:
they assert the build still succeeds and XamlC.stamp is absent.

Tests whose subject is the XamlC target itself (incrementality,
Clean, DesignTimeBuild contrast, AddNewFile) opt in via
-p:MauiXamlInflator=XamlC -p:NoWarn=MAUI1001 so the existing contract
is verifiable. Plan originally called for the SourceGen,XamlC combo,
but for these synthesised projects the source generator emits a
duplicate InitializeComponent (CS0111) when both inflators are
active, so the bare XamlC form with NoWarn=MAUI1001 is used instead
to silence the deprecation warning under the repo-wide
TreatWarningsAsErrors setting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract XamlC opt-in args + rationale to a single const so the
'why bare XamlC, not SourceGen,XamlC' explanation lives in one
place. Apply the same opt-in to TouchXamlFile's body for
future-proofing. Reword the misleading inline comment on the
DesignTimeBuild precondition.

Note: the prior commit message's TreatWarningsAsErrors rationale
for NoWarn=MAUI1001 is slightly inaccurate — the synthesized
projects under tempDirectory write a fresh Directory.Build.props
that does not chain in the repo-root TWAE setting. NoWarn is
kept anyway for noise reduction and to be robust if the chain
ever changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The XamlC target is gated to SourceGen-default-empty projects in
this PR's targets change. Tests that simulated XamlC running on the
synthesised single-project scaffold (TargetsShouldSkip, Clean,
DesignTimeBuild, AddNewFile, TouchXamlFile) were exercising a code
path that no longer executes by default. Delete them along with the
XamlCOptIn constant. The contract that XamlC does not run by default
is already locked in by BuildAProject, LinkedFile, RandomXml,
RandomEmbeddedResource (AssertDoesNotExist on XamlC.stamp), and by
NoXamlFiles (log-scrape that the target isn't scheduled).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the single-line header comment with a block that makes explicit the contract the surviving tests protect: SourceGen is the net11.0 default and the XamlC target must not run on default builds. Addresses reviewer feedback on dotnet#34972 that future contributors had no in-file guidance that these are negative tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds XamlCRunsWhenXamlCInflatorUsed to verify the condition gate
correctly activates XamlC when _MauiXaml_XC is populated via
-p:MauiXamlInflator=XamlC. This is the positive counterpart to
BuildAProject which proves XamlC is skipped under SourceGen.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The positive test passed '-warnaserror-:MAUI1001' to opt out of treating
the XamlC-deprecation warning as an error. The '/warnaserror-:CODE'
negation form is rejected by the rolled-forward .NET 11 preview.5 MSBuild
(MSB1001: Unknown switch), failing the synthesized build before XamlC
could run. Replace it with the valid '-p:WarningsNotAsErrors=MAUI1001'
property, which expresses the same defensive intent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kubaflo

kubaflo commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

AI code review refresh for net11.0 target

Head reviewed: 2f56ee5 · Target: net11.0 · State: OPEN / Draft

Verdict: LGTM (CI caveat, not merge-ready while required checks are red).

Findings

  • No new blocking code findings. The latest commits since round three improve coverage rather than changing the production target logic: the positive XamlC gate test now covers both XamlC and Runtime inflators, and the restored XamlC-subject tests explicitly opt into MauiXamlInflator=XamlC with valid WarningsNotAsErrors=MAUI1001 MSBuild property syntax.
  • The target condition still looks sound: _MauiXamlComputeInflator populates _MauiXaml_XC / _MauiXaml_RT before the AfterCompile XamlC target is evaluated, so SourceGen-only default builds skip XamlC while explicit XamlC/Runtime inflator builds keep XamlC validation and stamp/FileWrites behavior.
  • Devil advocate pass: the main risk would be silently dropping Runtime inflator validation or design-time gating; the refreshed tests now cover the Runtime OR branch and restored DesignTimeBuild, TargetsShouldSkip, Clean, and AddNewFile coverage under explicit XamlC opt-in. I did not find a remaining PR-caused gap.

CI note

maui-pr build 1446504 is still red: AOT macOS, RunOniOS_MauiRelease, and trimmed iOS release legs fail. The XAML/Helix unit-test legs pass on this head. The failing integration logs point at HybridWebView trim/ILLink warning files / Apple template build failures, matching the pre-existing net11.0 failure class noted in round three rather than the XamlC/MSBuild-target changes here.

Confidence: medium-high. This is a code-review comment only; it is not a GitHub approval and does not override the draft state or required CI failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kubaflo

kubaflo commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@davidnguyen-tech davidnguyen-tech marked this pull request as ready for review June 3, 2026 14:12
@davidnguyen-tech

Copy link
Copy Markdown
Member Author

The skip implementation itself should be good.
I'm a little unsure about the tests, because I don't have much background in the area, so I'm uncertain if they define the expected behaviour properly or if there's any test case that I missed. But I tried my best :)

@kubaflo

kubaflo commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

AI code review refresh for net11.0 target

Head reviewed: 4f04377

Verdict: LGTM (CI caveat: not merge-ready while required checks remain red).

Findings

  • No new blocking code findings from the post-round-four commit. The new SetUp($"{nameof(XamlCRunsWhenDeprecatedInflatorUsed)}_{inflator}") isolation is the right fix for the [Theory] rows: each XamlC/Runtime case now gets its own temp/intermediate directory, so a stale XamlC.stamp from one row cannot satisfy the other.
  • The production target condition still looks sound: _MauiXamlComputeInflator clears/populates _MauiXaml_XC and _MauiXaml_RT before resources/compile, and XamlC now runs only for non-design-time builds that have MauiXaml plus at least one XamlC/Runtime item. SourceGen-only default builds skip the legacy target; explicit deprecated inflators keep stamp/FileWrites behavior.
  • Re: David’s latest test-coverage question: the current test shape covers the main negative default path, both positive gate branches, design-time skip, incrementality, clean, linked files, and non-XAML embedded resources. I do not see a missing high-value XamlC/MSBuild target case in this PR scope.

CI note

gh pr checks shows maui-pr failed on integration legs, while Windows/macOS build, pack, and Helix unit-test legs passed. Build Analysis currently has no known-issue match. The observed failures are template/AOT/iOS integration issues (for example an unexpected ILC ... apply-preserve-attribute.xml warning file and iOS template build failures) and I did not find a direct XamlC/MSBuild-test correlation; however, because required checks are red, this is not merge-ready without human CI triage/retry.

Confidence: medium-high for the code/test review; medium on CI causality because the failing integration jobs are unmatched by Build Analysis.

Not an approval. This is an AI review comment only; human maintainers own approval and merge decisions.

@kubaflo

kubaflo commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Test Failure Review

@davidnguyen-tech — new test-failure review results are available based on this last commit: 4f04377.
To request a fresh review after new comments, commits, or CI runs, comment /review tests.

Overall Likely unrelated Failures 6 Data Partial Platform iOS/macOS

Test Failure Review4f04377 · [Build] Skip XamlC when no XAML files need XamlC processing · 2026-06-03 17:11 UTC

Overall verdict: Likely unrelated

The failed maui-pr evidence is concentrated in iOS/macOS integration tests failing on HybridWebView linker/AOT warnings, while this PR changes XamlC/MSBuild target behavior and one XAML unit test. Recent net11.0 base builds for the same pipeline failed the same integration-test records, and the newest base build shows the same HybridWebView trim/AOT signatures.

Failure Verdict Evidence
Build Analysis / parent maui-pr check Likely unrelated The parent check points to build 1447892, whose failed records are the integration-test jobs below; no independent Build Analysis finding tied the failure to src/Controls/src/Build.Tasks/.../Microsoft.Maui.Controls.targets or src/Controls/tests/Xaml.UnitTests/MSBuild/MSBuildTests.cs.
maui-pr (Run Integration Tests AOT macOS) Likely unrelated Build 1447892 failed AOT macOS / Run Integration Tests - AOT; log excerpts show AOTTemplateTest.PublishNativeAOTRootAllMauiAssemblies failures with ILC : AOT analysis warning IL3050 and HybridWebView uses dynamic System.Text.Json serialization features, plus IL2009 in apply-preserve-attribute.xml, not XamlC. Base build 1446270 had the same AOT macOS failure and HybridWebView AOT messages.
maui-pr (Run Integration Tests RunOniOS_MauiRelease ARM64) Likely unrelated Build 1447892 failed AppleTemplateTests.RunOniOS_MauiReleaseTrimFull and _CoreCLR with Project ... failed to build; the root excerpts are ILLink : Trim analysis error IL2026 for Microsoft.Maui.Handlers.HybridWebViewHandler... on net11.0-ios. Base build 1446270 failed the same RunOniOS tests and log 1033 contains the same IL2026/HybridWebView messages.
maui-pr (Run Integration Tests RunOniOS_MauiReleaseTrimFull ARM64) Likely unrelated Same build 1447892 failed repeated RunOniOS_MauiReleaseTrimFull runs with IL2026 HybridWebView trim errors. The PR scope is XamlC target skipping, and recent base builds 1446270 and 1443637 list the same failed records.
maui-pr (Run Integration Tests RunOniOS_MauiReleaseTrimFull_CoreCLR ARM64) Likely unrelated Same failure signature as above: _CoreCLR iOS template builds fail on HybridWebView RequiresUnreferencedCodeAttribute trim analysis, not changed XamlC targets/tests. The same failed record appears on recent net11.0 base builds.
Authenticated AzDO test-results-only Roslyn/CoreCLR/JIT/crossgen/GC failures Likely unrelated The optional authenticated test-run API returned 23 additional distinct failures from run names such as coreclr ... jitstress, Test Windows CoreClr Debug Single Machine, and Roslyn Microsoft.CodeAnalysis...; these are not present in the public maui-pr failed timeline records and do not overlap the PR's changed XamlC files.

Recommended action

Do not block this XamlC PR on these failures; wait for the existing net11.0 HybridWebView trim/AOT integration-test failures to clear, then rerun maui-pr if a fresh signal is needed.

Evidence details
  • PR scope: 2 changed files, both in XamlC/build-test scope:
    • src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets
    • src/Controls/tests/Xaml.UnitTests/MSBuild/MSBuildTests.cs
  • PR head: 4f04377e6c9f9c1c6ded157ba91d78ac6e91769e; analyzed build 1447892 ran on refs/pull/34972/merge at source version b72964d954650db045f96e818750010ad243d499.
  • Failed timeline records in build 1447892: AOT macOS, RunOniOS_MauiRelease ARM64, RunOniOS_MauiReleaseTrimFull ARM64, RunOniOS_MauiReleaseTrimFull_CoreCLR ARM64, and their Run Integration Tests - ... tasks.
  • AOT excerpts: Microsoft.Maui.IntegrationTests.AOTTemplateTest.PublishNativeAOTRootAllMauiAssemblies(...) [FAIL]; messages include ILC : AOT analysis warning IL3050 ... HybridWebView uses dynamic System.Text.Json serialization features and IL2009: Could not find method 'System.Void Activated(T)' ... apply-preserve-attribute.xml.
  • RunOniOS excerpts: Microsoft.Maui.IntegrationTests.AppleTemplateTests.RunOniOS_MauiReleaseTrimFull and _CoreCLR failed with Project Test....csproj failed to build; root messages include ILLink : Trim analysis error IL2026 ... Microsoft.Maui.Handlers.HybridWebViewHandler... for TargetFramework=net11.0-ios.
  • Base comparison from gathered context: the five recent net11.0 base builds included for the same definition were all failed: 1446270, 1443637, 1431279, 1428358, and 1427815. The two newest base timelines list the same failed records as this PR build. Public log search on base build 1446270 also found the same AOT and RunOniOS HybridWebView IL3050/IL2026 messages.
  • Optional authenticated AzDO test results were available only because local gathering used an Azure CLI token. They include 25 deduplicated entries in context: 2 MAUI log-derived RunOniOS failures plus 23 non-MAUI Roslyn/CoreCLR/JIT/crossgen/GC failures. Because gh-aw normally relies on public build/timeline/log APIs unless AZDO_TOKEN is present, those authenticated test-run rows are treated as local-only enrichment rather than the primary failure signal.
  • Limitation: data is partial because the context notes authenticated AzDO access used an Azure CLI bearer token locally; the workflow normally relies on public build/timeline/log APIs unless the runner provides AZDO_TOKEN.
  • Device-test hidden failures: no maui-pr-devicetests build/check was present in the gathered context, so XHarness hidden device failures were not applicable to these results.

@simonrozsival simonrozsival left a comment

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.

LGMT. I was wondering if we're not missing some XSG test coverage - we're switching the default but we're focusing testing on the legacy part still, but we have dedicated test coverage for XSG incrementality, so these changes are good to go I think.

@kubaflo

kubaflo commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

AI code review refresh for net11.0 target

Head reviewed: 4f04377

Verdict: LGTM (CI caveat: not merge-ready while required checks remain red).

Findings

  • No new commits since the prior round-five marker; the new activity is Simon's approval/comment at 2026-06-04T11:34:18Z. I rechecked the diff and full head files independently rather than relying on that review.
  • The XamlC target gate remains sound: _MauiXamlComputeInflator clears/repopulates _MauiXaml_XC and _MauiXaml_RT, and the target now runs only for non-design-time builds with XamlC/Runtime items. SourceGen-only default builds skip the legacy target, while explicit deprecated inflators still exercise/stamp the target.
  • Simon's XSG-coverage question does not change my assessment. The tests cover default SourceGen skip behavior, both positive gate branches (XamlC and Runtime), design-time skip, incrementality, clean behavior, linked XAML, non-XAML resources, and isolate the theory rows to avoid stale XamlC.stamp leakage. Existing XSG incrementality coverage is the right place for broader source-generator behavior.

CI note

gh pr checks is still red: maui-pr/Build Analysis plus macOS AOT and iOS Release/TrimFull integration legs are failing. The build/pack and Helix unit-test legs pass, and the prior test-failure review classifies the current integration failures as likely unrelated HybridWebView trim/AOT issues. I do not see evidence tying the red checks to this XamlC/MSBuild target change, but human CI triage/retry is still required before merge.

Confidence: medium-high on code/test review; medium on CI causality because required integration checks are red.

Not an approval. This is an AI review comment only; human maintainers own approval and merge decisions.

@kubaflo

kubaflo commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

✅ LGTM — no blocking issues found

LGTM — unanimous across all four review models (4/4), no code-level findings.

This is a clean build optimization: it skips the XamlC MSBuild step when no XAML files actually need XamlC processing, avoiding unnecessary work. The change is well-scoped and correct.

⚠️ CI note: there are red legs (6 fail / 29 pass), but they are the recurring infra signature seen across today's PRs (Build Analysis, AOT macOS, RunOniOS_MauiRelease/TrimFull) — unrelated to a XamlC-skip change (these are runtime/AOT integration legs, not build-time XamlC). Please confirm a green/known-flaky run before merge.

Multi-model review (gpt-5.5 · opus-4.8 · opus-4.6 · gemini-3.1-pro). Comments only — not a formal approval.

@davidnguyen-tech

Copy link
Copy Markdown
Member Author

@StephaneDelcroix hello, could you please check if the test coverage looks good?

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