Cannot AOT compile trimmed FSharp.Core
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp, fsharp, ios
- Domain
- build-system, mobile
Research direction
Start with the kerams/fsharp-ios-aot reproduction and the two F# type usages in App.axaml.cs. Compare the Release build with TrimMode copyused enabled against the workaround in Theme.iOS.csproj, then inspect the reported AOT failures for FSharp.Core. Done means the Release iOS AOT build succeeds with copyused trimming enabled without disabling trimming for FSharp.Core.
Written by the indexing model from the issue text.
Description
Apple platform
iOS
Framework version
net10.0-*
Affected platform version
VS 17.14.5, 10.0.100-preview.5.25277.114, 18.4.10622-net10-p5
Description
Similar to https://github.com/dotnet/macios/issues/14813
AOT builds fail when copyused trimming is enabled for FSharp.Core.
1>... Microsoft.iOS.Sdk.net10.0_18.4\18.4.10622-net10-p5\targets\Xamarin.Shared.Sdk.targets(1284,3): error : Failed to AOT compile aot-instances.dll, the AOT compiler exited with code 1.
1>... Microsoft.iOS.Sdk.net10.0_18.4\18.4.10622-net10-p5\targets\Xamarin.Shared.Sdk.targets(1284,3): error : Failed to AOT compile FSharp.Core.dll, the AOT compiler exited with code 1.
Steps to Reproduce
https://github.com/kerams/fsharp-ios-aot
There are 2 lines that use F# types in App.axaml.cs.
Try to compile in Release, see errors. Then remove TrimMode copyused and uncomment IsTrimmable in Theme.iOS.csproj. Complile successfully.
Did you find any workaround?
Disable trimming for FSharp.Core completely with
<ManagedAssemblyToLink Condition="'%(Filename)' == 'FSharp.Core'">
<IsTrimmable>false</IsTrimmable>
</ManagedAssemblyToLink>
Build logs
No response
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area-System.Reflection blocking-clean-ci-optional Known Build Error os-mac-os-x untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
area-VM-meta-mono untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·