user/dotnet8: drop aports #373

Merged
ayakael merged 3 commits from dotnet8/drop into edge 2024-01-28 05:22:09 +00:00
11 changed files with 0 additions and 876 deletions
Showing only changes of commit 201ef47734 - Show all commits

View file

@ -1,464 +0,0 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=dotnet8-stage0
pkgver=8.0.100
pkgrel=0
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
# Tag of tarball generator.
_gittag=v8.0.0
# Versions of prebuilt artifacts and bootstrap tar
_artifactsver="8.0.100-rtm.23551.1.centos.8-x64"
_bootstrapver="8.0.100"
_bootstraprel=0
_installerver=8.0.100
# Patches to be used. String before '_' refers to repo to patch
# Look for patch notes within each patch for what they fix / where they come from
# build_* patches applies directly to $builddir
_patches="
build_fix-ga-versions.patch
installer_aspire-manifest-version-fix.patch
installer_set-crossgen2rid-using-buildarchitecture.patch
runtime_82269-mono-thread-coop-undefine-fortify-source.patch
runtime_83682-specify-notext-on-linux-musl-x86.patch
runtime_90251-rename-mono-cmake-host-var.patch
runtime_more-clang-16-suppression.patch
runtime_remove-usage-of-off64-t.patch
"
_pkgver_macro=${pkgver%.*}
_pkgver_prior=1
_pkgver_name="${_pkgver_macro//[.0]}"
pkgdesc="The .NET Core stage0 bits for dotnet build"
# x86: blocked by https://github.com/dotnet/runtime/issues/83509
# armhf: blocked by https://github.com/dotnet/runtime/issues/77663
# riscv64: port WIP https://github.com/dotnet/runtime/issues/84834
# s390x | ppc64le: mono-based runtime still has issues on musl
arch="all !x86 !armhf !riscv64 !s390x !ppc64le"
_giturl=https://github.com/dotnet/dotnet
url=https://dotnet.microsoft.com
license="MIT"
options="!check net" # Testsuite in main -build aport
subpackages="
dotnet$_pkgver_name-stage0-artifacts:artifacts:noarch
dotnet$_pkgver_name-stage0-bootstrap
"
source="
dotnet-tarball-$_gittag.tar.gz::https://github.com/dotnet/dotnet/archive/refs/tags/$_gittag.tar.gz
dotnet-release-$_gittag.json::https://github.com/dotnet/dotnet/releases/download/$_gittag/release.json
dotnet-sdk-$_bootstrapver-linux-musl-x64.noextract::https://dotnetcli.azureedge.net/dotnet/Sdk/$_bootstrapver/dotnet-sdk-$_bootstrapver-linux-musl-x64.tar.gz
dotnet-sdk-$_bootstrapver-linux-musl-arm64.noextract::https://dotnetcli.azureedge.net/dotnet/Sdk/$_bootstrapver/dotnet-sdk-$_bootstrapver-linux-musl-arm64.tar.gz
dotnet-sdk-$_bootstrapver-linux-musl-arm.noextract::https://dotnetcli.azureedge.net/dotnet/Sdk/$_bootstrapver/dotnet-sdk-$_bootstrapver-linux-musl-arm.tar.gz
dotnet-sdk-$_bootstrapver-r$_bootstraprel-linux-musl-s390x.noextract::https://lab.ilot.io/ayakael/dotnet-stage0/-/releases/$_bootstrapver-r$_bootstraprel/downloads/sdk/dotnet-sdk-$_bootstrapver-r$_bootstraprel-linux-musl-s390x.tar.xz
dotnet-sdk-$_bootstrapver-r$_bootstraprel-linux-musl-ppc64le.noextract::https://lab.ilot.io/ayakael/dotnet-stage0/-/releases/$_bootstrapver-r$_bootstraprel/downloads/sdk/dotnet-sdk-$_bootstrapver-r$_bootstraprel-linux-musl-ppc64le.tar.xz
Private.SourceBuilt.Artifacts.$_artifactsver.noextract::https://dotnetcli.azureedge.net/source-built-artifacts/assets/Private.SourceBuilt.Artifacts.$_artifactsver.tar.gz
$_patches
"
makedepends_host="
alpine-release
autoconf
automake
bash
binutils
clang
cmake
findutils
g++
gcc
grep
icu-dev
krb5-dev
libintl
libstdc++
libucontext-dev
libunwind-dev
libxml2-dev
libxml2-utils
linux-headers
lttng-ust-dev
musl-dev
musl-utils
openssl-dev
pigz
unzip
zip
zlib-dev
"
case $CARCH in
s390x) ;;
*) makedepends_host="$makedepends_host lld-dev";;
esac
makedepends_build="
$makedepends_host
binutils$_cross
git
gcc$_cross
jq
llvm
llvm-dev
python3
sed
xz
"
case $CBUILD_ARCH in
x86_64) _dotnet_arch="x64";;
aarch64) _dotnet_arch="arm64";;
armv7|armhf) _dotnet_arch="arm";;
i586) _dotnet_arch="x86";;
*) _dotnet_arch=$CBUILD_ARCH;;
esac
case $CTARGET_ARCH in
x86_64) _dotnet_target="x64";;
aarch64) _dotnet_target="arm64";;
armv7|armhf) _dotnet_target="arm";;
i586) _dotnet_target="x86";;
*) _dotnet_target=$CTARGET_ARCH;;
esac
builddir="$srcdir"/dotnet-${_gittag/v}
_packagesdir="$srcdir"/local-packages
_libdir="/usr/lib"
_nugetdir="$srcdir"/nuget
_downloaddir="$srcdir"/local-downloads
_cli_root="$srcdir"/bootstrap
_nuget="$_cli_root/dotnet nuget"
_outputdir="$srcdir"/artifacts
# if true, then within pipeline environment, in which case send logs there
# to be scooped
if [ -d "$APORTSDIR/logs" ]; then
_logdir="$APORTSDIR"/logs/$pkgname
else
_logdir="$srcdir"/logs
fi
prepare() {
default_prepare
mkdir -p "$_cli_root"
mkdir -p $_packagesdir $_downloaddir $_outputdir $_nugetdir $_logdir
# sdk insists on downloading its own dotnet unless ArcadeBuildFromSource
# is true, which opens up a can of worms
sed 's|ArcadeBuildFromSource=true|Architecture|' -i src/sdk/eng/restore-toolset.sh
# links logfiles to pipeline logs for easy pickup in pipelines
mkdir -p "$_logdir" "$builddir"/artifacts
ln -s "$_logdir" "$builddir"/artifacts/logs
ln -s "$_logdir" "$builddir"/artifacts/log
for i in "$builddir"/src/*; do
if [ -f "$i" ]; then
continue
fi
mkdir -p "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts
ln -s "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts/log
done
tar -xf "$srcdir"/dotnet-sdk-$_pkgver_macro*$_dotnet_arch.noextract -C "$_cli_root" --no-same-owner
# adjusts sdk version and packagedir to expected
for i in runtime sdk installer aspnetcore roslyn; do
$_nuget add source $_packagesdir --name local --configfile "$builddir"/src/$i/NuGet.config
tmp=$(mktemp)
jq ".sdk.version = \"$_bootstrapver\"" "$builddir"/src/$i/global.json > $tmp && mv $tmp "$builddir"/src/$i/global.json
done
# extracting PackageVersions.props as some version information is there
tar -xzf "$srcdir"/Private.SourceBuilt.Artifacts.*.noextract PackageVersions.props
# sdk looks for TestCli at wrong place
sed '/<TestCliNuGetDirectoryTargetFramework/d' -i "$builddir"/src/sdk/src/Layout/redist/targets/GenerateLayout.targets
}
_init() {
export _InitializeDotNetCli=$_cli_root
export DOTNET_INSTALL_DIR=$_cli_root
export PATH="$_cli_root:$PATH"
export NUGET_PACKAGES=$_nugetdir
export DotNetBuildFromSource=true
export DOTNET_CLI_TELEMETRY_OPTOUT=true
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
export SHELL=/bin/bash
export EXTRA_CPPFLAGS="${CPPFLAGS/--sysroot=$CBUILDROOT}"
export EXTRA_CXXFLAGS="${CXXFLAGS/--sysroot=$CBUILDROOT}"
export EXTRA_CFLAGS="${CFLAGS/--sysroot=$CBUILDROOT}"
export EXTRA_LDFLAGS="$LDFLAGS"
unset CXXFLAGS CFLAGS LDFLAGS CPPFLAGS
ulimit -n 4096
"$_cli_root"/dotnet build-server shutdown
}
_runtime() {
_init
if [ -z "${_runtimever+x}" ]; then
local _runtimever=$(grep OutputPackageVersion "$builddir"/prereqs/git-info/runtime.props | sed -E 's|</?OutputPackageVersion>||g' | tr -d ' ')
fi
local _runtimever_ns=$(awk '{if($2 ~ "Name=\"VS.Redist.Common.NetCore.SharedFramework.x64.*\""){print $3}}' "$builddir"/src/installer/eng/Version.Details.xml | awk -F '"' '{print $2}')
msg "[$(date)] Building runtime version $_runtimever"
cd "$builddir"/src/runtime
local args="
-c Release
-bl
-clang
-arch $_dotnet_target
/consoleLoggerParameters:ShowTimestamp
/p:NoPgoOptimize=true
/p:EnableNgenOptimization=false
/p:ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch=none
/p:_toolsRID=linux-musl-$_dotnet_arch
/p:OutputRid=linux-musl-$_dotnet_target
/p:GitCommitHash=$(grep GitCommitHash "$builddir"/prereqs/git-info/runtime.props | sed -E 's|</?GitCommitHash>||g' | tr -d ' ')
"
if [ "$CBUILD" != "$CHOST" ]; then
local args="$args -cross"
# https://github.com/dotnet/runtime/pull/75597 broke crossbuilding when true
local DotNetBuildFromSource=false
# x86 build of mono broken, thus do not build mono
case $_dotnet_target in
x86) local args="$args /p:DefaultSubsets=clr+libs+host+packs";;
esac
fi
if [ "$_runtimever" != "${_runtimever##*-}" ]; then
local args="$args /p:VersionSuffix=${_runtimever##*-}"
fi
DotNetBuildFromSource=$DotNetBuildFromSource ROOTFS_DIR="$CBUILDROOT" ./build.sh $args
for i in artifacts/packages/*/*/*.nupkg; do
$_nuget push $i --source="$_packagesdir"
done
mkdir -p "$_downloaddir"/Runtime/$_runtimever_ns
cp artifacts/packages/*/*/dotnet-runtime-*-*.tar.gz $_downloaddir/Runtime/$_runtimever_ns
}
_sdk() {
_init
if [ -z "${_sdkver+x}" ]; then
local _sdkver=$(grep OutputPackageVersion "$builddir"/prereqs/git-info/sdk.props | sed -E 's|</?OutputPackageVersion>||g' | tr -d ' ')
fi
local _sdkver_ns=$(awk '{if($2 == "Name=\"Microsoft.NET.Sdk\""){print $3}}' "$builddir"/src/installer/eng/Version.Details.xml | awk -F '"' '{print $2}')
msg "[$(date)] Building sdk version $_sdkver"
cd "$builddir"/src/sdk
local args="
-c Release
-bl
/consoleLoggerParameters:ShowTimestamp
/p:GitCommitHash=$(grep GitCommitHash "$builddir"/prereqs/git-info/sdk.props | sed -E 's|</?GitCommitHash>||g' | tr -d ' ')
/p:Architecture=$_dotnet_target
/p:TestCliNuGetDirectoryTargetFramework=netcoreapp3.1
"
if [ "$_sdkver" != "${_sdkver##*-}" ]; then
local args="$args /p:VersionSuffix=${_sdkver##*-}"
fi
./build.sh --pack /p:Projects=$builddir/src/sdk/source-build.slnf $args
for i in artifacts/packages/*/*/*.nupkg; do
$_nuget push $i --source="$_packagesdir"
done
mkdir -p "$_downloaddir"/Sdk/$_sdkver_ns
cp artifacts/packages/*/*/dotnet-toolset-internal-*.zip "$_downloaddir"/Sdk/$_sdkver_ns
}
_aspnetcore() {
_init
if [ -z "${_aspnetver+x}" ]; then
local _aspnetver=$(grep OutputPackageVersion "$builddir"/prereqs/git-info/aspnetcore.props | sed -E 's|</?OutputPackageVersion>||g' | tr -d ' ')
fi
local _aspnetver_ns=$(awk '{if($2 == "Name=\"Microsoft.AspNetCore.App.Ref.Internal\""){print $3}}' "$builddir"/src/installer/eng/Version.Details.xml | awk -F '"' '{print $2}')
msg "[$(date)] Build aspnetcore version $_aspnetver"
cd "$builddir"/src/aspnetcore
local args="
-c Release
-bl
--os-name linux-musl
-arch $_dotnet_target
-no-build-nodejs
/consoleLoggerParameters:ShowTimestamp
/p:BuildNodeJs=false
/p:BuildOSName=linux-musl
/p:GitCommitHash=$(grep GitCommitHash "$builddir"/prereqs/git-info/aspnetcore.props | sed -E 's|</?GitCommitHash>||g' | tr -d ' ')
/p:DotNetAssetRootUrl=file://$_downloaddir/
/p:EnablePackageValidation=false
"
if [ "$_aspnetver" != "${_aspnetver##*-}" ]; then
local args="$args /p:VersionSuffix=${_aspnetver##*-}"
fi
# aspnetcore can't find newly created Microsoft.NETCore.App.Runtime.linux-musl-x86 for some reason
case $_dotnet_target in
riscv64|x86) local args="$args /p:CrossgenOutput=false";;
esac
./eng/build.sh --pack $args
for i in artifacts/packages/*/*/*.nupkg; do
$_nuget push $i --source="$_packagesdir"
done
mkdir -p "$_downloaddir"/aspnetcore/Runtime/$_aspnetver_ns
cp artifacts/installers/*/aspnetcore-runtime-*-linux-musl-$_dotnet_target.tar.gz "$_downloaddir"/aspnetcore/Runtime/$_aspnetver_ns
cp artifacts/installers/*/aspnetcore_base_runtime.version "$_downloaddir"/aspnetcore/Runtime/$_aspnetver_ns
}
_installer() {
_init
msg "[$(date)] Building installer version $_installerver"
cd "$builddir"/src/installer
local args="
-c Release
-bl
/consoleLoggerParameters:ShowTimestamp
/p:EnableSourceLink=false
/p:OSName=linux-musl
/p:HostOSName=linux-musl
/p:Architecture=$_dotnet_target
/p:CoreSetupBlobRootUrl=file://$_downloaddir/
/p:DotnetToolsetBlobRootUrl=file://$_downloaddir/
/p:GitCommitHash=$(grep GitCommitHash "$builddir"/prereqs/git-info/installer.props | sed -E 's|</?GitCommitHash>||g' | tr -d ' ')
/p:GitCommitCount=1
/p:PublicBaseURL=file://$_downloaddir/
"
if [ "$_installerver" != "${_installerver##*-}" ]; then
local args="$args /p:VersionSuffix=${_installerver##*-}"
fi
# crossgen broken on x86
case $_dotnet_target in
riscv64|x86) local args="$args /p:DISABLE_CROSSGEN=True";;
esac
./build.sh $args
mkdir -p "$_downloaddir"/installer/$_installerver
cp artifacts/packages/*/*/dotnet-sdk-$_pkgver_macro*.tar.gz "$_downloaddir"/installer/$_installerver
}
build() {
_runtime
_sdk
_aspnetcore
_installer
}
package() {
# lua-aports / buildrepo doesn't know to always build stage0 first when dealing
# with virtual packages. Thus, we need to depend on an empty stage0 pkg that
# dotnetx-build will pull, thus forcing build of stage0 first
mkdir -p "$pkgdir"
}
bootstrap() {
# allows stage0 to be pulled by dotnetx-build if first build of dotnetx
provides="dotnet$_pkgver_name-bootstrap"
provider_priority=$_pkgver_prior
local _iltoolsver=$(grep \<MicrosoftNETCoreILAsmVersion "$builddir"/PackageVersions.props | sed -E 's|</?MicrosoftNETCoreILAsmVersion>||g' | tr -d ' ')
install -dm 755 \
"$subpkgdir"/$_libdir/dotnet/bootstrap/$pkgver/docs \
"$subpkgdir"/$_libdir/dotnet/bootstrap/$pkgver/comp \
"$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver
# unpack build artifacts to bootstrap subdir for use by future builds
tar --use-compress-program="pigz" \
-xf "$_downloaddir"/installer/$_installerver/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/bootstrap/$pkgver/ \
--no-same-owner
local _iltoolsArray="
runtime.*.Microsoft.NETCore.TestHost.*.nupkg
runtime.*.Microsoft.NETCore.ILAsm.*.nupkg
runtime.*.Microsoft.NETCore.ILDAsm.*.nupkg
"
local _nupkgsArray="
$_iltoolsArray
Microsoft.NETCore.App.Host.*.*.nupkg
Microsoft.NETCore.App.Runtime.*.*.nupkg
Microsoft.NETCore.App.Crossgen2.*.*.nupkg
runtime.*.Microsoft.NETCore.DotNetHost.*.nupkg
runtime.*.Microsoft.NETCore.DotNetHostPolicy.*.nupkg
runtime.*.Microsoft.NETCore.DotNetHostResolver.*.nupkg
runtime.*.Microsoft.NETCore.DotNetAppHost.*.nupkg
Microsoft.AspNetCore.App.Runtime.linux-musl-*.*.nupkg
"
# copies artifacts to artifacts dir for use by future dotnet builds
for i in $_nupkgsArray; do install -Dm644 "$_packagesdir"/$i "$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver/ || true; done
msg "Changing iltools version to $_iltoolsver"
# source-build expects a certain version of ilasm, ildasm and testhost
# following adjusts version
for i in $_iltoolsArray; do
local nupath="$subpkgdir"$_libdir/dotnet/artifacts/$pkgver/$i
local nupath=$(find $nupath || true)
local nupkg="${nupath##*/}"
local nuname="${nupkg/.nupkg}"
if [ -z "${nuname/*rtm*}" ] || [ -z "${nuname/*servicing*}" ] || [ -z "${nuname/*preview*}" ]; then
nuname=${nuname%-*}
fi
local nuname="${nuname%.*.*.*}"
local nuver="${nupkg/$nuname.}"
local nuver="${nuver/.nupkg}"
local nuspec="$nuname.nuspec"
if [ ! "$nupath" ] || [ "$nupath" = "${nupath/$nuver/$_iltoolsver}" ]; then
continue
fi
# shellcheck disable=SC2094
unzip -p "$nupath" $nuspec | sed "s|$nuver|$_iltoolsver|" > "$srcdir"/$nuspec
cd "$srcdir"
zip -u "$nupath" $nuspec
mv "$nupath" "${nupath/$nuver/$_iltoolsver}"
done
}
# build relies on a plethora of nupkgs which are provided by this Artifacts file.
# stage0 sources these from Microsoft, which then allows bootstrap to build
# locally hosted versions. The following unpacks built tarball into directory
# for use by future builds.
artifacts() {
pkgdesc="Internal package for building .NET $_pkgver_macro Software Development Kit"
# hack to allow artifacts to pull itself
provides="dotnet$_pkgver_name-bootstrap-artifacts"
provider_priority=$_pkgver_prior
# directory creation
install -dm 755 \
"$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver \
"$subpkgdir"/usr/share/licenses
# extract artifacts to artifacts dir for use by future dotnet builds
tar --use-compress-program="pigz" \
-xf "$srcdir"/Private.SourceBuilt.Artifacts.*.noextract \
-C "$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver/ \
--no-same-owner
}
sha512sums="
094265462d66d97b51ebfbe5fb06d4a679b97881f1f5a07a87a282a96eeaabfe97ca42061d59aac71dd8861c07f07dda16a72e29ae03167407e51d3fd2767562 dotnet-tarball-v8.0.0.tar.gz
55f2c56f7fbed4137ebe5e81c7b86d199d7ff91c6e19fbc9a4af8cd5d0f0195273356ead8b80aedfff56a3d704a541a7c2a7395bec3fa5d6585f3afd056b1220 dotnet-release-v8.0.0.json
a904491cf1fe27603cfc21aa234b2f4da7517929fa9dad0eaa2233d010ef1e890339ca4b8e3c4c0d463f3015d7020a0c37ece97319b061cd92a5fc51cd8a7f4c dotnet-sdk-8.0.100-linux-musl-x64.noextract
1d8e54ab8d2b7b83972c1ecd7a23073bf83d39c258e993e54ab91a383ad2aa44276dfc28938f7b162cf79010187005e42a665933dff021ffa5e5d9cfadb5e2b6 dotnet-sdk-8.0.100-linux-musl-arm64.noextract
a8c08c4eaaa1ade3a1521750c62af92ab8fe91bfdd0f4767f8c0469ebfef091f3a68a443d4566bbfe53c49866d72a104c7aea309cabb36148f9aef9cb950ea64 dotnet-sdk-8.0.100-linux-musl-arm.noextract
d0bebb6179e679dea5704ca59acb2260a3dde2d22727b8116b57fbcfc3cba7b31581ed785279eec2836e3916608f39fa45a8e26dfa27063928355ccda83b3d09 dotnet-sdk-8.0.100-r0-linux-musl-s390x.noextract
14fdc6c8225010a6028609ed2b7c942abc770a50167429116ab9d5f0cabfe8038aedb89b7cc984d89c3366351302a86e10c2d5cfccd57399cc42b3c838bc37a0 dotnet-sdk-8.0.100-r0-linux-musl-ppc64le.noextract
a9933d8de614e914d42cf4953ac60a0a6e83e4276328b838fb369fb3036073fd08d2bcbcee07386f65f802f2f2374e45b44b8f8410396a7d93d20e53646d72f0 Private.SourceBuilt.Artifacts.8.0.100-rtm.23551.1.centos.8-x64.noextract
48d155f11c4594eeb72b2d80a6e110ab2b093fd2379e9ddcca755072f4a3e64990ef2620709e0b10ea4b979d8909de56d89f970c349c6fee58621a8f6b415a1c build_fix-ga-versions.patch
6f23b53b1408dc676434d3ee417b735af033f2717057589e93d26021ca2513d13f40ba7ea3312413f2ed79cda2991538f64b4c835e75f40f5a5e5a0e469c4ec0 installer_aspire-manifest-version-fix.patch
b6a2dfeccac329546f87f1019c1f2cf07e2f294dd33914449ad08d92269c8713b6fa1e330ef257c24e189023fd0b824df97688b0ba6e578a6d0292b07a72b4c1 installer_set-crossgen2rid-using-buildarchitecture.patch
d732df247c721c9f677baabdd7f36dbf4b564814ff64164361065bb1c196b767494a1d39f634eadf01a23032c7b3e64102614b7213065c81096bbf3f8022e6a0 runtime_82269-mono-thread-coop-undefine-fortify-source.patch
c983a1ab7f06ac86691e0fa7a61fcad69a074d984ef4a4116bee43f20be918215963c7ec8ddd7edd70432b29b160ff78288183acc89fda15ce4a75bfdbf99ee3 runtime_83682-specify-notext-on-linux-musl-x86.patch
3354fa721809f1b94c579408ee78004ff3ca2ba79212c1a0ecc424a9955bb5d5a80c115d4c30dd257526f356ea76f0562db6f83d8dd0b6135f8c689886b3348d runtime_90251-rename-mono-cmake-host-var.patch
887112eb2b103eadd6887529ebae7f9a75df2c2cb168e84fd40cc09f9bcd20917d428bbba06968b07b0a463890da82b1b2b1d033a3dd016e6494067464ae6f74 runtime_more-clang-16-suppression.patch
0c25319125ef5b0ad490b37a643c0c5257c796d5ed24f9ac404f698710b07de790bcbb0b6336d4a50025b94c3bff99b214951bd8f0a79a8d6f543ebaa300740f runtime_remove-usage-of-off64-t.patch
"

View file

@ -1,143 +0,0 @@
# dotnet8-stage0
This is the .NET 8.0 package for Alpine Linux.
Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/aports/-/issues/new) and tag @ayakael
# Building info
## Generated packages
* `dotnet8` (empty package to go around `buildrepo` build ordering bug)
* `dotnet8-stage0-bootstrap` (packages binary bootstrap artifacts)
* `dotnet8-stage0-artifacts` (packages non-binary bootstrap artifacts)
## How to build dotnet8 on Alpine
As dotnet is a self-hosting compiler (thus it compiles using itself), it
requires a bootstrap for the initial build. To solve this problem, this package
follows the `stage0` proposal outlined [here](https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E)
The goal of `stage0` is to bootstrap dotnet with as little intervention as
possible, thus allowing seamless Alpine upgrades. Unfortunately, upstream only
builds bootstraps for Alpine on `x86_64`, `aarch64`, and `armv7`. Thus, `stage0`
has also been designed to be crossbuild aware, allowing bootstrapping to other
platforms.
In summary, dotnet8 is built using three different aports.
* `community/dotnet8-stage0`
Builds minimum components for full build of dotnet8, and packages these in an initial
`dotnet8-stage0-bootstrap` package that `dotnet8-runtime` pulls.
* `community/dotnet8-runtime`
Builds full and packages dotnet8 fully using either stage0 or previoulsy built
dotnet8 build.
* `community/dotnet8-sdk`
As abuild does not allow different versions for subpackages, a different aport
is required to package runtime bits from dotnet8-runtime. dotnet8-runtime only
builds 8.0.1xx feature branch of SDK. Thus, when a new feature branch of sdk is
released, the updated components are to be built on dotnet8-sdk rather than
simply repackaging dotnet8-runtime artifacts.
## Crossbuilding with `stage0`
Crossbuilding `stage0` is a three step process:
1. Build sysroot for target platform by using `scripts/bootstrap.sh` in aports repo:
```
./bootstrap.sh $CTARGET_ARCH
```
2. Although not necessary, it is recommended to add Alpine repositories to
`$HOME/sysroot-$CTARGET_ARCH/etc/apk/repositories`, making sure to add required
keys. This makes it so that whatever package is not built in step 1 will
be pulled from package repos
3. Crossbuild `dotnet8-stage0` via:
```
CHOST=$CTARGET_ARCH abuild -r
```
# Specification
This package follows [package naming and contents suggested by upstream](https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging),
with two exceptions. It installs dotnet to `/usr/lib/dotnet` (aka `$_libdir`).
In addition, the package is named `dotnet8` as opposed to `dotnet-8.0`
to match Alpine Linux naming conventions for packages with many installable versions
# Contributing
The steps below are for the final package. Please only contribute to a
pre-release version if you know what you are doing. Original instructions
follow.
## General Changes
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-runtime`
3. Make your changes. Don't forget to add a changelog.
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally.
6. Commit the changes to the git repo in a git branch
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-runtime: descriptive description'`
- `git push`
7. Create a merge request with your changes, tagging @ayakael for review.
8. Once the tests in the pull-request pass, and reviewers are happy, your changes
will be merged.
## Updating to an new upstream release
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-runtime`
3. Build the new upstream source tarball. Update the versions in the
APKBUILD file, and then create a snapshot. After build, update checksum.
- `abuild snapshot`
- `abuild checksum`
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally. Any
patches that are needed at this point should be added to the APKBUILD file
in `_patches` variable.
6. Upload the source archive to a remote location, and update `source` variable.
7. Commit the changes to the git repo in a git branch.
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-runtime: upgrade to <new-version>`
- `git push`
8. Create a merge request with your changes, tagging @ayakael for review.
9. Once the tests in the pull-request pass, and reviewers are happy, your changes
will be merged.
# Testing
This package uses CI tests as defined in `check()` function. Creating a
merge-request or running a build will fire off tests and flag any issues.
The tests themselves are contained in this external repository:
https://github.com/redhat-developer/dotnet-regular-tests/

View file

@ -1,32 +0,0 @@
diff --git a/prereqs/git-info/runtime.props.orig b/prereqs/git-info/runtime.props
index f9dc4d6..093bd00 100644
--- a/prereqs/git-info/runtime.props.orig
+++ b/prereqs/git-info/runtime.props
@@ -3,8 +3,8 @@
<PropertyGroup>
<GitCommitHash>5535e31a712343a63f5d7d796cd874e563e5ac14</GitCommitHash>
<OfficialBuildId>20231031.3</OfficialBuildId>
- <OutputPackageVersion>8.0.0-rtm.23531.3</OutputPackageVersion>
+ <OutputPackageVersion>8.0.0</OutputPackageVersion>
<PreReleaseVersionLabel>rtm</PreReleaseVersionLabel>
<IsStable>false</IsStable>
</PropertyGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/prereqs/git-info/aspnetcore.props.orig b/prereqs/git-info/aspnetcore.props
index d1494e8..b83649d 100644
--- a/prereqs/git-info/aspnetcore.props.orig
+++ b/prereqs/git-info/aspnetcore.props
@@ -3,8 +3,8 @@
<PropertyGroup>
<GitCommitHash>3f1acb59718cadf111a0a796681e3d3509bb3381</GitCommitHash>
<OfficialBuildId>20231031.12</OfficialBuildId>
- <OutputPackageVersion>8.0.0-rtm.23531.12</OutputPackageVersion>
+ <OutputPackageVersion>8.0.0</OutputPackageVersion>
<PreReleaseVersionLabel>rtm</PreReleaseVersionLabel>
<IsStable>false</IsStable>
</PropertyGroup>
-</Project>
\ No newline at end of file
+</Project>

View file

@ -1,26 +0,0 @@
diff --git a/./src/installer/eng/Version.Details.xml.orig b/./src/installer/eng/Version.Details.xml
index a1cebfe..3f47a7f 100644
--- a/./src/installer/eng/Version.Details.xml.orig
+++ b/./src/installer/eng/Version.Details.xml
@@ -172,7 +172,7 @@
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>2406616d0e3a31d80b326e27c156955bfa41c791</Sha>
</Dependency>
- <Dependency Name="Microsoft.NET.Sdk.Aspire.Manifest-8.0.100" Version="8.0.0-preview.1.23551.7">
+ <Dependency Name="Microsoft.NET.Sdk.Aspire.Manifest-8.0.100" Version="8.0.0-preview.1.23557.2">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-aspire</Uri>
<Sha>4b00c57d7ccf9a4c7e2aef211ab6bd8af3ee2324</Sha>
<SourceBuild RepoName="aspire" ManagedOnly="true" />
diff --git a/./src/installer/eng/Versions.props.orig b/./src/installer/eng/Versions.props
index 329ab4e..897263d 100644
--- a/./src/installer/eng/Versions.props.orig
+++ b/./src/installer/eng/Versions.props
@@ -238,7 +238,7 @@
<!-- Workload manifest package versions -->
<PropertyGroup>
<AspireFeatureBand>8.0.100</AspireFeatureBand>
- <AspireWorkloadManifestVersion>8.0.0-preview.1.23551.7</AspireWorkloadManifestVersion>
+ <AspireWorkloadManifestVersion>8.0.0-preview.1.23557.2</AspireWorkloadManifestVersion>
<MauiFeatureBand>8.0.100-rc.2</MauiFeatureBand>
<MauiWorkloadManifestVersion>8.0.0-rc.2.9373</MauiWorkloadManifestVersion>
<XamarinAndroidWorkloadManifestVersion>34.0.0-rc.2.468</XamarinAndroidWorkloadManifestVersion>

View file

@ -1,13 +0,0 @@
diff --git a/src/installer/src/redist/targets/GenerateLayout.targets.orig b/src/installer/src/redist/targets/GenerateLayout.targets
index a27834f..0c899d4 100644
--- a/src/installer/src/redist/targets/GenerateLayout.targets.orig
+++ b/src/installer/src/redist/targets/GenerateLayout.targets
@@ -85,7 +85,7 @@
<WinFormsAndWpfSharedFxArchiveFileName>windowsdesktop-runtime-$(MicrosoftWindowsDesktopAppRuntimePackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension)</WinFormsAndWpfSharedFxArchiveFileName>
<Crossgen2Rid>$(HostOSName)-$(BuildArchitecture)</Crossgen2Rid>
- <Crossgen2Rid Condition="'$(DotNetBuildFromSource)' == 'true'">$(SharedFrameworkRid)</Crossgen2Rid>
+ <Crossgen2Rid Condition="'$(DotNetBuildFromSource)' == 'true'">$(SharedFrameworkRid.SubString(0, $(SharedFrameworkRid.LastIndexOf('-'))))-$(BuildArchitecture)</Crossgen2Rid>
<AspNetCoreInstallerRid Condition="'$(AspNetCoreInstallerRid)' == ''">$(SharedFrameworkRid)</AspNetCoreInstallerRid>
<AspNetCoreInstallerRid Condition="'$(SharedFrameworkRid)' == 'rhel.6-x64'">linux-x64</AspNetCoreInstallerRid>

View file

@ -1,25 +0,0 @@
From 98054ea87ce70247bb09ceafd2ad1a0b36d2fef4 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/issues/82269
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 1 Oct 2022 09:21:58 -0400
Subject: [PATCH] Undefine fortify-source on mono-thread-coop
When _FORTIFY_SOURCE=2, there is a bug relating to memcpy that expresses itself.
See: https://gitlab.alpinelinux.org/alpine/aports/-/issues/14105. Alpine Linux
now sets this by default since https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/43463,
which makes mono-flavored runtime dump its core. This patch offers a workaround
by undefining _FORTIFY_SOURCE in the problematic file.
---
diff --git a/src/runtime/src/mono/mono/utils/mono-threads-coop.c b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
index 4ed659d6605..34bb5785fba 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads-coop.c
+++ b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
@@ -15,6 +15,7 @@
#ifdef TARGET_MACH
#define _DARWIN_C_SOURCE
#endif
+#undef _FORTIFY_SOURCE
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-threads.h>

View file

@ -1,24 +0,0 @@
From 65877a9c1260c1c37d1c3355703b1951b6754cdf Mon Sep 17 00:00:00 2001
From: Adeel <3840695+am11@users.noreply.github.com>
Date: Mon, 20 Mar 2023 19:36:14 +0200
Subject: [PATCH] Specify -z notext on linux-musl-x86
---
src/coreclr/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/runtime/src/coreclr/CMakeLists.txt b/src/runtime/src/coreclr/CMakeLists.txt
index 67b773bf78787..87d862a541ae6 100644
--- a/src/runtime/src/coreclr/CMakeLists.txt
+++ b/src/runtime/src/coreclr/CMakeLists.txt
@@ -109,6 +109,10 @@ if(CLR_CMAKE_HOST_UNIX)
endif()
endif()
+ if(CLR_CMAKE_TARGET_ALPINE_LINUX AND CLR_CMAKE_TARGET_ARCH_I386)
+ add_linker_flag(-Wl,-z,notext)
+ endif()
+
if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
add_subdirectory(pal)
add_subdirectory(hosts)

View file

@ -1,80 +0,0 @@
From 828269b7e68039f8bc0bdac66e2fd5c58b6d3471 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/pull/90251
From: Antoine Martin <dev@ayakael.net>
Date: Wed, 9 Aug 2023 11:36:39 -0400
Subject: [PATCH 1/1] Rename CMAKE var for mono on libc-musl
---
src/mono/CMakeLists.txt | 6 +++---
src/mono/mono/mini/CMakeLists.txt | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/runtime/src/coreclr/pgosupport.cmake b/src/runtime/src/coreclr/pgosupport.cmake
index 719ac14ad99..34a42781ab2 100644
--- a/src/runtime/src/coreclr/pgosupport.cmake
+++ b/src/runtime/src/coreclr/pgosupport.cmake
@@ -25,13 +25,13 @@ function(add_pgo TargetName)
target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-generate)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fprofile-instr-generate")
if(CMAKE_CROSSCOMPILING AND CMAKE_C_COMPILER_ID MATCHES "Clang")
- if (CLR_CMAKE_HOST_ALPINE_LINUX)
+ if (CLR_CMAKE_TARGET_LINUX_MUSL)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -resource-dir ${CMAKE_SYSROOT}/usr/lib/clang/${CMAKE_C_COMPILER_VERSION}")
- else(CLR_CMAKE_HOST_ALPINE_LINUX)
+ else(CLR_CMAKE_TARGET_LINUX_MUSL)
string(REPLACE "." ";" CLANG_VERSION "${CMAKE_C_COMPILER_VERSION}")
list(POP_FRONT CLANG_VERSION CLANG_VERSION_MAJOR)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -resource-dir ${CMAKE_SYSROOT}/usr/lib/llvm-${CLANG_VERSION_MAJOR}/lib/clang/${CMAKE_C_COMPILER_VERSION}")
- endif(CLR_CMAKE_HOST_ALPINE_LINUX)
+ endif(CLR_CMAKE_TARGET_LINUX_MUSL)
endif(CMAKE_CROSSCOMPILING AND CMAKE_C_COMPILER_ID MATCHES "Clang")
if(NOT LD_LLVM)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -fuse-ld=gold")
diff --git a/src/runtime/src/mono/CMakeLists.txt b/src/runtime/src/mono/CMakeLists.txt
index e04d9e9d364..00e54a25d69 100644
--- a/src/runtime/src/mono/CMakeLists.txt
+++ b/src/runtime/src/mono/CMakeLists.txt
@@ -943,10 +943,10 @@ else()
set(DISABLE_DLLMAP 1)
endif()
-if(CLR_CMAKE_HOST_ALPINE_LINUX)
- # Setting RLIMIT_NOFILE breaks debugging of coreclr on Alpine Linux for some reason
+if(CLR_CMAKE_TARGET_LINUX_MUSL)
+ # Setting RLIMIT_NOFILE breaks debugging of coreclr on musl-libc for some reason
add_definitions(-DDONT_SET_RLIMIT_NOFILE)
- # On Alpine Linux, we need to ensure that the reported stack range for the primary thread is
+ # On musl-libc, we need to ensure that the reported stack range for the primary thread is
# larger than the initial committed stack size.
add_definitions(-DENSURE_PRIMARY_STACK_SIZE)
endif()
diff --git a/src/runtime/src/mono/mono/mini/CMakeLists.txt.orig b/src/runtime/src/mono/mono/mini/CMakeLists.txt
index 5d6ef3d..c3e5414 100644
--- a/src/runtime/src/mono/mono/mini/CMakeLists.txt.orig
+++ b/src/runtime/src/mono/mono/mini/CMakeLists.txt
@@ -400,9 +400,9 @@ if(NOT DISABLE_SHARED_LIBS)
endif()
target_compile_definitions(monosgen-shared PRIVATE -DMONO_DLL_EXPORT)
# Alpine Linux implements ucontext in a different library
- if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+ if(CLR_CMAKE_TARGET_LINUX_MUSL AND TARGET_S390X)
target_link_libraries(monosgen-shared PRIVATE ucontext)
- endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+ endif(CLR_CMAKE_TARGET_LINUX_MUSL AND TARGET_S390X)
set_target_properties(monosgen-shared PROPERTIES OUTPUT_NAME ${MONO_SHARED_LIB_NAME})
if(MONO_SET_RPATH_ORIGIN)
set_target_properties(monosgen-shared PROPERTIES INSTALL_RPATH "$ORIGIN")
@@ -601,10 +601,10 @@ if(NOT DISABLE_EXECUTABLES)
target_link_libraries(mono-sgen PRIVATE icu_shim_objects)
endif()
target_link_libraries(mono-sgen PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS})
- # Alpine Linux implements ucontext in a different library
- if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+ # musl-libc implements ucontext in a different library
+ if(CLR_CMAKE_TARGET_LINUX_MUSL AND TARGET_S390X)
target_link_libraries(mono-sgen PRIVATE ucontext)
- endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+ endif(CLR_CMAKE_TARGET_LINUX_MUSL AND TARGET_S390X)
if(NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS AND NOT DISABLE_LINK_STATIC_COMPONENTS)
# if components are built statically, link them into runtime.
target_sources(mono-sgen PRIVATE "${mono-components-objects}")

View file

@ -1,30 +0,0 @@
From a73b8bacfcc5819926bc05173ab2f7850eb00da3 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/pull/91008
From: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Date: Wed, 23 Aug 2023 21:11:37 +0200
Subject: [PATCH] [mono] Handle enum return type when inlining CreateInstance
Use underlying base type when deciding how to inline a
CreateInstance invocation in mini_emit_inst_for_method.
Fixes https://github.com/dotnet/runtime/issues/90292
(Mono abort causing .NET 8 msbuild regression).
---
src/mono/mono/mini/intrinsics.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/runtime/src/mono/mono/mini/intrinsics.c b/src/runtime/src/mono/mono/mini/intrinsics.c
index b1e5e76723147..ef77b7dc89f2e 100644
--- a/src/runtime/src/mono/mono/mini/intrinsics.c
+++ b/src/runtime/src/mono/mono/mini/intrinsics.c
@@ -2079,7 +2079,9 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
MonoType *t = method_context->method_inst->type_argv [0];
MonoClass *arg0 = mono_class_from_mono_type_internal (t);
if (m_class_is_valuetype (arg0) && !mono_class_has_default_constructor (arg0, FALSE)) {
- if (m_class_is_primitive (arg0)) {
+ if (m_class_is_primitive (arg0) || m_class_is_enumtype (arg0)) {
+ if (m_class_is_enumtype (arg0))
+ t = mono_class_enum_basetype_internal (arg0);
int dreg = alloc_dreg (cfg, mini_type_to_stack_type (cfg, t));
mini_emit_init_rvar (cfg, dreg, t);
ins = cfg->cbb->last_ins;

View file

@ -1,13 +0,0 @@
diff --git a/src/runtime/eng/native/configurecompiler.cmake b/src/runtime/eng/native/configurecompiler.cmake
index c9a54547c0a..931da2cae5b 100644
--- a/src/runtime/eng/native/configurecompiler.cmake
+++ b/src/runtime/eng/native/configurecompiler.cmake
@@ -488,6 +488,8 @@ if (CLR_CMAKE_HOST_UNIX)
# other clang 16.0 suppressions
add_compile_options(-Wno-single-bit-bitfield-constant-conversion)
add_compile_options(-Wno-cast-function-type-strict)
+ add_compile_options(-Wno-incompatible-function-pointer-types-strict)
+ add_compile_options(-Wno-ignored-attributes)
else()
add_compile_options(-Wno-uninitialized)
add_compile_options(-Wno-strict-aliasing)

View file

@ -1,26 +0,0 @@
diff --git a/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp.orig b/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp
index 20b2494..165b190 100644
--- a/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp.orig
+++ b/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp
@@ -469,7 +469,7 @@ CrashInfo::ReadProcessMemory(void* address, void* buffer, size_t size, size_t* r
// performance optimization.
m_canUseProcVmReadSyscall = false;
assert(m_fdMem != -1);
- *read = pread64(m_fdMem, buffer, size, (off64_t)address);
+ *read = pread(m_fdMem, buffer, size, (off_t)address);
}
if (*read == (size_t)-1)
diff --git a/src/runtime/src/coreclr/debug/createdump/crashinfo.cpp.orig b/src/runtime/src/coreclr/debug/createdump/crashinfo.cpp
index 5addb79..79655d1 100644
--- a/src/runtime/src/coreclr/debug/createdump/crashinfo.cpp.orig
+++ b/src/runtime/src/coreclr/debug/createdump/crashinfo.cpp
@@ -760,7 +760,7 @@ CrashInfo::PageMappedToPhysicalMemory(uint64_t start)
}
uint64_t pagemapOffset = (start / PAGE_SIZE) * sizeof(uint64_t);
- uint64_t seekResult = lseek64(m_fdPagemap, (off64_t) pagemapOffset, SEEK_SET);
+ uint64_t seekResult = lseek(m_fdPagemap, (off_t) pagemapOffset, SEEK_SET);
if (seekResult != pagemapOffset)
{
int seekErrno = errno;