Skip to content
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

[net6] Using LLVM for ios-arm fails #12546

Closed
spouliot opened this issue Aug 25, 2021 · 6 comments
Closed

[net6] Using LLVM for ios-arm fails #12546

spouliot opened this issue Aug 25, 2021 · 6 comments
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri2 .NET 6: want to have for stable release iOS Issues affecting Xamarin.iOS
Milestone

Comments

@spouliot
Copy link
Contributor

Steps to Reproduce

  1. Checkout release/6.0.1xx-rc.1 (have not tried on main but it's likely the same)

  2. Apply this diff

diff --git a/tests/dotnet/Makefile b/tests/dotnet/Makefile
index cb6f96212..61aee264d 100644
--- a/tests/dotnet/Makefile
+++ b/tests/dotnet/Makefile
@@ -50,10 +50,10 @@ build-oldnet:
        $(SYSTEM_MSBUILD) $(XBUILD_VERBOSITY) size-comparison/MySingleView/oldnet/MySingleView.csproj $(COMMON_ARGS) /bl:$@.binlog $(MSBUILD_VERBOSITY)
 
 build-dotnet: $(TARGETS)
-       $(DOTNET6) build size-comparison/MySingleView/dotnet/MySingleView.csproj --runtime ios-arm64 /p:MtouchUseLlvm=true $(COMMON_ARGS) /bl:$@.binlog $(MSBUILD_VERBOSITY)
+       $(DOTNET6) build size-comparison/MySingleView/dotnet/MySingleView.csproj /p:MtouchUseLlvm=true $(COMMON_ARGS) /bl:$@.binlog $(MSBUILD_VERBOSITY)
 
 run-dotnet: $(TARGETS)
-       $(DOTNET6) build -t:Run size-comparison/MySingleView/dotnet/MySingleView.csproj --runtime ios-arm64 /p:MtouchUseLlvm=true $(COMMON_ARGS)
+       $(DOTNET6) build -t:Run size-comparison/MySingleView/dotnet/MySingleView.csproj /p:MtouchUseLlvm=true $(COMMON_ARGS)
 
 # this will break the signature, so app won't run anymore. Use it only to compare final size w/legacy
 # https://github.com/xamarin/xamarin-macios/issues/11445
diff --git a/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj b/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj
index 03153d664..5f8c25d75 100644
--- a/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj
+++ b/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj
@@ -2,7 +2,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <TargetFramework>net6.0-ios</TargetFramework>
-    <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
+    <RuntimeIdentifier>ios-arm</RuntimeIdentifier>
     <OutputType>Exe</OutputType>
   </PropertyGroup>
   <ItemGroup>
  1. cd tests/dotnet/ then make build-dotnet`

Expected Behavior

Successful build

Actual Behavior

make build-dotnet
cp -c ../../global6.json global.json
/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/dotnet build size-comparison/MySingleView/dotnet/MySingleView.csproj /p:MtouchUseLlvm=true /p:Platform=iPhone /p:Configuration=Release /bl:build-dotnet.binlog /nologo /verbosity:quiet
/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/sdk/6.0.100-rc.1.21422.7/MSBuild.dll /nologo -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/sdk/6.0.100-rc.1.21422.7/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/sdk/6.0.100-rc.1.21422.7/dotnet.dll -maxcpucount -property:MtouchUseLlvm=true -property:Platform=iPhone -property:Configuration=Release -restore -verbosity:m /verbosity:quiet /bl:build-dotnet.binlog size-comparison/MySingleView/dotnet/MySingleView.csproj
/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/packs/Microsoft.iOS.Sdk/15.0.100-rc.1.516/targets/Xamarin.Shared.Sdk.targets(805,3): error : Failed to AOT compile System.Runtime.dll, the AOT compiler exited with code 1 [/Users/poupou/git/net6/rc1/xamarin-macios/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj]
/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/packs/Microsoft.iOS.Sdk/15.0.100-rc.1.516/targets/Xamarin.Shared.Sdk.targets(805,3): error : Failed to AOT compile MySingleView.dll, the AOT compiler exited with code 1 [/Users/poupou/git/net6/rc1/xamarin-macios/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj]
/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/packs/Microsoft.iOS.Sdk/15.0.100-rc.1.516/targets/Xamarin.Shared.Sdk.targets(805,3): error : Failed to AOT compile Xamarin.iOS.dll, the AOT compiler exited with code 1 [/Users/poupou/git/net6/rc1/xamarin-macios/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj]
/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/packs/Microsoft.iOS.Sdk/15.0.100-rc.1.516/targets/Xamarin.Shared.Sdk.targets(805,3): error : Failed to AOT compile System.Private.CoreLib.dll, the AOT compiler exited with code 1 [/Users/poupou/git/net6/rc1/xamarin-macios/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj]

Build FAILED.

/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/packs/Microsoft.iOS.Sdk/15.0.100-rc.1.516/targets/Xamarin.Shared.Sdk.targets(805,3): error : Failed to AOT compile System.Runtime.dll, the AOT compiler exited with code 1 [/Users/poupou/git/net6/rc1/xamarin-macios/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj]
/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/packs/Microsoft.iOS.Sdk/15.0.100-rc.1.516/targets/Xamarin.Shared.Sdk.targets(805,3): error : Failed to AOT compile MySingleView.dll, the AOT compiler exited with code 1 [/Users/poupou/git/net6/rc1/xamarin-macios/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj]
/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/packs/Microsoft.iOS.Sdk/15.0.100-rc.1.516/targets/Xamarin.Shared.Sdk.targets(805,3): error : Failed to AOT compile Xamarin.iOS.dll, the AOT compiler exited with code 1 [/Users/poupou/git/net6/rc1/xamarin-macios/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj]
/Users/poupou/git/net6/rc1/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-rc.1.21422.7-osx-x64/packs/Microsoft.iOS.Sdk/15.0.100-rc.1.516/targets/Xamarin.Shared.Sdk.targets(805,3): error : Failed to AOT compile System.Private.CoreLib.dll, the AOT compiler exited with code 1 [/Users/poupou/git/net6/rc1/xamarin-macios/tests/dotnet/size-comparison/MySingleView/dotnet/MySingleView.csproj]
    0 Warning(s)
    4 Error(s)

Time Elapsed 00:00:26.53

Environment

This was tested on the 2f30a4676954de83da23c27cef102456f505903d of branch: release/6.0.1xx-rc.1

Build Logs

build-dotnet.binlog.zip

Example Project (If Possible)

In repo

@spouliot spouliot added iOS Issues affecting Xamarin.iOS dotnet An issue or pull request related to .NET (6) dotnet-pri2 .NET 6: want to have for stable release labels Aug 25, 2021
@spouliot spouliot added this to the .NET 6 milestone Aug 25, 2021
@spouliot
Copy link
Contributor Author

This was found trying a fat app - and that make those fails since LLVM is a global [1] setting.

[1] maybe it should not be ? there's nothing that should stop only one of the slice to be built with LLVM while the other is not.

@rolfbjarne
Copy link
Member

This is filed here: dotnet/runtime#58112

@filipnavara
Copy link
Contributor

This was fixed on the dotnet/runtime side, correct LLVM option will be used after next runtime bump.

@filipnavara
Copy link
Contributor

Should be fixed now.

@rolfbjarne
Copy link
Member

Confirmed; this is fixed now.

@spouliot
Copy link
Contributor Author

spouliot commented Sep 8, 2021

It's also fixed inside the release/6.0.1xx-rc.1 so we can build release fat apps with LLVM
https://gist.github.com/spouliot/e487514f4376d44823e81829fc44a521

@ghost ghost locked as resolved and limited conversation to collaborators Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri2 .NET 6: want to have for stable release iOS Issues affecting Xamarin.iOS
Projects
None yet
Development

No branches or pull requests

3 participants