Handle unresolved TypeMap attribute types in Crossgen2 - #133440
Conversation
Decode TypeMap attribute values within the existing TypeSystemException handler so unresolved serialized type names use runtime fallback instead of terminating Crossgen2. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3c9b80dd-d0ce-4a6a-93a8-82c2aaf744f6
|
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. |
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
|
Tagging subscribers to this area: @dotnet/interop-contrib |
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
|
Tagging subscribers to this area: @dotnet/interop-contrib |
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, aligns with the existing exception/fallback design in CreateFromAssembly, and avoids altering behavior outside the intended failure-handling path.
Pull request overview
This PR adjusts TypeMapMetadata.CreateFromAssembly so decoding TypeMap* custom attribute values happens inside the existing TypeSystemException try/catch, allowing Crossgen2 to record the failure and fall back to runtime TypeMap attribute processing instead of terminating.
Changes:
- Moved
attr.DecodeValue(new TypeMapCustomAttributeTypeProvider(...))into thetryblock that already catchesTypeSystemException, so unresolved serialized type names are handled by the fallback path.
File summaries
| File | Description |
|---|---|
| src/coreclr/tools/Common/Compiler/TypeMapMetadata.cs | Moves TypeMap attribute decoding under the existing TypeSystemException handler so unresolved serialized names trigger the existing fallback behavior rather than crashing. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
|
/azp run runtime-coreclr crossgen2 |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/ba-g Unrelated GC test failure on Wasm. |
Decode TypeMap attribute values within the existing TypeSystemException try/catch so unresolved serialized type names use runtime fallback instead of terminating Crossgen2.
I must have been using stale bits for #133038 locally and the TypeMap test failures didn't show up in the AzDO Tests tab because the crossgen build failed before the test could run.