[assembly-preparer] Only run RegistrarRemovalTrackingStep if the platform assembly is trimmed.#25941
Conversation
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #ddbaeb3] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [PR Build #ddbaeb3] Build passed (Build packages) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #ddbaeb3] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
…form assembly is trimmed. RegistrarRemovalTrackingStep computes whether the dynamic registrar can be removed and reports the result to MSBuild as the DynamicRegistrationSupported feature switch. The dynamic registrar lives in the platform assembly, which is an SDK assembly that's only trimmed when trimming is enabled; so when nothing is being trimmed the dynamic registrar can't be removed and there's nothing for the step to compute. Don't add the step to the assembly-preparer's step list in that case (in addition to the existing skip when the user explicitly set $(DynamicRegistrationSupported)). This avoids unnecessary work when building without trimming. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ddbaeb3 to
837a649
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR optimizes the assembly-preparer pipeline by skipping RegistrarRemovalTrackingStep when no assemblies are being trimmed, since the dynamic registrar (in the platform SDK assembly) can’t be removed unless trimming is enabled.
Changes:
- Gate
RegistrarRemovalTrackingStepbehindApplication.AreAnyAssembliesTrimmed(and still skip when$(DynamicRegistrationSupported)is user-specified). - Add a unit test asserting that no
ObjCRuntime.Runtime.DynamicRegistrationSupportedruntimeconfig feature switch is emitted when link mode isNone.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tools/assembly-preparer/AssemblyPreparer.cs | Skips adding RegistrarRemovalTrackingStep when trimming is not happening. |
| tests/dotnet/UnitTests/DynamicRegistrationSupportedTest.cs | Adds a regression test ensuring the feature switch isn’t emitted when the platform assembly won’t be trimmed. |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build #837a649] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 199 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
RegistrarRemovalTrackingStep computes whether the dynamic registrar can be
removed and reports the result to MSBuild as the DynamicRegistrationSupported
feature switch. The dynamic registrar lives in the platform assembly, which is
an SDK assembly that's only trimmed when trimming is enabled; so when nothing is
being trimmed the dynamic registrar can't be removed and there's nothing for the
step to compute.
Don't add the step to the assembly-preparer's step list in that case (in
addition to the existing skip when the user explicitly set
$(DynamicRegistrationSupported)). This avoids unnecessary work when building
without trimming.
🤖 Pull request created by Copilot