Skip to content

dotnet publish fails when RunAOTCompilation is set to true #60274

Closed

Description

@veertien

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]

Activity

  1. transferred this issue fromdotnet/sdkon Oct 11, 2021
  2. ghost added
    untriaged
    on Oct 11, 2021
  3. pranavkm commented on Oct 11, 2021

    @pranavkm
    Contributor
  4. added
    arch-wasm
    on Oct 11, 2021
  5. radical commented on Oct 11, 2021

    @radical
    Member

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

  6. added and removed
    untriaged
    on Oct 12, 2021
  7. added this to the 7.0.0 milestone on Oct 12, 2021
  8. veertien commented on Oct 15, 2021

    @veertien
    Author

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

  9. ghost added
    needs-further-triage
    on Oct 15, 2021
  10. radical commented on Oct 15, 2021

    @radical
    Member

    @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.

  11. radical commented on Nov 1, 2021

    @radical
    Member
    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 .

  12. ghost locked as resolved and limited conversation to collaborators on Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmarea-Build-mononeeds-further-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions