Skip to content

[build] Clean up third-party sources - #13425

Merged
jonathanpeppers merged 1 commit into
mainfrom
simonrozsival-codeanalysis-polyfills
Nov 9, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
simonrozsival-codeanalysis-polyfills

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Context: #13110
Context: dotnet/runtime/main@796e892b

After #13110 removed the signing helpers, src-ThirdParty still contains unused trimming/compiler polyfills and first-party CoreCLR hosting headers. Remove the unused polyfills, their shared netstandard compile entries, and $(ThirdPartySourcePath). Keep the existing nullable-annotation shims and the Android platform-tools sources used for JAR filtering and R.java generation.

Move the CoreCLR headers to src/native/clr/include/runtime/ and update CMake includes and MSBuild native inputs so header changes trigger native rebuilds. The runtime packs do not supply these hosting headers, so local copies remain necessary. coreclrhost.h and README move without content changes; THIRD-PARTY-NOTICES.TXT is unchanged.

Refresh host_runtime_contract.h verbatim from the runtime revision above, including the native-code and structured assembly-resolution callback declarations and new property constants. Explicitly initialize the three new optional callbacks to nullptr to avoid missing-initializer warnings. This does not enable the callbacks or change FastDev assembly resolution.

The previous copy, added in #9572, is byte-identical to the header at dotnet/runtime@22fc4518. All subsequent changes to this header through the pinned revision come from:

Validation

Report/binlog destinations are abbreviated as $RESULTS below.

  • make prepare and make leeroy: passed. Obsolete generated pre-rebase workload manifests were moved aside before the successful make leeroy retry; no source workaround was needed.
  • make all: passed after the header refresh, rebuilding the native host for ARM, ARM64, and x64 in Debug and Release.
  • ./dotnet-local.sh test bin/TestDebug/net11.0/Xamarin.Android.Build.Tests.dll --filter 'FullyQualifiedName~PackagingUtilsTests|FullyQualifiedName~GenerateLibraryResourcesTests|FullyQualifiedName~ManifestDocumentTest|Name~ResourceDesignerBinaryLibraryCompatibility' --logger 'trx;LogFileName=rebased-cleanup-host.trx' --results-directory "$RESULTS/rebased-cleanup-test-results": 19 passed, including both normal and design-time resource-designer binary-compatibility cases.
  • ANDROID_SERIAL=emulator-5588 ./dotnet-local.sh build -t:Install -c Debug tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -p:AndroidRuntime=CoreCLR -p:RuntimeIdentifier=android-arm64 -p:IncludeCategories=RuntimeConfig '-p:AdbTarget=-s emulator-5588' "-bl:$RESULTS/runtime-header-device-install-final.binlog": passed.
  • From tests/Mono.Android-Tests/Mono.Android-Tests, ANDROID_SERIAL=emulator-5588 ../../../dotnet-local.sh test Mono.Android.NET-Tests.csproj --no-build -c Debug -p:AndroidRuntime=CoreCLR -p:RuntimeIdentifier=android-arm64 -p:IncludeCategories=RuntimeConfig '-p:AdbTarget=-s emulator-5588' --report-trx --results-directory "$RESULTS/runtime-header-device-results": 6 passed on an isolated API 35 ARM64 emulator. Other ABIs were compiled but not device-executed.
  • git diff --check and git diff --cached --check: passed. The refreshed contract header matches upstream byte-for-byte; the other relocated files retain their original contents.

Context: #13110
Context: https://github.com/dotnet/runtime/blob/796e892b9fb442e08cae8366c27e2cbde3f08c72/src/native/corehost/host_runtime_contract.h

The remaining src-ThirdParty layout mixes unused trimming/compiler polyfills with first-party CoreCLR hosting headers. Remove the unused sources and ThirdPartySourcePath, and move the hosting headers to src/native/clr/include/runtime. Keep the existing netstandard nullable-annotation shims and the two Android platform-tools sources unchanged.

Update CMake includes and MSBuild native inputs for the relocated headers. Refresh host_runtime_contract.h verbatim from dotnet/runtime/main at 796e892b9fb442e08cae8366c27e2cbde3f08c72. Explicitly initialize the new optional callbacks to nullptr, preserving existing assembly-resolution behavior without introducing missing-initializer warnings. Move coreclrhost.h and README without content changes.

Validation: full SDK builds passed, including ARM/ARM64/x64 native Debug and Release builds; 19 focused host tests and 6 CoreCLR RuntimeConfig tests on an ARM64 API 35 emulator passed.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the polyfill cleanup and CoreCLR hosting-header relocation.

No open issues 🎉

What changed in this PR

Continues #13110’s cleanup by removing unused polyfills and relocating CoreCLR hosting headers into the native runtime source tree. Required nullable shims and Android platform-tools sources remain unchanged.

Changes:

  • Remove unused trimming/compiler polyfills, their shared compile entries, and ThirdPartySourcePath.
  • Relocate CoreCLR headers and update CMake include paths and native incremental-build inputs.
  • Refresh the runtime contract from upstream, leaving the three new optional callbacks disabled.
File Description
src/​Xamarin.Android.NamingCustomAttributes/​Xamarin.Android.NamingCustomAttributes.projitems Remove unused netstandard polyfill compile entries.
src/​native/​native.targets Track relocated headers as native build inputs.
src/​native/​CMakeLists.txt Use the relocated runtime include directory.
src/​native/​clr/​include/​runtime/​README Relocate header provenance guidance unchanged.
src/​native/​clr/​include/​runtime/​host_runtime_contract.h Refresh upstream callback declarations and property constants.
src/​native/​clr/​include/​runtime/​coreclrhost.h Relocate the hosting header unchanged.
src/​native/​clr/​include/​host/​host.hh Explicitly initialize new callbacks to nullptr.
src-ThirdParty/​System.Runtime.CompilerServices/​UnconditionalSuppressMessageAttribute.cs Delete the unused suppression polyfill.
src-ThirdParty/​System.Runtime.CompilerServices/​CompilerFeaturePolyfills.cs Delete unused compiler-feature polyfills.
src-ThirdParty/​System.Diagnostics.CodeAnalysis/​DynamicDependencyAttribute.cs Delete the unused dependency annotation polyfill.
src-ThirdParty/​System.Diagnostics.CodeAnalysis/​DynamicallyAccessedMemberTypes.cs Delete the unused member-types enum polyfill.
src-ThirdParty/​System.Diagnostics.CodeAnalysis/​DynamicallyAccessedMembersAttribute.cs Delete the unused member-access annotation polyfill.
Configuration.props Remove ThirdPartySourcePath.
.github/​skills/​update-tpn/​SKILL.md Remove guidance referring to obsolete vendored directories.

Review effort: Balanced

@jonathanpeppers

Copy link
Copy Markdown
Member

/review

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #13425

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Pending CI — no blocking code findings. Findings: 0 ❌ errors, 0 ⚠️ warnings, 1 💡 non-blocking inline suggestion.

Reviewed all 14 changed files, including the removed polyfills and the surrounding build/runtime consumers. No remaining references to the removed source-path property or old runtime-header directory were found. The relocated include path and native MSBuild inputs agree; the existing contract prefix is preserved, and all three appended callbacks are explicitly null. Independently verified that host_runtime_contract.h has the same Git blob SHA as the pinned dotnet/runtime revision. The Android platform-tools sources and nullable annotation shims remain in use and intact.

CI: GitHub reports 41 checks: 39 successful, the aggregate dotnet-android check queued, and Package Tests macOS > Tests > APKs 1 running for Azure build 1670860. No current failed check was returned. Direct Azure build/timeline queries could not complete because of CLI initialization/authentication errors, so the overall pipeline result is not independently confirmed and this is not a green-CI verdict. No local build or device tests were run as part of this review.

Generated by Android PR Reviewer for #13425 · copilot · gpt61 · 39.5 AIC · ⌖ 8.56 AIC · ⊞ 19.4K
Comment /review to run again

};

// Get native code data for the assembly specified by the supplied context
bool(HOST_CONTRACT_CALLTYPE* get_native_code_data)(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 💡 Documentation — Could we record the pinned upstream revision (796e892b9fb442e08cae8366c27e2cbde3f08c72) for this header in the sibling README? The refreshed file matches that upstream blob exactly, but the README only lists repository-relative paths. Keeping the revision alongside the vendored copy would make the next ABI comparison reproducible without finding this PR description, while leaving the header itself verbatim.

{Rule: Link vendored source to its origin}

@jonathanpeppers
jonathanpeppers merged commit 538260c into main Nov 9, 2026
41 checks passed
@jonathanpeppers
jonathanpeppers deleted the simonrozsival-codeanalysis-polyfills branch November 9, 2026 16:24
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.

3 participants