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 fails when RunAOTCompilation is set to true #60274

Closed
veertien opened this issue Sep 18, 2021 · 8 comments
Closed

dotnet publish fails when RunAOTCompilation is set to true #60274

veertien opened this issue Sep 18, 2021 · 8 comments
Labels
arch-wasm WebAssembly architecture area-Build-mono needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration
Milestone

Comments

@veertien
Copy link

Describe the bug

In my docker container, the dotnet publish command fails here:

...
dotnet/sdk#19 22.00   [29/29] System.Private.CoreLib.dll -> System.Private.CoreLib.dll.bc
dotnet/sdk#19 22.07 /usr/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-rc.1.21451.13/Sdk/WasmApp.Native.targets(394,5): error MSB3073: The command "emcc --version" exited with code 1. [/src/Client/example1.Client.csproj]
------
executor failed running [/bin/sh -c dotnet publish "example1.Server.csproj" -c Release -o /app/publish]: exit code: 1
C:\git\example1>

To Reproduce

Create blazor wasm project with

dotnet new blazorwasm --hosted 
  • Add a Dockerfile with the dotnet 6 sdk

    • Install the wasm-tools workload
  • Update the Client project file to include:

  <RunAOTCompilation>true</RunAOTCompilation>

build the image

See this repo: https://github.com/veertien/example-blazor-aot

Exceptions (if any)

error MSB3073: The command "emcc --version" exited with code 1. 

Further technical details

docker run mcr.microsoft.com/dotnet/sdk:6.0 dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.100-rc.1.21458.32
 Commit:    d7c22323c4

Runtime Environment:
 OS Name:     debian
 OS Version:  11
 OS Platform: Linux
 RID:         debian.11-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.100-rc.1.21458.32/

Host (useful for support):
  Version: 6.0.0-rc.1.21451.13
  Commit:  d7619cd4b1

.NET SDKs installed:
  6.0.100-rc.1.21458.32 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
@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.

@pranavkm pranavkm transferred this issue from dotnet/sdk Oct 11, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Oct 11, 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.

@pranavkm
Copy link
Contributor

FYI @radical

@radical radical added arch-wasm WebAssembly architecture area-Build-mono labels Oct 11, 2021
@ghost
Copy link

ghost commented Oct 11, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Describe the bug

In my docker container, the dotnet publish command fails here:

...
dotnet/sdk#19 22.00   [29/29] System.Private.CoreLib.dll -> System.Private.CoreLib.dll.bc
dotnet/sdk#19 22.07 /usr/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.0-rc.1.21451.13/Sdk/WasmApp.Native.targets(394,5): error MSB3073: The command "emcc --version" exited with code 1. [/src/Client/example1.Client.csproj]
------
executor failed running [/bin/sh -c dotnet publish "example1.Server.csproj" -c Release -o /app/publish]: exit code: 1
C:\git\example1>

To Reproduce

Create blazor wasm project with

dotnet new blazorwasm --hosted 
  • Add a Dockerfile with the dotnet 6 sdk

    • Install the wasm-tools workload
  • Update the Client project file to include:

  <RunAOTCompilation>true</RunAOTCompilation>

build the image

See this repo: https://github.com/veertien/example-blazor-aot

Exceptions (if any)

error MSB3073: The command "emcc --version" exited with code 1. 

Further technical details

docker run mcr.microsoft.com/dotnet/sdk:6.0 dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.100-rc.1.21458.32
 Commit:    d7c22323c4

Runtime Environment:
 OS Name:     debian
 OS Version:  11
 OS Platform: Linux
 RID:         debian.11-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.100-rc.1.21458.32/

Host (useful for support):
  Version: 6.0.0-rc.1.21451.13
  Commit:  d7619cd4b1

.NET SDKs installed:
  6.0.100-rc.1.21458.32 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Author: veertien
Assignees: -
Labels:

arch-wasm, untriaged, area-Build-mono

Milestone: -

@radical
Copy link
Member

radical commented Oct 11, 2021

@veertien Could you please share the binlog? Run the build with -bl adding to the command line, and attach the generated msbuild.binlog.

@lewing lewing added needs more info and removed untriaged New issue has not been triaged by the area owner labels Oct 12, 2021
@lewing lewing added this to the 7.0.0 milestone Oct 12, 2021
@veertien
Copy link
Author

@radical , attached is the msbuild.binlog you requested.
msbuild.zip

@ghost ghost added needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration and removed needs more info labels Oct 15, 2021
@radical
Copy link
Member

radical commented Oct 15, 2021

@veertien thank you for the log! From the log:

Environment Variables passed to tool: (TaskId:476)
...
  PATH=/usr/share/dotnet/packs/Microsoft.NET.Runtime.Emscripten.2.0.23.Node.linux-x64/6.0.0-rc.2.21474.1/Sdk/../tools/bin:/usr/share/dotnet/packs/Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.linux-x64/6.0.0-rc.2.21474.1/Sdk/../tools/bin:/usr/share/dotnet/packs/Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.linux-x64/6.0.0-rc.2.21474.1/Sdk/../tools/emscripten:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin (TaskId:476)

emcc --version (TaskId:476)
unable to find python in $PATH (TaskId:476)

Python is not installed, or not available in $PATH.

note to self: fix our targets to better surface the error from emcc --version.

@radical
Copy link
Member

radical commented Nov 1, 2021

emcc --version (TaskId:476)
unable to find python in $PATH (TaskId:476)

Python is not installed, or not available in $PATH.

Installing python, and making sure that it is in PATH should fix this issue. Please re-open, if it doesn't.

Closing this based on the above, and opened an issue for surfacing the errors to the user - #61067 .

@radical radical closed this as completed Nov 1, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Dec 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration
Projects
None yet
Development

No branches or pull requests

5 participants