Skip to content

Compiling application with LanguageExt as a dependency and ReadyToRun enabled using .NET 6 #66079

@AndreSteenveld

Description

@AndreSteenveld

Description

When compiling an application with .NET 5 and ReadyToRun enabled a binary is produced, trying to do the same with .NET 6 just "hangs". If a publish profile is used and -p:PublishReadyToRunCrossgen2ExtraArgs='--verbose' is provided it looks like crossgen2 is really busy processing all possible combinations of all possible generic classes. (That is more speculation from my side than anything else though)

Reproduction Steps

I've built a small application which can be found here; AndreSteenveld.CrossgenLanguageExt. Summarizing the readme; Running dotnet publish ./AndreSteenveld.CrossgenLanguageExt5.csproj -p:PublishSingleFile=true -p:PublishReadyToRun=true --configuration Release --runtime win-x64 --self-contained true produces a binary as expected. But doing the same for a .NET 6 project doesn't.

Expected behavior

I'm not expecting any super fast compilation, but nevertheless I do expect it to finish some time.

Actual behavior

Compile doesn't finish, even after several hours.

Regression?

I've read in the release notes that crossgen2 was released with .NET 6, so I'm assuming there is another (older) version of crossgen for .NET 5. So that would be my first suspect.

Known Workarounds

No response

Configuration

Running dotnet --info outputs the following:

.NET SDK (reflecting any global.json):
 Version:   6.0.102
 Commit:    02d5242ed7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19043
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.102\

Host (useful for support):
  Version: 6.0.2
  Commit:  839cdfb0ec

.NET SDKs installed:
  3.1.416 [C:\Program Files\dotnet\sdk]
  5.0.211 [C:\Program Files\dotnet\sdk]
  5.0.404 [C:\Program Files\dotnet\sdk]
  5.0.405 [C:\Program Files\dotnet\sdk]
  6.0.102 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

My compile target is also windows, x86-64. I do want to try to reproduce this on linux if possible, although I'm not expecting that it does compile (within a reasonable timeframe) on linux either.

Other information

As this is an issue which seems related to LanguageExt.Core I've also opened a ticket over there. louthy/language-ext#1000 If there is anything else I can do to help please feel free to reach out :)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions