Closed klemmchr closed 3 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
mono.android-arm
workload fails to install (#4146), similarity score: 0.77Note: You can give me feedback by thumbs upping or thumbs downing this comment.
@jonathanpeppers Is there a maui-android workload for Linux?
There is for jammy. We are using 22.04 right now and it can be installed without any issue.
@klemmchr you're using the distro-built SDKs, not the MS-provided SDKs, right? In that case you're hitting https://github.com/dotnet/source-build/issues/3242. We're working with the MAUI teams to make their workloads compatible with the Source-Built SDKs (which the distros use) but for now there's not really a great workaround that doesn't involve mucking around in your SDK install. Please follow that issue for updates.
An alternative is to install the Microsoft build of the SDK manually from the .tar.gz as detailed in https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#manual-install
@baronfel I can reproduce this issue using the MS-provided SDKs.
This is a sample Dockerfile for jammy (working):
FROM ubuntu:jammy
ENV \
# UID of the non-root user 'app'
APP_UID=1654 \
# Configure web servers to bind to port 8080 when present
ASPNETCORE_HTTP_PORTS=8080 \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
# Add global tools to path
PATH=/root/.dotnet/tools:$PATH \
# Do not generate dev certificates
DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
# Do not show first run text
DOTNET_NOLOGO=true \
# Use polling file watcher
DOTNET_USE_POLLING_FILE_WATCHER=true
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
ca-certificates \
wget \
libatomic1 \
libc6 \
libgcc-s1 \
libgssapi-krb5-2 \
libicu70 \
liblttng-ust1 \
libssl3 \
libstdc++6 \
libunwind8 \
tzdata \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb && \
apt update && \
apt install -y dotnet-sdk-8.0 && \
rm -rf /var/lib/apt/lists/*
RUN dotnet workload install maui-android
This is a sample Dockerfile for noble (not working):
FROM ubuntu:noble
ENV \
# UID of the non-root user 'app'
APP_UID=1654 \
# Configure web servers to bind to port 8080 when present
ASPNETCORE_HTTP_PORTS=8080 \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
# Add global tools to path
PATH=/root/.dotnet/tools:$PATH \
# Do not generate dev certificates
DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
# Do not show first run text
DOTNET_NOLOGO=true \
# Use polling file watcher
DOTNET_USE_POLLING_FILE_WATCHER=true
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
ca-certificates \
wget \
libc6 \
libgcc-s1 \
libicu74 \
liblttng-ust1 \
libssl3 \
libstdc++6 \
libunwind8 \
tzdata \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb && \
apt update && \
apt install -y dotnet-sdk-8.0 && \
rm -rf /var/lib/apt/lists/*
RUN dotnet workload install maui-android
I cannot say for sure that the MS-provided SDKs are even installed on noble. According to the docs there is no Microsoft feed for noble.
Installing .NET via manual install is not an option to me. I need a solution where the latest SDK gets installed automatically without manual configuration from my side.
I cannot say for sure that the MS-provided SDKs are even installed on noble.
Correct, the packages.microsoft.com repo for Ubuntu 24.04 doesn't contain 8.0 SDKs so you're installing from Ubuntu's repo: https://packages.microsoft.com/ubuntu/24.04/prod/pool/main/d/
Installing .NET via manual install is not an option to me. I need a solution where the latest SDK gets installed automatically without manual configuration from my side.
You could use the dotnet-install.sh script which handles installing the latest version: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
Correct, the packages.microsoft.com repo for Ubuntu 24.04 doesn't contain 8.0 SDKs so you're installing from Ubuntu's repo: https://packages.microsoft.com/ubuntu/24.04/prod/pool/main/d/
Why is Microsoft not publishing the 8.0 SDKs in their repo, especially when the distro-build SDKs are not suited for installing certain workloads?
You could use the dotnet-install.sh script which handles installing the latest version: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
Using magic install scripts in Dockerfiles is heavily discouraged since it poses a security risk and makes the installation intransparent.
Why is Microsoft not publishing the 8.0 SDKs in their repo, especially when the distro-build SDKs are not suited for installing certain workloads?
There's more background in https://github.com/dotnet/core/discussions/9258. I wasn't involved in the discussions so I'm not sure people were aware of the MAUI workloads limitation.
Using magic install scripts in Dockerfiles is heavily discouraged since it poses a security risk and makes the installation intransparent.
You can read the source of the script, it essentially downloads and unpacks the .tar.gz, which is why I suggested the manual install 😄 But anyway this was meant to give a workaround, the real fix is putting the workload manifests into source-built SDKs: https://github.com/dotnet/source-build/issues/3242
Description
I try to install the
maui-android
workload on Ubuntu 24.04 in Docker. The installation fails because the workload could not be found. Installing other workloads (likewasm-tools
) works without any error.Console output
Steps to Reproduce
Use Dockerfile from above and build it
Link to public reproduction project repository
No response
Version with bug
Unknown/Other
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Other (Tizen, Linux, etc. not supported by Microsoft directly)
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response