Skip to content

ILLink.LinkAttributes.xml and ILLink.Substitutions.xml refer to non-existent entities #15261

Open

Description

@cmeeren

I have an Android C# project that depends on F# projects. When I compile the Android C# project in release mode, I get these warnings:

21>resource ILLink.LinkAttributes.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(74,6): Warning IL2008 : FSharp.Core: Could not resolve type 'Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(3,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpOptimizationCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(5,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpSignatureCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.LinkAttributes.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(74,6): Warning IL2008 : FSharp.Core: Could not resolve type 'Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(3,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpOptimizationCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(5,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpSignatureCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.LinkAttributes.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(74,6): Warning IL2008 : FSharp.Core: Could not resolve type 'Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(3,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpOptimizationCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(5,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpSignatureCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.LinkAttributes.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(74,6): Warning IL2008 : FSharp.Core: Could not resolve type 'Microsoft.FSharp.Core.FSharpInterfaceDataVersionLiteralAttribute'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(3,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpOptimizationCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.
21>resource ILLink.Substitutions.xml in FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a(5,6): Warning IL2040 : FSharp.Core: Could not find embedded resource 'FSharpSignatureCompressedData.FSharp.Core' to remove in assembly 'FSharp.Core'.

It therefore seems like ILLink.LinkAttributes.xml and ILLink.Substitutions.xml are not fully up to date, and refer to non-existent entities in FSharp.Core.

I'm using FSharp.Core 7.0.300.

Activity

  1. added this to the Backlog milestone on May 25, 2023
  2. vzarytovskii commented on May 25, 2023

    @vzarytovskii
    Member

    This is kind of by design, since these resources can or cannot be in the assembly, depending on its version and the way it's being distributed - dotnet/runtime#78034

    Until we find a proper way of generating xml configs for illink for FSharp.Core, this warning should be suppressed.

  3. added
    Impact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.
    and removed on Jun 5, 2023
  4. thomhurst commented on Nov 3, 2026

    @thomhurst

    Still reproducible with FSharp.Core 10.1.403 and .NET SDK 10.0.403 on macOS arm64: publishing a minimal F# library consumed by a C# application with dotnet publish -c Release -p:PublishTrimmed=true emits IL2040 for FSharpOptimizationInfo.FSharp.Core, FSharpSignatureInfo.FSharp.Core, FSharpOptimizationDataB.FSharp.Core, and FSharpSignatureDataB.FSharp.Core.

    The F# library only returns an async { do! Async.Sleep 10 } value. The application references that library and executes the value. Expected: trimming completes without descriptors naming nonexistent resources. The same resource entries remain in src/FSharp.Core/ILLink.Substitutions.xml on main. Please make removal of optional resources tolerate their absence.

    Found while validating TUnit #7526.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.Tracking-External

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions