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

Compiler freezes during build and never finishes #14651

Closed
Confuset opened this issue Jan 23, 2023 · 8 comments
Closed

Compiler freezes during build and never finishes #14651

Confuset opened this issue Jan 23, 2023 · 8 comments

Comments

@Confuset
Copy link

Confuset commented Jan 23, 2023

Hi everyone,

when trying to build a Fabulous.XamarinForms.Templates the compiler freezes.
This happens with Visual Studio 2022 and with msbuild via the commandline.

Repro steps

Requirements from Fabulous.XamarinForms.Templates

Provide the steps required to reproduce the problem:

  1. dotnet new install Fabulous.XamarinForms.Templates
  2. dotnet new fabulous-xf-vswin -n SplitApp
  3. cd SplitApp
  4. msbuild

Expected behavior

The compiler eventually finishes.

Actual behavior

The compiler never finishes. (Had it running for 6.30 hours..)

Known workarounds

Downgrade compiler from v12.0.5 to v12.0.4.

Related information

I already did some research at this Fabulous.XamarinForms ticket fabulous-dev/Fabulous.XamarinForms#20
I even tried git bisect to further pinpoint the issue, but I can not really compile the project with my own compiler due to missing build targets:

"c:\Users\xxx\source\repos\SplitApp\SplitApp.sln" (default target) (1) ->
"c:\Users\xxx\source\repos\SplitApp\SplitApp.Android\SplitApp.Android.fsproj" (default target) (4) ->
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VisualStudio\v17.0\FSharp\Microsoft.FSharp
.Targets(4,3): error MSB4019: The imported project "C:\Users\xxx\source\repos\fsharp\artifacts\bin\fscAny\Debug\net47
2\Microsoft.FSharp.targets" was not found. Confirm that the expression in the Import declaration "C:\Users\xxx\source
\repos\fsharp\artifacts\bin\fscAny\Debug\net472\\Microsoft.FSharp.targets" is correct, and that the file exists on disk
. [c:\Users\xxx\source\repos\SplitApp\SplitApp.Android\SplitApp.Android.fsproj]
  • Operating system: W10
  • .NET Runtime kind: MonoAndroid/Xamarin
  • Editing Tools: Visual Studio 2022
@vzarytovskii
Copy link
Member

vzarytovskii commented Jan 24, 2023

I presume it's a duplicate of #14336 and was fixed in #14497 (which was inserted in 17.5 and 17.6), but I can't yet confirm it, since repro steps don't work for me:

C:\Users\vlza\code\SplitApp\SplitApp.iOS\SplitApp.iOS.fsproj : error  : The imported project "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Xamarin\iOS\Xamarin.iOS.FSharp.targets" was not found. Also, tried to find "Xamarin\iOS\Xamarin.iOS.FSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Users\vlza\AppData\Local\Microsoft\VisualStudio\17.0_382f6079\devenv.exe.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.  C:\Users\vlza\code\SplitApp\SplitApp.iOS\SplitApp.iOS.fsproj

C:\Users\vlza\code\SplitApp\SplitApp.Android\SplitApp.Android.fsproj : error  : The imported project "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Xamarin\Android\Xamarin.Android.FSharp.targets" was not found. Also, tried to find "Xamarin\Android\Xamarin.Android.FSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Users\vlza\AppData\Local\Microsoft\VisualStudio\17.0_382f6079\devenv.exe.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.  C:\Users\vlza\code\SplitApp\SplitApp.Android\SplitApp.Android.fsproj

I guess I'm missing some components in my VS install.

@edgarfgp
Copy link
Contributor

edgarfgp commented Jan 24, 2023

I presume it's a duplicate of #14336 and was fixed in #14497 (which was inserted in 17.5 and 17.6), but I can't yet confirm it, since repro steps don't work for me:

C:\Users\vlza\code\SplitApp\SplitApp.iOS\SplitApp.iOS.fsproj : error  : The imported project "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Xamarin\iOS\Xamarin.iOS.FSharp.targets" was not found. Also, tried to find "Xamarin\iOS\Xamarin.iOS.FSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Users\vlza\AppData\Local\Microsoft\VisualStudio\17.0_382f6079\devenv.exe.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.  C:\Users\vlza\code\SplitApp\SplitApp.iOS\SplitApp.iOS.fsproj

C:\Users\vlza\code\SplitApp\SplitApp.Android\SplitApp.Android.fsproj : error  : The imported project "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Xamarin\Android\Xamarin.Android.FSharp.targets" was not found. Also, tried to find "Xamarin\Android\Xamarin.Android.FSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Users\vlza\AppData\Local\Microsoft\VisualStudio\17.0_382f6079\devenv.exe.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.  C:\Users\vlza\code\SplitApp\SplitApp.Android\SplitApp.Android.fsproj

I guess I'm missing some components in my VS install.

Yes you need those component to be able to build this

@Confuset
Copy link
Author

Yes. You need those components mention in the docs of Fabulous.XamarinForms.Template: https://docs.fabulous.dev/v2/getting-started/#requirements

I updated the reprosteps to point to the docs.

@vzarytovskii
Copy link
Member

Okay, it rebuilds fine on 17.6.0 Preview 1.0 [33323.261.main]:

Rebuild started...
1>------ Rebuild All started: Project: SplitApp, Configuration: Debug Any CPU ------
Restored C:\Users\vlza\code\SplitApp\SplitApp\SplitApp.fsproj (in 11 ms).
1>C:\Program Files\dotnet\sdk\7.0.200-preview.22628.1\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(287,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>SplitApp -> C:\Users\vlza\code\SplitApp\SplitApp\bin\Debug\netstandard2.1\SplitApp.dll
2>------ Rebuild All started: Project: SplitApp.Android, Configuration: Debug Any CPU ------
Pair to Mac is not connected, so the build will be performed offline. To do a full build please connect and try again.
3>------ Rebuild All started: Project: SplitApp.iOS, Configuration: Debug iPhoneSimulator ------
3>		Consider app.config remapping of assembly "netstandard, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" from Version "2.0.0.0" [] to Version "2.1.0.0" [C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades\netstandard.dll] to solve conflict and get rid of warning.
3>C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2352,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
3>		SplitApp.iOS -> C:\Users\vlza\code\SplitApp\SplitApp.iOS\bin\iPhoneSimulator\Debug\SplitApp.iOS.exe
2>		SplitApp.Android -> C:\Users\vlza\code\SplitApp\SplitApp.Android\bin\Debug\SplitApp.Android.dll
2>		C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin\javac.exe -J-Dfile.encoding=UTF8 "@C:\Users\vlza\AppData\Local\Temp\tmpCDB0.tmp" -target 1.8 -source 1.8 
2>		C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin\java.exe -Xmx1G -classpath "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Xamarin\Android\r8.jar" com.android.tools.r8.D8 --debug --min-api 21 --output obj\Debug\android\bin\ --lib "C:\Program Files (x86)\Android\android-sdk\platforms\android-30\android.jar" obj\Debug\android\bin\classes.zip "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v11.0\mono.android.jar" "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Xamarin\Android\\java_runtime.jar" C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.ConstraintLayout.Core.1.0.0\build\monoandroid90\..\..\jar\androidx.constraintlayout.constraintlayout-core.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Annotation.1.2.0.1\build\monoandroid90\..\..\jar\androidx.annotation.annotation.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Arch.Core.Common.2.1.0.9\build\monoandroid90\..\..\jar\androidx.arch.core.core-common.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Collection.1.1.0.8\build\monoandroid90\..\..\jar\androidx.collection.collection.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Lifecycle.Common.2.3.1.1\build\monoandroid90\..\..\jar\androidx.lifecycle.lifecycle-common.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.Google.Guava.ListenableFuture.1.0.0.2\build\monoandroid50\guava-listenablefuture.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Concurrent.Futures.1.1.0.3\build\monoandroid90\..\..\jar\androidx.concurrent.concurrent-futures.jar obj\Debug\lp\0\jl\formsviewgroup.jar obj\Debug\lp\100\jl\classes.jar obj\Debug\lp\101\jl\classes.jar obj\Debug\lp\102\jl\classes.jar obj\Debug\lp\103\jl\classes.jar obj\Debug\lp\104\jl\classes.jar obj\Debug\lp\105\jl\classes.jar obj\Debug\lp\60\jl\classes.jar obj\Debug\lp\61\jl\classes.jar obj\Debug\lp\62\jl\classes.jar obj\Debug\lp\63\jl\classes.jar obj\Debug\lp\64\jl\classes.jar obj\Debug\lp\65\jl\classes.jar obj\Debug\lp\66\jl\classes.jar obj\Debug\lp\67\jl\classes.jar obj\Debug\lp\68\jl\classes.jar obj\Debug\lp\69\jl\classes.jar obj\Debug\lp\70\jl\classes.jar obj\Debug\lp\71\jl\classes.jar obj\Debug\lp\72\jl\classes.jar obj\Debug\lp\73\jl\classes.jar obj\Debug\lp\74\jl\classes.jar obj\Debug\lp\75\jl\classes.jar obj\Debug\lp\76\jl\classes.jar obj\Debug\lp\77\jl\classes.jar obj\Debug\lp\78\jl\classes.jar obj\Debug\lp\79\jl\classes.jar obj\Debug\lp\80\jl\classes.jar obj\Debug\lp\81\jl\classes.jar obj\Debug\lp\82\jl\classes.jar obj\Debug\lp\83\jl\classes.jar obj\Debug\lp\84\jl\classes.jar obj\Debug\lp\85\jl\classes.jar obj\Debug\lp\86\jl\classes.jar obj\Debug\lp\87\jl\classes.jar obj\Debug\lp\88\jl\classes.jar obj\Debug\lp\89\jl\classes.jar obj\Debug\lp\90\jl\classes.jar obj\Debug\lp\91\jl\classes.jar obj\Debug\lp\92\jl\classes.jar obj\Debug\lp\93\jl\classes.jar obj\Debug\lp\94\jl\classes.jar obj\Debug\lp\95\jl\classes.jar obj\Debug\lp\96\jl\classes.jar obj\Debug\lp\97\jl\classes.jar obj\Debug\lp\98\jl\classes.jar 
========== Rebuild All: 3 succeeded, 0 failed, 0 skipped ==========
========== Rebuild started at 3:08 PM and took 33.249 seconds ==========

And on 17.5.0 Preview 3.0:

Rebuild started...
1>------ Rebuild All started: Project: SplitApp, Configuration: Debug Any CPU ------
Restored C:\Users\vlza\code\SplitApp\SplitApp\SplitApp.fsproj (in 45 ms).
1>C:\Program Files\dotnet\sdk\7.0.200-preview.22628.1\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(287,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>SplitApp -> C:\Users\vlza\code\SplitApp\SplitApp\bin\Debug\netstandard2.1\SplitApp.dll
2>------ Rebuild All started: Project: SplitApp.Android, Configuration: Debug Any CPU ------
3>------ Rebuild All started: Project: SplitApp.iOS, Configuration: Debug iPhoneSimulator ------
3>		Consider app.config remapping of assembly "netstandard, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" from Version "2.0.0.0" [] to Version "2.1.0.0" [C:\Program Files\Microsoft Visual Studio\2022\NonIntPreview\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades\netstandard.dll] to solve conflict and get rid of warning.
3>C:\Program Files\Microsoft Visual Studio\2022\NonIntPreview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2352,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
2>		SplitApp.Android -> C:\Users\vlza\code\SplitApp\SplitApp.Android\bin\Debug\SplitApp.Android.dll
3>		SplitApp.iOS -> C:\Users\vlza\code\SplitApp\SplitApp.iOS\bin\iPhoneSimulator\Debug\SplitApp.iOS.exe
2>		C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin\javac.exe -J-Dfile.encoding=UTF8 "@C:\Users\vlza\AppData\Local\Temp\tmpF39A.tmp" -target 1.8 -source 1.8 
2>		C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin\java.exe -Xmx1G -classpath "C:\Program Files\Microsoft Visual Studio\2022\NonIntPreview\MSBuild\Xamarin\Android\r8.jar" com.android.tools.r8.D8 --debug --min-api 21 --output obj\Debug\android\bin\ --lib "C:\Program Files (x86)\Android\android-sdk\platforms\android-30\android.jar" obj\Debug\android\bin\classes.zip "C:\Program Files\Microsoft Visual Studio\2022\NonIntPreview\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v11.0\mono.android.jar" "C:\Program Files\Microsoft Visual Studio\2022\NonIntPreview\MSBuild\Xamarin\Android\\java_runtime.jar" C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.ConstraintLayout.Core.1.0.0\build\monoandroid90\..\..\jar\androidx.constraintlayout.constraintlayout-core.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Annotation.1.2.0.1\build\monoandroid90\..\..\jar\androidx.annotation.annotation.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Arch.Core.Common.2.1.0.9\build\monoandroid90\..\..\jar\androidx.arch.core.core-common.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Collection.1.1.0.8\build\monoandroid90\..\..\jar\androidx.collection.collection.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Lifecycle.Common.2.3.1.1\build\monoandroid90\..\..\jar\androidx.lifecycle.lifecycle-common.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.Google.Guava.ListenableFuture.1.0.0.2\build\monoandroid50\guava-listenablefuture.jar C:\Users\vlza\code\SplitApp\packages\Xamarin.AndroidX.Concurrent.Futures.1.1.0.3\build\monoandroid90\..\..\jar\androidx.concurrent.concurrent-futures.jar obj\Debug\lp\0\jl\formsviewgroup.jar obj\Debug\lp\100\jl\classes.jar obj\Debug\lp\101\jl\classes.jar obj\Debug\lp\102\jl\classes.jar obj\Debug\lp\103\jl\classes.jar obj\Debug\lp\104\jl\classes.jar obj\Debug\lp\105\jl\classes.jar obj\Debug\lp\60\jl\classes.jar obj\Debug\lp\61\jl\classes.jar obj\Debug\lp\62\jl\classes.jar obj\Debug\lp\63\jl\classes.jar obj\Debug\lp\64\jl\classes.jar obj\Debug\lp\65\jl\classes.jar obj\Debug\lp\66\jl\classes.jar obj\Debug\lp\67\jl\classes.jar obj\Debug\lp\68\jl\classes.jar obj\Debug\lp\69\jl\classes.jar obj\Debug\lp\70\jl\classes.jar obj\Debug\lp\71\jl\classes.jar obj\Debug\lp\72\jl\classes.jar obj\Debug\lp\73\jl\classes.jar obj\Debug\lp\74\jl\classes.jar obj\Debug\lp\75\jl\classes.jar obj\Debug\lp\76\jl\classes.jar obj\Debug\lp\77\jl\classes.jar obj\Debug\lp\78\jl\classes.jar obj\Debug\lp\79\jl\classes.jar obj\Debug\lp\80\jl\classes.jar obj\Debug\lp\81\jl\classes.jar obj\Debug\lp\82\jl\classes.jar obj\Debug\lp\83\jl\classes.jar obj\Debug\lp\84\jl\classes.jar obj\Debug\lp\85\jl\classes.jar obj\Debug\lp\86\jl\classes.jar obj\Debug\lp\87\jl\classes.jar obj\Debug\lp\88\jl\classes.jar obj\Debug\lp\89\jl\classes.jar obj\Debug\lp\90\jl\classes.jar obj\Debug\lp\91\jl\classes.jar obj\Debug\lp\92\jl\classes.jar obj\Debug\lp\93\jl\classes.jar obj\Debug\lp\94\jl\classes.jar obj\Debug\lp\95\jl\classes.jar obj\Debug\lp\96\jl\classes.jar obj\Debug\lp\97\jl\classes.jar obj\Debug\lp\98\jl\classes.jar 
========== Rebuild All: 3 succeeded, 0 failed, 0 skipped ==========
========== Rebuild started at 3:11 PM and took 41.124 seconds ==========

So, fix should be released with 17.5 and 7.0.200

@vzarytovskii
Copy link
Member

@auduchinok fyi - the repro for the IL attribute cluster reading issue.

@vzarytovskii
Copy link
Member

I am going to close it as duplicate. Please let me know if you think it should remain opened.

@github-project-automation github-project-automation bot moved this from Not Planned to Done in F# Compiler and Tooling Jan 24, 2023
@auduchinok
Copy link
Member

@auduchinok fyi - the repro for the IL attribute cluster reading issue.

Thanks a lot for letting me know about it!

@Confuset
Copy link
Author

Brilliant. Thanks for the quick help on this.
Tried VS2022 17.5.0 Preview 4.0 which also fixes the issue for me :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants