-
Notifications
You must be signed in to change notification settings - Fork 129
Automagically remove F# compilation resources #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automagically remove F# compilation resources #329
Comments
I think we need an option to preserve the resources as @praeclarum's Continuous IDE does do F# compilation on device. That's the only app that I am aware of that might break. |
Yes. I'm still amazed that works. We could recommend that that app bundle a private copy of FSharp.Core but I'm also ok with there being an appropriate option |
We can extend the custom linker xml definition to be able to preserve resources as well and remove these by default |
Question: Could/Should this linker functionality be extended to strip the new compressed equivalents of these resources (which have different names?) |
Yes, it should. FSharpSignatureData.* FSharpOptimizationData.* FSharpOptimizationInfo.* |
x.StartsWith("FSharpSignature") || x.StartsWith("FSharpOptimization") Should cover all 10 possibilities. |
The original solution was missing 3 further dimensions of F# resourced: - Being compressed or not - Being part of FSharp.Core (STD lib for F#) or user code - Being original stream or a backwards-compatible stream for newer language features, particulary nullable reference types The full set of supported prefixes currently is: FSharpSignatureData.* FSharpSignatureDataB.* FSharpSignatureCompressedData.* FSharpSignatureCompressedDataB.* FSharpOptimizationData.* FSharpOptimizationDataB.* FSharpOptimizationCompressedData.* FSharpOptimizationCompressedDataB.* FSharpOptimizationInfo.* FSharpSignatureInfo.* This closes dotnet/linker#329
The linker can/should automatically remove any .NET manifest assembly resources named
FSharpSignatureData.*
andFSharpOptimizationData.*
during linking.These are only ever needed for F# compilation which doesn't happen on-device and given the aims of the linker it is reasonable to assume this data is unreachable.
My understanding is that removing these would trim about 1.5MB off the size of all applications using FSharp.Core.dll, and about 3MB off all applications using Elmish.XamarinForms.dll.
Here's an example of how the resources look in ILDASM:
Thanks
The text was updated successfully, but these errors were encountered: