Skip to content

macOS build: allow the Info.plist DTD in XmlPeek and XmlPoke on MSBuild 18.11+ - #1811

Merged
mohnjiles merged 1 commit into
mainfrom
fix/macos-plist-dtd
Nov 24, 2026
Merged

mohnjiles merged 1 commit into
mainfrom
fix/macos-plist-dtd

Conversation

@mohnjiles

Copy link
Copy Markdown
Member

StabilityMatrix.Avalonia.csproj: the macOS EditInfoPlist target's XmlPeek and XmlPoke allow the DTD in Info.plist again.

The v2.17.0 release's macOS job (45309536969) failed after #1810 with:

StabilityMatrix.Avalonia.csproj(28,5): error MSB3733: The XML input contains a DTD. DTDs are prohibited by default for security reasons.

global.json pins 9.0.0 with rollForward: latestMajor and allowPrerelease: true, so the build uses the newest SDK on the runner. The macos-15 image has .NET 11, whose MSBuild (18.12) prohibits DTDs in XmlPeek and XmlPoke by default (change wave 18.11). Info.plist starts with Apple's <!DOCTYPE plist …>.

  • XmlPeek gets ProhibitDtd="false"; the parameter exists since MSBuild 15.
  • XmlPoke only has ProhibitDtd from 18.11, and MSBuild 18.9 fails with MSB4064 when it's set. So XmlPoke is split into two by $(MSBuildVersion): the existing one below 18.11, one with ProhibitDtd="false" from 18.11.
  • ProhibitDtd="false" means DtdProcessing.Ignore, not Parse: the DTD is skipped, nothing is fetched. That was the default before 18.11, so the output plist is what 2.16.5 produced (the poke drops the DOCTYPE line on both versions, as before).

Alternatives considered

  • MSBUILDDISABLEFEATURESFROMVERSION=18.11 in release.yml: reverts every 18.11 change for the build, and leaves local macOS builds on SDK 11 broken.
  • global.json rollForward: latestFeature: keeps builds on SDK 9, but changes which SDK every developer and CI job uses; a bigger decision than a release-night fix.

Verification

A scratch MSBuild project running these exact tasks on an Info.plist with Apple's DOCTYPE:

SDK (MSBuild) Before After
11.0.100 (18.12.2) MSB3733, as in the release run peek and poke succeed
10.0.404 (18.9.15) peek and poke succeed peek and poke succeed; the skipped XmlPoke doesn't trigger MSB4064

CSharpier 1.4.1 check is clean on the file. Not verified end-to-end until the release workflow runs on it.

🐺 Generated with Lykos Code (Opus 5.5)

MSBuild 18.11 prohibits DTDs in XmlPeek and XmlPoke by default, failing
the macOS release build with MSB3733 on SDK 11.

Co-Authored-By: Lykos (Opus 5.5) <noreply@lykos.ai>
@mohnjiles
mohnjiles merged commit 3e85ca6 into main Nov 24, 2026
3 checks passed
@mohnjiles
mohnjiles deleted the fix/macos-plist-dtd branch November 24, 2026 02:27
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants