-
Notifications
You must be signed in to change notification settings - Fork 830
Closed
Labels
Area-LibraryIssues for FSharp.Core not covered elsewhereIssues for FSharp.Core not covered elsewhereFeature RequestImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone
Description
Is your feature request related to a problem? Please describe.
When I trim a simple F# project, the size of FSharp.Core is unchanged. When I manually enable trimming it and after removing the optimization and signature data, its size shrunk by five, from 1.09 MB to 197 KB.
Describe the solution you'd like
Providing these size savings out of the box and in a safe way would be great. The following things need to happen:
- Ensure that the optimization and signature data are removed by the trimmer. This can happen very easily by embedding an
ILLink.Substitutions.xmlfile to the library. If these files are indeed only used at compile time, I can submit a PR. - The library's usage of reflection has to be audited, and the appropriate attributes must be applied to avoid any unpleasant surprises. If the trimmer does not recignize these attributes by name, we would have to multi-target
FSharp.Coreto .NET 5+.- After that, adding
[<assembly: AssemblyMetadata("IsTrimmable", "True")>]will ensure thatFSharp.Corewill get trimmed.
- After that, adding
I am not sure whether the first bullet point requires the second.
Describe alternatives you've considered
N/A
Additional context
This issue is not about making F# in general friendly to trimming or AOT, but about the minimum required work to make just FSharp.Core trimmable.
kerams, charlesroddie, Deide and smasher164
Metadata
Metadata
Assignees
Labels
Area-LibraryIssues for FSharp.Core not covered elsewhereIssues for FSharp.Core not covered elsewhereFeature RequestImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Type
Projects
Status
Done