-
Notifications
You must be signed in to change notification settings - Fork 128
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
Linker fails for F# projects in .NET 5+ #1448
Labels
Milestone
Comments
/cc @marek-safar |
jonathanpeppers
added a commit
to dotnet/android
that referenced
this issue
Sep 2, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6 Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for `netstandard2.0` and published to an internal feed. We should be able to enable F# tests under a `dotnet` context now. The `_RemoveLegacyDesigner` MSBuild target was running, when it shouldn't be for F# projects and adding a `Resource.designer.cs` `@(Compile)` item. I needed to add a `$(Language)` check. One workaround is for: dotnet/sdk#12954 We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F# projects at the moment. The second workaround is for: dotnet/linker#1448 F# generics are causing an NRE in the linker.
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this issue
Jan 28, 2022
Fixes: dotnet/runtime#64269 An F# test was failing in AOT builds with: Microsoft.Android.Sdk.Aot.targets(74,5): Precompiling failed for C:\src\xamarin-android\bin\TestDebug\temp\BuildBasicApplicationFSharpTrue\obj\Release\android-arm\aot-in\FSharp.Core.resources.dll. AOT of image obj\Release\android-arm\aot-in\FSharp.Core.resources.dll failed. Mono Ahead of Time compiler - compiling assembly C:\src\xamarin-android\bin\TestDebug\temp\BuildBasicApplicationFSharpTrue\obj\Release\android-arm\aot-in\FSharp.Core.resources.dll AOTID 302CA46D-4000-DCAD-1A9F-642D849470DE Using profile data file 'C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\targets\dotnet.aotprofile' Added 0 methods from profile. Compiled: 0/0 Executing the native assembler: "C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\tools\binutils\arm-linux-androideabi-as" -mfpu=vfp3 -o obj\Release\android-arm\aot\armeabi-v7a\FSharp.Core.resources\temp.s.o obj\Release\android-arm\aot\armeabi-v7a\FSharp.Core.resources\temp.s Executing the native linker: "C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\tools\binutils\arm-linux-androideabi-ld" -Bsymbolic -shared -o obj\Release\android-arm\aot\FSharp.Core.resources.dll.so.tmp obj\Release\android-arm\aot\armeabi-v7a\FSharp.Core.resources\temp.s.o Stripping the binary: "C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\tools\binutils\arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj\Release\android-arm\aot\FSharp.Core.resources.dll.so.tmp [C:\src\xamarin-android\bin\TestDebug\temp\BuildBasicApplicationFSharpTrue\UnnamedProject.fsproj] It turns out we shouldn't be passing satellite assemblies to the AOT compiler, they appear to be included in `@(ResolvedFileToPublish)`: <ItemGroup> <_AndroidAotInputs Include="@(ResolvedFileToPublish)" Condition=" '%(Extension)' == '.dll' " /> </ItemGroup> Viewing these assemblies, I see the metadata `%(ResolvedFileToPublish.AssetType)` is equal to `resources`. I think we can simply check for this and ignore these files. The F# test I parameterized to include an AOT build. I also removed a `TODO` on F# tests, since this is fixed now: dotnet/linker#1448
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this issue
Jan 31, 2022
Fixes: dotnet/runtime#64269 An F# test was failing in AOT builds with: Microsoft.Android.Sdk.Aot.targets(74,5): Precompiling failed for C:\src\xamarin-android\bin\TestDebug\temp\BuildBasicApplicationFSharpTrue\obj\Release\android-arm\aot-in\FSharp.Core.resources.dll. AOT of image obj\Release\android-arm\aot-in\FSharp.Core.resources.dll failed. Mono Ahead of Time compiler - compiling assembly C:\src\xamarin-android\bin\TestDebug\temp\BuildBasicApplicationFSharpTrue\obj\Release\android-arm\aot-in\FSharp.Core.resources.dll AOTID 302CA46D-4000-DCAD-1A9F-642D849470DE Using profile data file 'C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\targets\dotnet.aotprofile' Added 0 methods from profile. Compiled: 0/0 Executing the native assembler: "C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\tools\binutils\arm-linux-androideabi-as" -mfpu=vfp3 -o obj\Release\android-arm\aot\armeabi-v7a\FSharp.Core.resources\temp.s.o obj\Release\android-arm\aot\armeabi-v7a\FSharp.Core.resources\temp.s Executing the native linker: "C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\tools\binutils\arm-linux-androideabi-ld" -Bsymbolic -shared -o obj\Release\android-arm\aot\FSharp.Core.resources.dll.so.tmp obj\Release\android-arm\aot\armeabi-v7a\FSharp.Core.resources\temp.s.o Stripping the binary: "C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\tools\binutils\arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj\Release\android-arm\aot\FSharp.Core.resources.dll.so.tmp [C:\src\xamarin-android\bin\TestDebug\temp\BuildBasicApplicationFSharpTrue\UnnamedProject.fsproj] It turns out we shouldn't be passing satellite assemblies to the AOT compiler, they appear to be included in `@(ResolvedFileToPublish)`: <ItemGroup> <_AndroidAotInputs Include="@(ResolvedFileToPublish)" Condition=" '%(Extension)' == '.dll' " /> </ItemGroup> Viewing these assemblies, I see the metadata `%(ResolvedFileToPublish.AssetType)` is equal to `resources`. I think we can simply check for this and ignore these files. The F# test I parameterized to include an AOT build. I also removed a `TODO` on F# tests, since this is fixed now: dotnet/linker#1448
jonathanpeppers
added a commit
to dotnet/android
that referenced
this issue
Jan 31, 2022
Fixes: dotnet/runtime#64269 An F# test was failing in AOT builds with: Microsoft.Android.Sdk.Aot.targets(74,5): Precompiling failed for C:\src\xamarin-android\bin\TestDebug\temp\BuildBasicApplicationFSharpTrue\obj\Release\android-arm\aot-in\FSharp.Core.resources.dll. AOT of image obj\Release\android-arm\aot-in\FSharp.Core.resources.dll failed. Mono Ahead of Time compiler - compiling assembly C:\src\xamarin-android\bin\TestDebug\temp\BuildBasicApplicationFSharpTrue\obj\Release\android-arm\aot-in\FSharp.Core.resources.dll AOTID 302CA46D-4000-DCAD-1A9F-642D849470DE Using profile data file 'C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\targets\dotnet.aotprofile' Added 0 methods from profile. Compiled: 0/0 Executing the native assembler: "C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\tools\binutils\arm-linux-androideabi-as" -mfpu=vfp3 -o obj\Release\android-arm\aot\armeabi-v7a\FSharp.Core.resources\temp.s.o obj\Release\android-arm\aot\armeabi-v7a\FSharp.Core.resources\temp.s Executing the native linker: "C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\tools\binutils\arm-linux-androideabi-ld" -Bsymbolic -shared -o obj\Release\android-arm\aot\FSharp.Core.resources.dll.so.tmp obj\Release\android-arm\aot\armeabi-v7a\FSharp.Core.resources\temp.s.o Stripping the binary: "C:\Program Files\dotnet\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-ci.dotnet-release-aot-by-default.36\tools\binutils\arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj\Release\android-arm\aot\FSharp.Core.resources.dll.so.tmp [C:\src\xamarin-android\bin\TestDebug\temp\BuildBasicApplicationFSharpTrue\UnnamedProject.fsproj] It turns out we shouldn't be passing satellite assemblies to the AOT compiler, they appear to be included in `@(ResolvedFileToPublish)`: <ItemGroup> <_AndroidAotInputs Include="@(ResolvedFileToPublish)" Condition=" '%(Extension)' == '.dll' " /> </ItemGroup> Viewing these assemblies, I see the metadata `%(ResolvedFileToPublish.AssetType)` is equal to `resources`. I think we can simply check for this and ignore these files. The F# test I parameterized to include an AOT build. I also removed a `TODO` on F# tests, since this is fixed now: dotnet/linker#1448
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context: dotnet/android#5040
Some F# tests we have that use the linker fail with:
I think this may have been introduced here: 095f30a
It might be related to F# generics, maybe their types do not include a ` character?
The text was updated successfully, but these errors were encountered: