New comment by ayakael on void-packages repository https://github.com/void-linux/void-packages/pull/32974#issuecomment-1052897888 Comment: > > I'm the package maintainer for Alpine's dotnet packaging project. If anyone should want some advice or some notes, feel free to mention me in whatever space that you're working in. I wouldn't wish working on this from scratch for anyone - source-build has a lot of moving parts, which makes it a major PITA. For anything I work on, I like to document my problems as much as possible for future use. Thus, there's a devlog on Alpine's package MR dotnet31 / 5 and 6 available below. It goes in more nuts and bolts of packaging for Alpine, while the Github threads are more dotnet specific. > > 31: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/28197 5: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/28195 6: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/29253 > > > # How to build dotnet6 stack > > > > * Build testing/dotnet6-stage0 (provides prebuilt bits for first bootstrap bld) > > Is it not possible to build completely from source? Are these prebuilts available for crossbuild and musl? It is possible to build dotnet entirely from source, but as dotnet builds upon itsel, you need a bootstrap dotnet compiler. Microsoft provides `linux-musl` prebuilts for `armv7`, `aarch64`, `x86_64` which `dotnetx-stage0` fetches and packages. As it is policy for Alpine Linux to not allow binaries immediately built by prebuilt binaries, `dotnetx-bootstrap` sources `dotnetx-stage0` to build an Alpine version of a bootstrap SDK. `dotnetx-bootstrap` is then sourced by `dotnetx-build`, which builds the bits that are going to be packaged for availability to end-user. As Alpine does not support versioning for subpackages, and as runtime and sdk has two difference versioning schemes, but share the same build process, the actual packaging of artifacts from `dotnetx-build` is done by `dotnetx-sdk` and `dotnetx-runtime`. I encourage anyone to study the APKBUILD file, which reads very much like a shell script. I have made sure to leave ample comments and documentation for those interested in porting to other package managers.