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

dotnet publish hangs on Linux build #18484

Closed
narasamdya opened this issue Jun 23, 2021 · 2 comments
Closed

dotnet publish hangs on Linux build #18484

narasamdya opened this issue Jun 23, 2021 · 2 comments
Assignees
Labels
untriaged Request triage from a team member

Comments

@narasamdya
Copy link

Command: dotnet msbuild -p:Configuration=Release

I saw a bunch of hanging dotnet publish: ps -ef | grap dotnet

imnarasa 15139 15135  0 12:34 pts/2    00:00:02 dotnet publish --no-build --configuration Release --self-contained --output /home/imnarasa/Work/AnyBuild/distrib/Release/BazelAnyBuildAdapter/
imnarasa 15185 15139  0 12:34 pts/2    00:00:02 dotnet exec /usr/share/dotnet/sdk/5.0.301/MSBuild.dll -maxcpucount -verbosity:m -target:Publish -property:NoBuild=true -property:Configuration=Release -property:SelfContained=true -property:PublishDir=/home/imnarasa/Work/AnyBuild/distrib/Release/BazelAnyBuildAdapter/ -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/usr/share/dotnet/sdk/5.0.301/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/share/dotnet/sdk/5.0.301/dotnet.dll
imnarasa 15207 15206  0 12:34 pts/2    00:00:02 dotnet publish --no-build --configuration Release --self-contained --output /home/imnarasa/Work/AnyBuild/distrib/Release/Deployer/
imnarasa 15250 15207  0 12:34 pts/2    00:00:02 dotnet exec /usr/share/dotnet/sdk/5.0.301/MSBuild.dll -maxcpucount -verbosity:m -target:Publish -property:NoBuild=true -property:Configuration=Release -property:SelfContained=true -property:PublishDir=/home/imnarasa/Work/AnyBuild/distrib/Release/Deployer/ -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/usr/share/dotnet/sdk/5.0.301/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/share/dotnet/sdk/5.0.301/dotnet.dll
imnarasa 15371 15370  0 12:34 pts/2    00:00:01 dotnet publish --nologo --no-build --configuration Release --self-contained --output /home/imnarasa/Work/AnyBuild/distrib/Release/PerfTestTool/
imnarasa 15394 15371  0 12:34 pts/2    00:00:02 dotnet exec /usr/share/dotnet/sdk/5.0.301/MSBuild.dll -maxcpucount -verbosity:m -target:Publish -nologo -property:NoBuild=true -property:Configuration=Release -property:SelfContained=true -property:PublishDir=/home/imnarasa/Work/AnyBuild/distrib/Release/PerfTestTool/ -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/usr/share/dotnet/sdk/5.0.301/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/share/dotnet/sdk/5.0.301/dotnet.dll

Remedies
The remedies that work so far are

dotnet msbuild -p:Configuration=Release -m:1 <-- slows down builds a lot
or
MSBUILDDISABLENODEREUSE=1 dotnet msbuild -p:Configuration=Release

MSBuild spec
An example of how dotnet publish is invoked in the .csproj is as follows:

<Target Name="PostBuildPublish" AfterTargets="PostBuildEvent" Inputs="$(OutputPath)TestBuildTool.exe" Outputs="$(DistribDir)TestBuildTool.exe">
    <Exec Command="dotnet publish --no-build --configuration $(Configuration) --self-contained --output $(DistribDir)" />
 </Target>

OS
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

DotNet
dotnet --info
.NET SDK (reflecting any global.json):
Version: 5.0.301
Commit: cc8c0ab

Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/5.0.301/

Host (useful for support):
Version: 5.0.7
Commit: 556582d964

.NET SDKs installed:
3.1.410 [/usr/share/dotnet/sdk]
5.0.301 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.16 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.16 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

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

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jun 23, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@rainersigwald
Copy link
Member

This hang is likely the same one as dotnet/installer#10804 and should be resolved in .NET SDK 5.0.400 and .NET SDK 6.0.100 (previews).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants