Repository navigation
[browser][CoreCLR] Root UnloadableAssembly so trimmed builds keep it for AssemblyGetForwardedTypesLoadFailure - #134759
Merged
Merged
Conversation
AssemblyGetForwardedTypesLoadFailure relies on UnloadableAssembly.dll existing so loading it throws BadImageFormatException. ILLink dropped it under aggressive trimming because its only reference is a type forwarder. Contributes to #134263 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @steveisok, @dotnet/area-system-reflection |
The Apple CoreCLR failure came from trimming dropping UnloadableAssembly, which the ILLink descriptor now roots on all platforms. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run runtime-ioslikesimulator |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Member
Author
|
/azp run runtime-ioslikesimulator |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
jkotas
reviewed
Sep 28, 2026
lewing
commented
Sep 28, 2026
jkotas
approved these changes
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the forwarded-types half of #134263 and re-enables
AssemblyGetForwardedTypesLoadFailureon browser aggressive-trimming builds.Cause:
ForwardedTypesAssemblycontains[assembly: TypeForwardedTo(typeof(TypeInUnloadableAssembly))].UnloadableAssemblyhas[assembly: ReferenceAssembly], and that attribute is why loading it throws theBadImageFormatExceptionthe test expects. The type forwarder is the only reference toUnloadableAssembly, so ILLink removedUnloadableAssembly.dllfrom the trimmed output and shipped only its.pdb.GetForwardedTypesthen fails because the file is missing, not withBadImageFormatException, sofoundBifExceptionis false.Fix: Root
UnloadableAssemblyin the test'sILLink.Descriptors.xml. The assembly is then kept along with itsReferenceAssemblyAttribute. This PR also removes theActiveIssuefor #134263 on the test.Apple CoreCLR: This PR also removes the Apple mobile CoreCLR
ActiveIssuefor #124344, which #129226 added becauseGetForwardedTypes()failed on trimmed Apple CoreCLR app bundles. The cause is likely the same: Apple CoreCLR lanes build withEnableAggressiveTrimming=true, and the descriptor applies on all platforms. This still needs validation in runtime-extra-platforms (ioslikesimulator).Android: The Android
ActiveIssuefor #77821 stays. Android lanes aren't trimmed today, and #77821 predates CoreCLR on Android.Validation: browser-wasm, CoreCLR, Release.
EnableAggressiveTrimming=true TestTrimming=true(no R2R).EnableAggressiveTrimming=true TestWasmReadyToRun=true, Chrome): 1773 tests, 1749 passed, 24 skipped, 0 failed.AssemblyGetForwardedTypesLoadFailurewas among the passing tests.Scope: This PR does not resolve #134263. The MetadataLoadContext MarshalAs half is a Cecil bug. When ILLink rewrites assemblies, it drops the IidParameterIndex for IDispatch/IUnknown/Interface and the SafeArray user-defined subtype from FieldMarshal blobs (confirmed byte-for-byte). That needs a fix in dotnet/cecil, so the existing
TrimMode=copyworkaround inSystem.Reflection.MetadataLoadContext.Tests.csprojstays.Contributes to #134263
Note
This PR was generated with GitHub Copilot assistance.