You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Blazor WASM build unable to find python in $PATH on CBL Mariner 2.0 with .NET 6 #98714
arch-wasmWebAssembly architecturearea-Setupin-prThere is an active PR which will close this issue when it is mergedneeds-author-actionAn issue or pull request that requires more info or actions from the author.
The emsdk fails to build the blazorwasm template using the wasm-tools workload on CBL Mariner 2.0 and .NET 6.0 because it cannot find python on the $PATH.
Expected Behavior
The build is successful.
Steps To Reproduce
Build the following Dockerfile:
FROM mcr.microsoft.com/dotnet/sdk:6.0-cbl-mariner2.0
ARG TARGETARCH
WORKDIR /source
RUN . /etc/os-release \
&& case $ID in \
alpine) apk add --no-cache python3 ;; \
debian | ubuntu) apt-get update \
&& apt-get install -y --no-install-recommends python3 \
&& rm -rf /var/lib/apt/lists/* ;; \
mariner) tdnf install -y python3 \
&& tdnf clean all ;; \
esac \
&& dotnet workload install --skip-manifest-update wasm-tools
RUN dotnet new blazorwasm -o app --no-restore
WORKDIR /source/app
RUN dotnet restore -r linux-x64
RUN dotnet build --no-restore
RUN dotnet publish -r linux-x64 -c Release --self-contained true -o out
Try out 7.0/8.0 in the FROM instruction and see that it works for .NET versions > 6.0. Other operating systems also work with this Dockerfile.
Exceptions (if any)
The error presents as an issue with emcc:
/usr/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/6.0.5/Sdk/WasmApp.Native.targets(429,5): error MSB3073: The command "emcc --version" exited with code 1. [/source/app/app.csproj]
Enabling diagnostic output then reveals the actual error:
emcc --version (TaskId:227)
unable to find python in $PATH (TaskId:227)
python3 is installed on Mariner 2.0. Other distros alias python > python3, but not Mariner 2.0. I am guessing this is a fix that didn't get backported to .NET 6.0?
On linux we use the system python and do not package our own so you will need to install python in your image. @maraf we should add a more descriptive error message for this case.
@lewing Python is installed. Blazor WASM fails to find the system python because Mariner doesn't alias python -> python3 like most other distros. .NET 7+ does not have this issue.
We cannot easily fix this for for 6.0 since we didn't build emscripten from source back then.
Most Linux distros come with which installed by default and for those that don't installing the which package is an easy workaround, so I don't think it meets the servicing bar for 6.0.
arch-wasmWebAssembly architecturearea-Setupin-prThere is an active PR which will close this issue when it is mergedneeds-author-actionAn issue or pull request that requires more info or actions from the author.
Activity
wtgodbe commentedon Jan 30, 2024
Looks like this should be moved to emsdk
wtgodbe commentedon Jan 30, 2024
@radical who owns EMSDK these days?
radical commentedon Jan 30, 2024
Cc @lewing
wtgodbe commentedon Feb 13, 2024
@lewing should the issue be moved to https://github.com/emscripten-core/emsdk? I see that https://github.com/dotnet/emsdk doesn't have an
Issuessectionwtgodbe commentedon Feb 20, 2024
Moved to runtime as that's closer to EMSDK than aspnetcore is
lewing commentedon Apr 1, 2024
On linux we use the system python and do not package our own so you will need to install python in your image. @maraf we should add a more descriptive error message for this case.
lbussell commentedon Apr 1, 2024
@lewing Python is installed. Blazor WASM fails to find the system python because Mariner doesn't alias
python -> python3like most other distros. .NET 7+ does not have this issue.akoeplinger commentedon Jun 28, 2024
The issue is we fail to detect python3 because the
whichcommand isn't installed in the image, addingtdnf install -y whichfixes that.This was fixed upstream by emscripten-core/emscripten#15071 hence why it works with .NET7+ since we ship a newer emscripten version.
dotnet-policy-service commentedon Jun 28, 2024
This issue has been marked
needs-author-actionand may be missing some important information.akoeplinger commentedon Jun 28, 2024
We cannot easily fix this for for 6.0 since we didn't build emscripten from source back then.
Most Linux distros come with
whichinstalled by default and for those that don't installing thewhichpackage is an easy workaround, so I don't think it meets the servicing bar for 6.0.