-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
net7 - Build freezes when publishing trimmed app with net6+ class libraries #87220
Comments
@dotnet/linker-contrib a new issue has been filed in the ILLink area, please triage |
Same issue building on al2! I needed to set an 8gb machine to build a small project using AOT. |
I couldn't finish build even after several hours. |
for us, our Blazor WASM project builds in about 4 minutes with .NET 6 or without trimming, 1+ hour with .NET 7 and trimming |
Maybe I could try to wait more than 6 hours. In net6 it is build within 100seconds. |
The same issue with sdk 7.0.200. Last version I was able to build my project with was something like net7 Preview7 |
still hangs up in net8 preview1 |
I have a strong suspicion it's somehow connected to using netstanrard2.1 libraries in solution |
it's not about netstandard2.1. It was just that net8 Preview 1 could not trim netstd2.1 libs. Still reproducible in latest 7.0.4 & 8P2 |
Ok, I found a little workaround - when all referenced csprojs are net5 or lower, main project (net6.0, net7.0) builds normally with net7 SDK. So I can use features later than netstandard2.1, just not latest one - 6/7. |
@michaldobrodenka this is likely the same issue as #86379. Are you able to try building your project with the latest nightly 8.0 SDK available at https://github.com/dotnet/installer/? We are also planning to backport the fix into an upcoming 7.0 servicing release. |
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas Issue DetailsI have a sln which contains several class libraries and one executable cmdline csproj. I'm modernizing whole solution, removing mono/net461 executable, upgrading class libraries from netstandard20 to net7.
and one specific csproj of my class libraries is set to net7.0 build freezes. on line To "unfreeze" build I have to:
Building it on Windows 10,11 and in linux docker. What I've tried and didn't help:
Unfortunately project is closed source. But I can run some test, access my desktop remotely or something like that.
|
@sbomer I've tried to build it with latest nighly, but seems that I can't get versions or something right: Maybe I'll wait for next official net8 Preview/net7 and retest it. |
|
Ok, after clearing nuget local cache, I'm able to start build, still freezes, but there is a problem with ILLink task version
Maybe I should add ILLink task nuget? |
@michaldobrodenka thanks for giving it a try. For the nightly SDKs you'll need to add nuget feeds mentioned under https://github.com/dotnet/installer#installers-and-binaries. For projects using the illink analyzer targeting net7.0 you will need the |
I tried targeting net8 & latest net8 nightly (Preview6), build is still freezing. I'll retest it within a few weeks |
@michaldobrodenka sorry, I forgot to mention that your project needs to target net8.0 to get the analyzer fix, at least until we make the servicing fix (dotnet/linker#3217). And note that you should be able to work around this by setting |
7.0.9 - still freezes |
Thanks for checking! Looks like the servicing fix should ship with 7.0.10. |
This should be fixed. Newly discovered problems are likely new issues. |
Is the fix merged in 7.0.10? Because I tried it and build still hangs without
|
@michaldobrodenka thank you for following up. I confirmed that the fix shipped in the 7.0.10 servicing release (7.0.400 SDK), so this sounds like a different bug. Is there any way you could provide us with a repro, perhaps a simplified bit of code from the library that exhibits the hang? If you're unable to share due to the license, please contact me at svbomer at microsoft.com to discuss. |
I have a sln which contains several class libraries and one executable cmdline csproj. I'm modernizing whole solution, removing mono/net461 executable, upgrading class libraries from netstandard20 to net7.
When publishing my app with parameters:
dotnet publish my.csproj -r linux-arm -p:PublishTrimmed=True -p:TrimMode=partial --self-contained true -c Release -f net7.0
and one specific csproj of my class libraries is set to net7.0 build freezes. on line
C:\Program Files\dotnet\dotnet.exe exec "C:\Program Files\dotnet\sdk\7.0.101\Roslyn\bincore\csc.dll" ...
Freezing means than NET host process takes almost all cpu, a several Gigs of RAM.
To "unfreeze" build I have to:
-p:PublishTrimmed=True -p:TrimMode=partial
) - without trimming build is completed in 20secBuilding it on Windows 10,11 and in linux docker.
What I've tried and didn't help:
Unfortunately project is closed source. But I can run some test, access my desktop remotely or something like that.
The text was updated successfully, but these errors were encountered: