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

Precompiling failed error after enabling LLVM on Android release builds #92031

Closed
phillipturner opened this issue Sep 8, 2023 · 8 comments · Fixed by #92356
Closed

Precompiling failed error after enabling LLVM on Android release builds #92031

phillipturner opened this issue Sep 8, 2023 · 8 comments · Fixed by #92356
Assignees
Milestone

Comments

@phillipturner
Copy link

Description

Unable to run Android release builds after enabling LLVM

Error List

Steps to Reproduce

  1. Create a new MAUI project
  2. Enable the option to Use LLVM optimising compiler for Release & net8.0-android
  3. Run release build for Android

Link to public reproduction project repository

https://github.com/phillipjt/maui-reproductions/tree/llvm-precompiling-failed

Version with bug

8.0.0-preview.7.8842

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.86

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

1>[_Microsoft.Android.Resource.Designer.dll] Exec (with response file contents expanded) in C:\Repositories\maui-reproductions\SampleApp\SampleApp: MONO_PATH=C:\Repositories\maui-reproductions\SampleApp\SampleApp\obj\Release\net8.0-android\android-arm\linked; MONO_ENV_OPTIONS= C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.0-preview.7.23375.6\Sdk\..\tools\mono-aot-cross.exe --debug --llvm "--aot=asmwriter,temp-path=obj\Release\net8.0-android\android-arm\aot\armeabi-v7a\_Microsoft.Android.Resource.Designer,profile-only,profile=C:\Nuget\microsoft.maui.controls.build.tasks\8.0.0-preview.7.8842\buildTransitive\netstandard2.0\maui.aotprofile,profile=C:\Nuget\microsoft.maui.controls.build.tasks\8.0.0-preview.7.8842\buildTransitive\netstandard2.0\maui-blazor.aotprofile,nodebug,llvm-path=C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.0-preview.7.23375.6\Sdk\..\tools,mtriple=armv7-linux-gnueabi,tool-prefix=C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\tools\binutils\bin\arm-linux-androideabi-,outfile=obj\Release\net8.0-android\android-arm\aot\_Microsoft.Android.Resource.Designer.dll.so,llvm-outfile=obj\Release\net8.0-android\android-arm\aot\_Microsoft.Android.Resource.Designer.dll-llvm.o,temp-path=obj\Release\net8.0-android\android-arm\_Microsoft.Android.Resource.Designer.dll.tmp,ld-name=ld,ld-flags=\"C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\tools\libstubs\android-arm\libc.so\";\"C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\tools\libstubs\android-arm\libm.so\" --no-relax -s" "obj\Release\net8.0-android\android-arm\linked\_Microsoft.Android.Resource.Designer.dll"
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for C:\Repositories\maui-reproductions\SampleApp\SampleApp\obj\Release\net8.0-android\android-arm\linked\_Microsoft.Android.Resource.Designer.dll with exit code 1.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : The system cannot find the file specified.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOT of image C:\Repositories\maui-reproductions\SampleApp\SampleApp\obj\Release\net8.0-android\android-arm\linked\_Microsoft.Android.Resource.Designer.dll failed.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly C:\Repositories\maui-reproductions\SampleApp\SampleApp\obj\Release\net8.0-android\android-arm\linked\_Microsoft.Android.Resource.Designer.dll
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID 40A9BA1C-82AE-5CB2-92C4-E5B57ED51BDA
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Nuget\microsoft.maui.controls.build.tasks\8.0.0-preview.7.8842\buildTransitive\netstandard2.0\maui.aotprofile'
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Nuget\microsoft.maui.controls.build.tasks\8.0.0-preview.7.8842\buildTransitive\netstandard2.0\maui-blazor.aotprofile'
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Added 0 methods from profile.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Added 0 methods from profile.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.7.382\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Executing opt: "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.0-preview.7.23375.6\Sdk\..\tools\opt" -f -disable-tail-calls -passes='default<O2>,place-safepoints' -spp-all-backedges -o "obj\Release\net8.0-android\android-arm\_Microsoft.Android.Resource.Designer.dll.tmp\temp.opt.bc" "obj\Release\net8.0-android\android-arm\_Microsoft.Android.Resource.Designer.dll.tmp\temp.bc"
@pulmuone
Copy link

same issue

@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on Android 13.0-API33(8.0.0-preview.7.8842), not repro on Windows 11 with below Project:
SampleApp.zip

@samhouts
Copy link
Member

@dellis1972?

@dellis1972
Copy link

Hmm

this command

 "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm64\8.0.0-preview.7.23375.6\Sdk\..\tools\opt" -f -disable-tail-calls -passes='default<O2>,place-safepoints' -spp-all-backedges -o "obj\Release\net8.0-android\android-arm64\Microsoft.Extensions.DependencyInjection.dll.tmp\temp.opt.bc" "obj\Release\net8.0-android\android-arm64\Microsoft.Extensions.DependencyInjection.dll.tmp\temp.bc"

is failing becuase temp.opt.bc does not exist. temp.bc and temp.s do however.
This looks more like an issue in the Aot compiler side I think.

@samhouts samhouts transferred this issue from dotnet/maui Sep 13, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Sep 13, 2023
@SamMonoRT
Copy link
Member

@directhex @fanyang-mono @jonathanpeppers - any insights ?

@directhex
Copy link
Contributor

Looks like mono-aot-cross.exe failed, which is why opt couldn't find the intermediate file it produced?

@steveisok
Copy link
Member

@directhex could it be that we are running Sdk\..\tools\opt instead of Sdk\..\tools\opt.exe ?

@steveisok steveisok added this to the 8.0.0 milestone Sep 20, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Sep 20, 2023
@directhex
Copy link
Contributor

Seems the problem is it's trying to execute opt not opt.exe - that's not valid for Windows. We need to explicitly use the .exe app names on Windows.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Sep 20, 2023
steveisok pushed a commit that referenced this issue Sep 21, 2023
This avoids calling `opt` and `llc` on Windows, where the .exe extension is needed

Closes: #92031
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Sep 21, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants