Why isn't C# .NET MAUI supported?

let’s use Ubuntu then, easy, draft metadata/troonie.mobile.yml:

License: GPL-3.0-only
SourceCode: https://github.com/troonie/troonie-mobile
IssueTracker: https://github.com/troonie/troonie-mobile/issues

RepoType: git
Repo: https://github.com/troonie/troonie-mobile.git

Builds:
  - versionName: '1.0'
    versionCode: 1
    commit: 11779c8e2cfb6869b1afdca051050c4eb3a95692
    sudo:
      - echo "deb https://mirrors.edge.kernel.org/ubuntu jammy main universe" > /etc/apt/sources.list.d/jammy.list
      - echo "deb http://security.ubuntu.com/ubuntu jammy-security main" > /etc/apt/sources.list.d/jammy-security.list
      - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 871920D1991BC93C
      - apt-get update
      - apt-get install -y -t jammy dotnet-sdk-6.0
    output: apk.apk

AutoUpdateMode: None
UpdateCheckMode: None

and build:

# dotnet build --configuration Release -f net8.0-android

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.127

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Microsoft (R) Build Engine version 17.0.1+b177f8fa7 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
/usr/lib/dotnet/sdk/6.0.127/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: wasm-tools [/home/vagrant/build/troonie.mobile/TroonieMobile.csproj]
/usr/lib/dotnet/sdk/6.0.127/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload install wasm-tools [/home/vagrant/build/troonie.mobile/TroonieMobile.csproj]
root@bookworm:/home/vagrant/build/troonie.mobile# dotnet workload install wasm-tools

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.127

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------

ackagevalidation .
Updated advertising manifest microsoft.net.workload.emscripten.
Updated advertising manifest microsoft.net.workload.mono.toolchain.
Installing workload manifest microsoft.net.workload.emscripten version 6.0.29…
Installing workload manifest microsoft.net.workload.mono.toolchain version 6.0.29…
Installing pack Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.27...
Writing workload pack installation record for Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.27...
Installing pack Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.27...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.27...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.27...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.27...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.27...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.27...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.27...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.27...
Installing pack Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.27...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.27...
Installing pack Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.27...


Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.27...
Garbage collecting for SDK feature band(s) 6.0.100...

Successfully installed workload(s) wasm-tools.

wait, did it just download random binaries from the Internet?

Surely we can build that instead:

To obtain and build latest wasm SDK from source, run

emsdk install sdk-main-64bit
emsdk activate sdk-main-64bit

where do I get emsdk to built emsdk?

oh, right: Download and install — Emscripten 3.1.55-git (dev) documentation

Next app to test?

emsdk is just a big hunkin python script like fdroidserver

great, have a guide at hand to build it from source?

you just git clone it and ./emsdk

Indeed, might be a thing.

For now the tested app is just stuck there, as the “build command” just outputs the same error, ref: New app: Troonie Mobile (#2727) · Issues · F-Droid / Requests For Packaging · GitLab

for reference emsdk being built metadata/net.alexbarry.alexgames.yml · master · F-Droid / Data · GitLab

It’s true of course that .Net and Maui are open source, but the workloads are indeed partly pre-compiled binaries that are installed in order to compile the Maui app.

However, all Nuget packages (C# libraries) are binaries too. It would be a lot of work to compile everything from source. (but I do think it is possible with the worloads; maui/src/Workload at main · dotnet/maui · GitHub)

Either an exception should be made, or we maybe need to be clearer about Maui and why it isn’t supported.

For the app I submitted, I can rebuild in Kotlin since it was mostly web technology, but for others this might be a big bummer if they find out too late.

I’m also looking to submit a .NET Maui app, is the issue currently that the workloads can’t be built from source?

There has been some discussion here before about submitting .NET MAUI apps. It seems like there are some issues with the maui-android workload as it is not built from source, however a source-built .NET SDK can be installed from Ubuntu’s package repositories, I’m wondering if an exception could be made for the workload?

Hi, i asked about dotnet on matrix devs channel but maybe forum is better place for such things.

Firstly, i want to summarize whole problem around dotnet - main problem with dotnet is that it needs itself in order to built-from-source. This is statement from their docs

.NET utilizes itself to build therefore in order to build .NET from source, you first need to acquire or build a bootstrapping .NET SDK.

Secondly, questions:

  1. will such “source-built” be accepted by F-Droid? This is one of many scripts and it downloads prepared binaries.
  2. will using ubuntu dotnet package inside debian VM be accepted by f-droid as workaround? I read that it is not really good idea, so i would like to have answer now then later.

I would say it is pretty urgent topic because I would like to have app published in official F-Droid repo and I need some sort of plan how to achieve it. Another option is to re-write the app but before doing so I need more information from F-Droid team, so please collaborate.