Skip to content

Undo the ILLink/ILC enum-field substitution workaround from #26371 once dotnet/runtime#131601 is fixed #26390

Description

@rolfbjarne

Background

PR #26371 works around an incompatibility between ILLink and ILC (NativeAOT) in how they parse the substitution value for an enum-typed field in ILLink.Substitutions.xml:

Tool Accepted value
ILLink the enum member's name (e.g. DEVICE / SIMULATOR)
ILC the numeric value (e.g. 0 / 1)

There is no single value that works for both, and each reports IL2015 for the other's format. This surfaced on .NET 11 with NativeAOT, where ILLink is skipped entirely and ILC parses our substitution XML itself for the first time.

This is tracked upstream as dotnet/runtime#131601.

The workaround to undo

In PR #26371 we specified both variants of the ObjCRuntime.Runtime.Arch field substitution, in two separate <type> blocks selected by a new ObjCRuntime.IsILCompiler feature switch, and pass --feature:ObjCRuntime.IsILCompiler=true only to ILC.

Once dotnet/runtime#131601 is fixed (i.e. ILLink and ILC agree on the accepted substitution value format), we should undo the workaround:

  • Remove the duplicated <type ... feature="ObjCRuntime.IsILCompiler" ...> blocks in src/ILLink.Substitutions.iOS.xml and src/ILLink.Substitutions.tvOS.xml (and any others that gained them), keeping a single Arch field substitution with whichever value both tools accept.
  • Remove the --feature:ObjCRuntime.IsILCompiler=true IlcArg from _XamarinComputeIlcCompileInputs in dotnet/targets/Xamarin.Shared.Sdk.targets, along with the now-unused ObjCRuntime.IsILCompiler feature switch plumbing.

Validation

Ensure tests/dotnet/MySimpleApp/{iOS,tvOS} still publish cleanly both with and without -p:PublishAot=true, including the configuration where both ILLink and ILC process the XML.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions