Skip to content

[R2R] Apply --resilient consistently to recoverable compilation failures #132338

Description

@agocke

Problem

Crossgen2 has several places where TypeSystemException or code-generation failures are caught so ReadyToRun compilation can omit affected methods or dependencies and fall back to runtime JIT. These catches are currently inconsistent:

  • some are unconditional
  • some are gated by --resilient
  • most dependency-discovery catches silently skip work
  • the SDK does not currently enable --resilient by default

This makes the direct Crossgen2 CLI and SDK-driven ReadyToRun publishing difficult to reason about, and recoverable missing-reference failures may either terminate compilation or be silently ignored depending on where they occur.

Proposed follow-up

  • plumb the --resilient setting through R2R root providers and dependency-analysis nodes
  • gate catches that intentionally omit R2R methods or dependencies on that setting
  • produce actionable warnings when resilient compilation skips code or dependency discovery
  • decide whether SDK/MSBuild ReadyToRun publishing should pass --resilient by default while preserving explicit fail-fast behavior for direct Crossgen2 invocation
  • keep profile parsing and best-effort metadata lookup behavior separate from compilation/de-optimization policy

The immediate missing-interface-signature crash is addressed separately by #132337.

Note

This issue was generated with GitHub Copilot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-ReadyToRununtriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions