user/dotnet8: upgrade to 8.0.100 #277

Merged
ayakael merged 3 commits from dotnet8/upgrade-8.0.0 into edge 2023-11-28 00:53:16 +00:00
15 changed files with 243 additions and 382 deletions

View file

@ -2,15 +2,16 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=dotnet8-runtime
pkgver=8.0.0_pre7
pkgrel=2
_gittag=v8.0.0-preview.7.23375.6
pkgver=8.0.0
pkgrel=0
_gittag=v8.0.0
_giturl="https://github.com/dotnet/dotnet"
_testtag=e1cc0f181ffd4d755756d30d985513897d592ba4
_bunnytag=v12
_stage0ver=8.0.0_pre7-r2
_testtag=d3d39e7c404c6e45c3e7ab6621c5f6cabf1540b0
_bunnytag=v15
_stage0ver=8.0.100-r0
_patches="
aspnetcore_portable-build-workaround.patch
aspire_fix-gitinfo-target.patch
build_enable-timestamps.patch
installer_hard-dereference-tar-gz.patch
roslyn-analyzer_disable-apphost.patch
@ -29,8 +30,9 @@ _pkgver_sdk=${pkgver/0./0.10}
pkgdesc="The .NET $_pkgver_macro Core runtime"
# x86: blocked by https://github.com/dotnet/runtime/issues/77667
# armhf: blocked by https://github.com/dotnet/runtime/issues/77663
# upgrade needed
#arch="all !x86 !armhf"
# riscv64: blocked by https://github.com/dotnet/runtime/issues/84834
# s390x | ppc64le: mono-based runtime still has issues on musl
arch="all !x86 !armhf !riscv64 !s390x !ppc64le"
url=https://dotnet.microsoft.com
license="MIT"
provides="dotnet$_pkgver_name=$pkgver-r$pkgrel"
@ -203,7 +205,7 @@ build() {
ulimit -n 4096
# Disable use of LTTng as tracing on lttng <=2,13,0 is broken
# Disable use of LTTng as tracing on lttng <=2.13.0 is broken
# See https://github.com/dotnet/runtime/issues/57784.
if [ -f "/usr/lib/liblttng-ust.so.1 " ]; then
export DOTNET_LTTng=0
@ -236,8 +238,21 @@ build() {
riscv64|s390x|ppc64le) local args="$args /p:SourceBuildUseMonoRuntime=true";;
esac
# Source-Build now builds using portable RID
local args="$args /p:PortableBuild=true /p:PortableRid=linux-musl-$_dotnet_arch /p:_portableRidOverridden=true"
# Sets TargetRid manually as dotnet cannot be trusted to reliably compute
# the machine's runtime ID between releases.
# shellcheck disable=SC2034
. /etc/os-release
local VERSION_ID_DOT="${VERSION_ID//[^.]}"
while [ ${#VERSION_ID_DOT} -gt 1 ]; do
local VERSION_ID="${VERSION_ID%.*}"
local VERSION_ID_DOT="${VERSION_ID//[^.]}"
done
local VERSION_ID_DASH="${VERSION_ID//[^_]}"
while [ ${#VERSION_ID_DASH} -ge 1 ]; do
local VERSION_ID="${VERSION_ID%_*}"
local VERSION_ID_DASH="${VERSION_ID//[^_]}"
done
local args="$args /p:TargetRid=$ID.$VERSION_ID-$_dotnet_arch"
./build.sh \
--with-sdk "$_cli_root" \
@ -252,12 +267,13 @@ check() {
local _tests_timeout=1000
# Test suite disable flags
# following tests can only work after packaging step
local _disabled_tests="man-pages distribution-package bash-completion install-location release-version-sane"
local _disabled_tests="man-pages distribution-package bash-completion install-location release-version-sane managed-symbols-available tools-in-path"
# test broken: permission issue on lxc / pipelines
local _disabled_tests="$_disabled_tests createdump-aspnet workload"
# liblttng-ust_sys-sdt.h: no 'NT_STAPSDT' on Alpine's lttng-ust package
# lttng: known issue, see https://github.com/dotnet/runtime/issues/57784
local _disabled_tests="$_disabled_tests liblttng-ust_sys-sdt.h lttng"
local _disabled_tests="$_disabled_tests createdump-aspnet"
# test broken: cannot pg_ctl can't create postgresql server
local _disabled_tests="$_disabled_tests system-data-odbc"
# test broken: no such file or directory bug
local _disabled_tests="$_disabled_tests limits"
# {bundled,system}-libunwind: use system version on all but aarch64/armv7, as broken
# see https://github.com/redhat-developer/dotnet-regular-tests/issues/113
# disable on mono-flavored runtime as mono does not use libunwind
@ -266,14 +282,10 @@ check() {
s390x|ppc64le|armhf) local _disabled_tests="$_disabled_tests bundled-libunwind system-libunwind";;
*) local _disabled_tests="$_disabled_tests bundled-libunwind";;
esac
# test unit broken currently
_disabled_tests="$_disabled_tests system-libunwind"
# nativeaot is not supported on armv7
case $CARCH in
armv7) local _disabled_tests="$_disabled_tests nativeaot"
esac
# debugging-via-dotnet-dump hangs
local _disabled_tests="$_disabled_tests debugging-via-dotnet-dump"
msg "Unpacking produced dotnet"
export DOTNET_ROOT="$_checkdir/release"
@ -295,7 +307,7 @@ check() {
fi
if [ ! -d "$_checkdir"/turkey ]; then
cd "$_checkdir"/Turkey
dotnet publish -bl:"$_logdir"/check/turkey.binlog -f netcoreapp3.1 -c Release -p:VersionPrefix=1 -p:VersionSuffix="$(git rev-parse --short HEAD)" -o "$_checkdir"/turkey
dotnet publish -bl:"$_logdir"/check/turkey.binlog -f net6.0 -c Release -p:VersionPrefix=1 -p:VersionSuffix="$(git rev-parse --short HEAD)" -o "$_checkdir"/turkey
fi
msg "Running test suite"
@ -347,7 +359,7 @@ artifacts() {
-C "$subpkgdir"/$_libdir/dotnet/artifacts/$_pkgver_sdk/ \
--no-same-owner \
--exclude '*Intermediate*' \
--exclude '*linux-musl*'
--exclude '*alpine*'
}
bootstrap() {
@ -375,7 +387,7 @@ bootstrap() {
-C "$subpkgdir"/$_libdir/dotnet/artifacts/$_pkgver_sdk/ \
--no-same-owner \
--wildcards \
'*linux-musl*'
'*alpine*'
# assemble docs
find "$builddir" -iname 'dotnet*.1' -type f -exec cp '{}' "$subpkgdir"/$_libdir/dotnet/bootstrap/$_pkgver_sdk/docs/. \;
@ -500,17 +512,18 @@ aspnetcore_targeting_pack() {
}
sha512sums="
06cb81a5667153a7d6ae190d169dcafea88954d1d42f9f1ae0fffe7cb4787599d7cad5428f66a6ce10af24898bd4ffbe1b9e95f1d3b698641437298055ebd10f dotnet-tarball-v8.0.0-preview.7.23375.6.tar.gz
5598ae0b9044dd2d2b5eba10ce420cd14266bd25412b37e9766bbaf1b1ce79438a5c7db559431aa59c0b49f14187ca3f78a57065b7802df304910b00b6694bfa dotnet-release-v8.0.0-preview.7.23375.6.json
e9f3df13d093fac214778c1137857e065f58d4e0d2a48d540d8ed7bb41e2fd73b2b3f62a0aa5b0e80fa80a5b58ba77ff19b9d10a492802f8539e3a6ed79d299d dotnet-testsuite-e1cc0f181ffd4d755756d30d985513897d592ba4.tar.gz
0028d5d97b814b122d73137b4e0d64ca5d788aa0ae5fde500de722e23522827f2538f06e75acb17cc39b8917961ee78d1f0bbc84b2b624ae0e9bf88adca2ba6f dotnet-bunny-v12.tar.gz
094265462d66d97b51ebfbe5fb06d4a679b97881f1f5a07a87a282a96eeaabfe97ca42061d59aac71dd8861c07f07dda16a72e29ae03167407e51d3fd2767562 dotnet-tarball-v8.0.0.tar.gz
55f2c56f7fbed4137ebe5e81c7b86d199d7ff91c6e19fbc9a4af8cd5d0f0195273356ead8b80aedfff56a3d704a541a7c2a7395bec3fa5d6585f3afd056b1220 dotnet-release-v8.0.0.json
8fe41ddd03c1b98dc9eec5e337ca0dcc8fbeff65b67ac1a383bd7d1e5fd3c21b820dacd498d1c2268445bb634cfb9dba3e8924e71a98f2ccd8221b17fb079044 dotnet-testsuite-d3d39e7c404c6e45c3e7ab6621c5f6cabf1540b0.tar.gz
7f59b10878aa90a6953ee4d88d08fa932910a24018dace92b173ee87c847d14734f93dc5fc031982a3d0a5cb4ac223b83d0e548531c23c4e3326dc83510989a9 dotnet-bunny-v15.tar.gz
c3f31956976b77198e72a3fef3427338b6b2961f8c121416040c1105de0ce8073e46f4c2e9ef22a001aee69cbe39621c2ddac988522693110071dfae42f2e2b7 dotnet.sh.in
ad7373a112acc07a6a7bbc522d417b26d90b3e3ae9c1e66a6cc70af16af7e7111d9764e7758062d0a5e67f026cc44f2b111051c3d484bd56917f2144db88588b aspnetcore_portable-build-workaround.patch
e5b9b947226456844f705e66f3f19d4519ce88f360e3f3413999c2867c31d9008db78f5806bfee7185d7548c6279ef6492a40ff24c20ed9d58b6ef66b167d7a8 aspire_fix-gitinfo-target.patch
eed7a7481a967f6938de956a6df485efa6dd61bf36ae4a768493cb1f7da0296dc91e0f2f89f7c302083ba9cf0c778e28228ec1b52e902077a00072d7d9957ef3 build_enable-timestamps.patch
ab362bdbbea8d8116b6bf7bf58e330ce6d7d171b42613ac03514f76afa2574b75d6566148d1b72047fbfe61b40ac67b3f2d8af87a7074c790bf882a5b7e73960 installer_hard-dereference-tar-gz.patch
097db705c787501782a1b203e8c453453075dfcadc4f5282849c6ffdda4d7832f75c56089bced4542cc83704fe33842cc725084dac2ba261cacdaf54ae468b3c roslyn-analyzer_disable-apphost.patch
d732df247c721c9f677baabdd7f36dbf4b564814ff64164361065bb1c196b767494a1d39f634eadf01a23032c7b3e64102614b7213065c81096bbf3f8022e6a0 runtime_82269-mono-thread-coop-undefine-fortify-source.patch
c1e8a51bca47f13e60cb28fa3c58c4bdc0fd8fa19177855b6cc9a767016fc239064aced57530e227c772e302671fc91e86c718a39aecb05eb7f601c8d931de81 runtime_90251-rename-mono-cmake-host-var.patch
3354fa721809f1b94c579408ee78004ff3ca2ba79212c1a0ecc424a9955bb5d5a80c115d4c30dd257526f356ea76f0562db6f83d8dd0b6135f8c689886b3348d runtime_90251-rename-mono-cmake-host-var.patch
39e1b848d1ae81e4b81758522de7d3e36b11d2ab626565efb8e4cceae8da29018277709f0af8fcfa75be8da79f8d6432eb6aac49a5e82510c3aca34632df4d8e runtime_enable-system-libunwind.diff
887112eb2b103eadd6887529ebae7f9a75df2c2cb168e84fd40cc09f9bcd20917d428bbba06968b07b0a463890da82b1b2b1d033a3dd016e6494067464ae6f74 runtime_more-clang-16-suppression.patch
0c25319125ef5b0ad490b37a643c0c5257c796d5ed24f9ac404f698710b07de790bcbb0b6336d4a50025b94c3bff99b214951bd8f0a79a8d6f543ebaa300740f runtime_remove-usage-of-off64-t.patch

View file

@ -12,6 +12,8 @@ Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/ap
* `dotnet8-apphost-pack` (used by dotnet8-runtime)
* `dotnet8-hostfxr` (used by dotnet-host)
* `dotnet8-runtime`
* `dotnet8-runtime-artifacts` (aimed for internal use as bootstrap)
* `dotnet8-runtime-bootstrap` (aimed for internal use as bootstrap)
* `dotnet8-targeting-pack`
* `dotnet-host`
@ -30,13 +32,16 @@ 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-build` pulls.
* `community/dotnet8-build`
`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-runtime`
* `community/dotnet8-sdk`
As abuild does not allow different versions for subpackages, a different aport
is required to package runtime bits from dotnet8-build.
is required to package sdk 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:
@ -73,7 +78,7 @@ follow.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-build`
- `cd community/dotnet8-runtime`
3. Make your changes. Don't forget to add a changelog.
@ -88,7 +93,7 @@ follow.
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-build: descriptive description'`
- `git commit -m 'community/dotnet8-runtime: descriptive description'`
- `git push`
7. Create a merge request with your changes, tagging @ayakael for review.
@ -103,7 +108,7 @@ follow.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-build`
- `cd community/dotnet8-runtime`
3. Build the new upstream source tarball. Update the versions in the
@ -127,7 +132,7 @@ follow.
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-build: upgrade to <new-version>`
- `git commit -m 'community/dotnet8-runtime: upgrade to <new-version>`
- `git push`
8. Create a merge request with your changes, tagging @ayakael for review.

View file

@ -0,0 +1,20 @@
diff --git a/src/aspire/Directory.Build.targets.orig b/src/aspire/Directory.Build.targets
index 511adb03a5d..d62a050caab 100644
--- a/src/aspire/Directory.Build.targets.orig
+++ b/src/aspire/Directory.Build.targets
@@ -6,13 +6,12 @@
<PackageReadmeFile Condition="'$(PackageReadmeFile)' == '' And '$(ReadMeExists)' == 'true'">README.md</PackageReadmeFile>
</PropertyGroup>
- <Import Condition="'$(SampleProject)' == 'true' or '$(CI)' != 'true' " Project="eng\Versions.dev.targets" />
- <Import Condition="'$(SampleProject)' != 'true' and '$(CI)' == 'true' " Project="eng\Versions.targets" />
+ <Import Project="eng\Versions.dev.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<ItemGroup Condition="'$(ReadMeExists)' == 'true'">
<None Include="$(ReadMePath)" Pack="true" PackagePath="\" />
</ItemGroup>
-
+
</Project>

View file

@ -48,25 +48,23 @@ index e04d9e9d364..00e54a25d69 100644
# 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 b/src/runtime/src/mono/mono/mini/CMakeLists.txt
index d23b7985802..b5f63fc638c 100644
--- a/src/runtime/src/mono/mono/mini/CMakeLists.txt
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
@@ -378,10 +378,10 @@ if(NOT DISABLE_SHARED_LIBS)
add_library(monosgen-shared SHARED $<TARGET_OBJECTS:monosgen-objects>)
target_compile_definitions(monosgen-objects PRIVATE -DMONO_DLL_EXPORT)
@@ -400,9 +400,9 @@ if(NOT DISABLE_SHARED_LIBS)
endif()
- # Alpine Linux implements ucontext in a different library
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)
+ # musl-libc implements ucontext in a different library
+ 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 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")
@@ -560,10 +560,10 @@ if(NOT DISABLE_EXECUTABLES)
@@ -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})
@ -80,8 +78,3 @@ index d23b7985802..b5f63fc638c 100644
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}")
diff --git a/src/runtime/src/coreclr/pgosupport.cmake.orig b/src/runtime/src/coreclr/pgosupport.cmake
index 719ac14..34a4278 100644
--- a/src/runtime/src/coreclr/pgosupport.cmake.orig
+++ b/src/runtime/src/coreclr/pgosupport.cmake

View file

@ -2,9 +2,9 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=dotnet8-sdk
pkgver=8.0.100_pre7
_bldver=8.0.0_pre7-r2
pkgrel=2
pkgver=8.0.100
_bldver=8.0.0-r0
pkgrel=0
# Following for dotnet build version 6.0 and up
_pkgver_macro=${pkgver%.*}
@ -14,8 +14,9 @@ _bldver_ver=${_bldver_ver/0./0.10}
pkgdesc="The .NET $_pkgver_macro SDK"
# x86: blocked by https://github.com/dotnet/runtime/issues/77667
# armhf: blocked by https://github.com/dotnet/runtime/issues/77663
# upgrade needed
#arch="all !x86 !armhf"
# riscv64: blocked by https://github.com/dotnet/runtime/issues/84834
# s390x | ppc64le: mono-based runtime still has issues on musl
arch="all !x86 !armhf !riscv64 !s390x !ppc64le"
url=https://dotnet.microsoft.com
license="MIT"
makedepends="dotnet$_pkgver_name-runtime-bootstrap=$_bldver"
@ -119,7 +120,6 @@ doc() {
default_doc
pkgdesc="Docs for .NET"
# licenses
install -dm 755 "$subpkgdir"/usr/share/licenses/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/LICENSE.txt "$subpkgdir"/usr/share/licenses/dotnet/.

View file

@ -7,8 +7,6 @@ Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/ap
# Building info
## Generated packages
* `dotnet8-build` (aimed for internal use as bootstrap)
* `dotnet8-build-artifacts` (aimed for internal use as bootstrap)
* `dotnet8-sdk`
* `dotnet8-templates` (required by sdk)
* `dotnet-zsh-completion`
@ -31,13 +29,18 @@ 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-build` pulls.
* `community/dotnet8-build`
`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-runtime`
* `community/dotnet8-sdk`
As abuild does not allow different versions for subpackages, a different aport
is required to package runtime bits from dotnet8-build.
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:
@ -74,7 +77,7 @@ follow.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-build`
- `cd community/dotnet8-sdk`
3. Make your changes. Don't forget to add a changelog.
@ -89,7 +92,7 @@ follow.
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-build: descriptive description'`
- `git commit -m 'community/dotnet8-sdk: descriptive description'`
- `git push`
7. Create a merge request with your changes, tagging @ayakael for review.
@ -104,7 +107,7 @@ follow.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-build`
- `cd community/dotnet8-sdk`
3. Build the new upstream source tarball. Update the versions in the
@ -128,7 +131,7 @@ follow.
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-build: upgrade to <new-version>`
- `git commit -m 'community/dotnet8-sdk: upgrade to <new-version>`
- `git push`
8. Create a merge request with your changes, tagging @ayakael for review.

View file

@ -2,24 +2,26 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=dotnet8-stage0
pkgver=8.0.0_pre7
pkgrel=2
pkgver=8.0.100
pkgrel=0
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
# Tag of tarball generator.
_gittag=v8.0.0-preview.7.23375.6
_gittag=v8.0.0
# Versions of prebuilt artifacts and bootstrap tar
_artifactsver="8.0.100-preview.7.23376.1.centos.8-x64"
_bootstrapver="8.0.100-preview.7.23376.3"
_bootstraprel=2
_installerver=${_gittag/v}
_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
@ -27,24 +29,20 @@ _patches="
runtime_more-clang-16-suppression.patch
runtime_remove-usage-of-off64-t.patch
"
_extra_nupkgs="
https://globalcdn.nuget.org/packages/microsoft.netcore.app.host.linux-musl-x64.7.0.2.nupkg
"
_pkgver_macro=${pkgver%.*}
_pkgver_prior=1
_pkgver_name="${_pkgver_macro//[.0]}"
_pkgver_sdk=${pkgver/0./0.10}
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/36748
# upgrade needed
#arch="all !x86 !armhf"
# 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" # Testsuite in main -build aport
options="!check net" # Testsuite in main -build aport
subpackages="
dotnet$_pkgver_name-stage0-artifacts:artifacts:noarch
dotnet$_pkgver_name-stage0-bootstrap
@ -52,14 +50,12 @@ subpackages="
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://dotnetbuilds.azureedge.net/public/Sdk/$_bootstrapver/dotnet-sdk-$_bootstrapver-linux-musl-x64.tar.gz
dotnet-sdk-$_bootstrapver-linux-musl-arm64.noextract::https://dotnetbuilds.azureedge.net/public/Sdk/$_bootstrapver/dotnet-sdk-$_bootstrapver-linux-musl-arm64.tar.gz
dotnet-sdk-$_bootstrapver-linux-musl-arm.noextract::https://dotnetbuilds.azureedge.net/public/Sdk/$_bootstrapver/dotnet-sdk-$_bootstrapver-linux-musl-arm.tar.gz
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
dotnet-sdk-$_bootstrapver-r$_bootstraprel-linux-musl-riscv64.noextract::https://lab.ilot.io/ayakael/dotnet-stage0/-/releases/$_bootstrapver-r$_bootstraprel/downloads/sdk/dotnet-sdk-$_bootstrapver-r$_bootstraprel-linux-musl-riscv64.tar.xz
Private.SourceBuilt.Artifacts.$_artifactsver.noextract::https://dotnetcli.azureedge.net/source-built-artifacts/assets/Private.SourceBuilt.Artifacts.$_artifactsver.tar.gz
$_extra_nupkgs
$_patches
"
@ -164,12 +160,6 @@ prepare() {
tar -xf "$srcdir"/dotnet-sdk-$_pkgver_macro*$_dotnet_arch.noextract -C "$_cli_root" --no-same-owner
for i in $_extra_nupkgs; do
local filename=${i/::*}
local filename=${filename##*/}
$_nuget push "$srcdir"/$filename --source="$_packagesdir"
done
# 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
@ -374,14 +364,14 @@ bootstrap() {
local _iltoolsver=$(grep \<MicrosoftNETCoreILAsmVersion "$builddir"/PackageVersions.props | sed -E 's|</?MicrosoftNETCoreILAsmVersion>||g' | tr -d ' ')
install -dm 755 \
"$subpkgdir"/$_libdir/dotnet/bootstrap/$_pkgver_sdk/docs \
"$subpkgdir"/$_libdir/dotnet/bootstrap/$_pkgver_sdk/comp \
"$subpkgdir"/$_libdir/dotnet/artifacts/$_pkgver_sdk
"$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_sdk/ \
-C "$subpkgdir"/$_libdir/dotnet/bootstrap/$pkgver/ \
--no-same-owner
local _iltoolsArray="
@ -403,18 +393,13 @@ bootstrap() {
"
# 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_sdk/ || true; done
for i in $_extra_nupkgs; do
local filename=${i/::*}
local filename=${filename##*/}
install -Dm644 "$srcdir"/$filename "$subpkgdir"/$_libdir/dotnet/artifacts/$_pkgver_sdk/
done
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_sdk/$i
local nupath="$subpkgdir"$_libdir/dotnet/artifacts/$pkgver/$i
local nupath=$(find $nupath || true)
local nupkg="${nupath##*/}"
local nuname="${nupkg/.nupkg}"
@ -449,31 +434,31 @@ artifacts() {
# directory creation
install -dm 755 \
"$subpkgdir"/$_libdir/dotnet/artifacts/$_pkgver_sdk \
"$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_sdk/ \
-C "$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver/ \
--no-same-owner
}
sha512sums="
06cb81a5667153a7d6ae190d169dcafea88954d1d42f9f1ae0fffe7cb4787599d7cad5428f66a6ce10af24898bd4ffbe1b9e95f1d3b698641437298055ebd10f dotnet-tarball-v8.0.0-preview.7.23375.6.tar.gz
5598ae0b9044dd2d2b5eba10ce420cd14266bd25412b37e9766bbaf1b1ce79438a5c7db559431aa59c0b49f14187ca3f78a57065b7802df304910b00b6694bfa dotnet-release-v8.0.0-preview.7.23375.6.json
6b7bf38224573496eae08e3000792296de81e16a1bd5a253236427137de4a6a9d7950c99f08ad764e337aa33140db5160218f9ecea0bfbd60c6e6f301e6dd042 dotnet-sdk-8.0.100-preview.7.23376.3-linux-musl-x64.noextract
8e5bfb89b287f6ab478e6bd9f4ce1ec482ba4d00b2241f6b4d6081c5885ac0399233bfaf983994b485ea6541a4a2ab9b362cbd582012edb09a6785a7cd7fb292 dotnet-sdk-8.0.100-preview.7.23376.3-linux-musl-arm64.noextract
14a3c0aaedc787f9a05258138fb70effedb627cb46206bfdbb912936472b78cc3e24878b10b03e95339d3b7382b46a13a87783cb6a77a49243b75b31ecd94cb7 dotnet-sdk-8.0.100-preview.7.23376.3-linux-musl-arm.noextract
08b520d3e671e4e1d90ddf8e965dd50124f8216d03005bdc08497f0264f7a2767a99c67e6cf45464b8a9f206028cfe513433c5a585d188617523feae5eedf10e dotnet-sdk-8.0.100-preview.7.23376.3-r2-linux-musl-s390x.noextract
ad46d02742c4c605e30bfbee18eba0e491984e6986bd93fb78c9d9c95d2cdf5bfe17584b90582f783b1cb1b6b32bb7ef317ff63396fbcff9399800ecd5d09a94 dotnet-sdk-8.0.100-preview.7.23376.3-r2-linux-musl-ppc64le.noextract
cd2c4e1f3697f3679d37f76f7692389ce29d0fca92e0130a9f1241674150e78542ec1898568cf0b30d8599b954edcf5211823bf05f46b907aa58b79c677a0575 dotnet-sdk-8.0.100-preview.7.23376.3-r2-linux-musl-riscv64.noextract
554d02d10072b8ec9122a0877e86753ebf9875f69508fd18bae43fc9d6eed8655e7923af771d593f3c59ad49c0858cf88816934618d9e0b65bb614ebcdb360a2 Private.SourceBuilt.Artifacts.8.0.100-preview.7.23376.1.centos.8-x64.noextract
5c1fd9e250e7f08d996b7b335134973624a8d1afc331f7fda3a81eee7d2170e39905be20b8786e99078892b21d1582092aeee45d49c5feae3b2bd5374c306fec microsoft.netcore.app.host.linux-musl-x64.7.0.2.nupkg
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
c1e8a51bca47f13e60cb28fa3c58c4bdc0fd8fa19177855b6cc9a767016fc239064aced57530e227c772e302671fc91e86c718a39aecb05eb7f601c8d931de81 runtime_90251-rename-mono-cmake-host-var.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

@ -26,13 +26,16 @@ 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-build` pulls.
* `community/dotnet8-build`
`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-runtime`
* `community/dotnet8-sdk`
As abuild does not allow different versions for subpackages, a different aport
is required to package runtime bits from dotnet8-build.
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:
@ -69,7 +72,7 @@ follow.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-build`
- `cd community/dotnet8-runtime`
3. Make your changes. Don't forget to add a changelog.
@ -84,7 +87,7 @@ follow.
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-build: descriptive description'`
- `git commit -m 'community/dotnet8-runtime: descriptive description'`
- `git push`
7. Create a merge request with your changes, tagging @ayakael for review.
@ -99,7 +102,7 @@ follow.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-build`
- `cd community/dotnet8-runtime`
3. Build the new upstream source tarball. Update the versions in the
@ -123,7 +126,7 @@ follow.
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-build: upgrade to <new-version>`
- `git commit -m 'community/dotnet8-runtime: upgrade to <new-version>`
- `git push`
8. Create a merge request with your changes, tagging @ayakael for review.

View file

@ -1,26 +0,0 @@
From 65613dc9cf76432dcbde3db3db1005c2aa902fee Mon Sep 17 00:00:00 2001
From: Antoine Martin <dev@ayakael.net>
Date: Tue, 21 Feb 2023 15:51:31 -0500
Subject: [PATCH 09/15] aspnetcore_use-linux-musl-crossgen
Line causes build of aspnetcore on arm to look for linux version of
CrossGen2 rather than linux-musl. This removes the line so that
BuildOsName is pulled from TargetOsName as expected
---
.../App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
index 326968018..fa1f72e62 100644
--- a/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
+++ b/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
@@ -103,7 +103,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
Special case the crossgen2 package reference on Windows to avoid the x86 package when building in Visual Studio.
-->
<BuildOsName>$(TargetOsName)</BuildOsName>
- <BuildOsName Condition="'$(TargetOsName)' == 'linux-musl' and '$(TargetArchitecture)'!='x64'">linux</BuildOsName>
<BuildOsName Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier.Substring(0,$(TargetRuntimeIdentifier.IndexOf('-'))))</BuildOsName>
<Crossgen2BuildArchitecture Condition=" '$(BuildOsName)' == 'win' ">x64</Crossgen2BuildArchitecture>
<Crossgen2BuildArchitecture Condition=" '$(Crossgen2BuildArchitecture)' == '' ">$(BuildArchitecture)</Crossgen2BuildArchitecture>
--
2.38.2

View file

@ -0,0 +1,32 @@
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

@ -0,0 +1,26 @@
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,174 +0,0 @@
From 50de22c7fa57c687a996bfdf6702871216881c0f Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/pull/79856
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 25 Feb 2023 15:19:00 -0500
Subject: [PATCH 1/1] [threads] Save errno when using posix semaphores for
thread transitions
We already save/restore GetLastError on win32. Do it on posix
platforms, too.
If one thread is in a pinvoke wrapper, while another thread triggers a
STW, the pinvoke wrapper will self-suspend the thread and wait for a
notification to resume. Depending on the platform we can use win32
primitives, Mach semaphores or POSIX semaphores. win32 and posix can
both change the value of last error (errno, respectively) while the
thread is suspended.
That means that code like this (generated by the
LibraryImportAttribute source generator) cannot reliably retrieve the
error from the last pinvoke:
```csharp
__retVal = __PInvoke(__path_native, mode); // there is a pinvoke wrapper here, that transitions from GC Safe to GC Unsafe mode
__lastError = System.Runtime.InteropServices.Marshal.GetLastSystemError();
```
The solution is to explicitly preserve the value of GetLastError/errno
when exiting from GC Safe.
Fixes https://github.com/dotnet/runtime/issues/77364
---
.../src/mono/mono/utils/mono-threads-coop.c | 12 +++---
.../src/mono/mono/utils/mono-threads.c | 4 +-
.../src/mono/mono/utils/mono-threads.h | 43 ++++++++++++++++---
3 files changed, 45 insertions(+), 14 deletions(-)
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 4ed659d66..c562ada67 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads-coop.c
+++ b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
@@ -337,10 +337,10 @@ mono_threads_exit_gc_safe_region_internal (gpointer cookie, MonoStackData *stack
return;
#ifdef ENABLE_CHECKED_BUILD_GC
- W32_DEFINE_LAST_ERROR_RESTORE_POINT;
+ MONO_DEFINE_LAST_ERROR_RESTORE_POINT;
if (mono_check_mode_enabled (MONO_CHECK_MODE_GC))
coop_tls_pop (cookie);
- W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
+ MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
#endif
mono_threads_exit_gc_safe_region_unbalanced_internal (cookie, stackdata);
@@ -365,7 +365,7 @@ mono_threads_exit_gc_safe_region_unbalanced_internal (gpointer cookie, MonoStack
/* Common to use enter/exit gc safe around OS API's affecting last error. */
/* This method can call OS API's that will reset last error on some platforms. */
/* To reduce errors, we need to restore last error before exit gc safe. */
- W32_DEFINE_LAST_ERROR_RESTORE_POINT;
+ MONO_DEFINE_LAST_ERROR_RESTORE_POINT;
info = (MonoThreadInfo *)cookie;
@@ -398,7 +398,7 @@ mono_threads_exit_gc_safe_region_unbalanced_internal (gpointer cookie, MonoStack
info->user_data = NULL;
}
- W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
+ MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
}
void
@@ -652,14 +652,14 @@ mono_threads_suspend_policy_init (void)
// otherwise if one of the old environment variables is set, use that.
// otherwise use full preemptive suspend.
- W32_DEFINE_LAST_ERROR_RESTORE_POINT;
+ MONO_DEFINE_LAST_ERROR_RESTORE_POINT;
(policy = threads_suspend_policy_getenv ())
|| (policy = threads_suspend_policy_default ())
|| (policy = threads_suspend_policy_getenv_compat ())
|| (policy = MONO_THREADS_SUSPEND_FULL_PREEMPTIVE);
- W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
+ MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
g_assert (policy);
mono_threads_suspend_policy_hidden_dont_modify = (char)policy;
diff --git a/src/runtime/src/mono/mono/utils/mono-threads.c b/src/runtime/src/mono/mono/utils/mono-threads.c
index 2ef2fe45b..41dbf3032 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads.c
+++ b/src/runtime/src/mono/mono/utils/mono-threads.c
@@ -1894,7 +1894,7 @@ mono_thread_info_uninstall_interrupt (gboolean *interrupted)
/* Common to uninstall interrupt handler around OS API's affecting last error. */
/* This method could call OS API's on some platforms that will reset last error so make sure to restore */
/* last error before exit. */
- W32_DEFINE_LAST_ERROR_RESTORE_POINT;
+ MONO_DEFINE_LAST_ERROR_RESTORE_POINT;
g_assert (interrupted);
*interrupted = FALSE;
@@ -1917,7 +1917,7 @@ mono_thread_info_uninstall_interrupt (gboolean *interrupted)
THREADS_INTERRUPT_DEBUG ("interrupt uninstall tid %p previous_token %p interrupted %s\n",
mono_thread_info_get_tid (info), previous_token, *interrupted ? "TRUE" : "FALSE");
- W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
+ MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
}
static MonoThreadInfoInterruptToken*
diff --git a/src/runtime/src/mono/mono/utils/mono-threads.h b/src/runtime/src/mono/mono/utils/mono-threads.h
index 6a548b183..45353db4e 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads.h
+++ b/src/runtime/src/mono/mono/utils/mono-threads.h
@@ -866,19 +866,50 @@ mono_win32_interrupt_wait (PVOID thread_info, HANDLE native_thread_handle, DWORD
void
mono_win32_abort_blocking_io_call (THREAD_INFO_TYPE *info);
-#define W32_DEFINE_LAST_ERROR_RESTORE_POINT \
+#else
+
+
+#endif
+
+#ifdef USE_WINDOWS_BACKEND
+
+/* APC calls can change GetLastError while a thread is suspended. Save/restore it when doing thread
+ state transitions (for example in m2n wrappers) in order to protect the result of the last
+ pinvoke */
+
+#define MONO_DEFINE_LAST_ERROR_RESTORE_POINT \
const DWORD _last_error_restore_point = GetLastError ();
-#define W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT \
+#define MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT \
/* Only restore if changed to prevent unnecessary writes. */ \
if (GetLastError () != _last_error_restore_point) \
mono_SetLastError (_last_error_restore_point);
+#elif defined(USE_WASM_BACKEND) || defined (USE_POSIX_BACKEND)
+
+#define MONO_DEFINE_LAST_ERROR_RESTORE_POINT \
+ int _last_errno_restore_point = errno;
+
+#define MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT \
+ if (errno != _last_errno_restore_point) \
+ errno = _last_errno_restore_point;
+
+/* Posix semaphores set errno on failure and sporadic wakeup. GC state transitions are done in n2m
+ * and m2n wrappers and may change the value of errno from the last pinvoke. Use these macros to
+ * save/restore errno when doing thread state transitions. */
+
+#elif defined(USE_MACH_BACKEND)
+
+/* Mach semaphores don't set errno on failure. Change this to be the same as POSIX if some other primitives used
+ in thread state transitions pollute errno. */
+
+#define MONO_DEFINE_LAST_ERROR_RESTORE_POINT /* nothing */
+#define MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT /* nothing */
+
#else
-
-#define W32_DEFINE_LAST_ERROR_RESTORE_POINT /* nothing */
-#define W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT /* nothing */
-
+#error "unknown threads backend, not sure how to save/restore last error"
#endif
+
+
#endif /* __MONO_THREADS_H__ */
--
2.38.4

View file

@ -48,25 +48,23 @@ index e04d9e9d364..00e54a25d69 100644
# 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 b/src/runtime/src/mono/mono/mini/CMakeLists.txt
index d23b7985802..b5f63fc638c 100644
--- a/src/runtime/src/mono/mono/mini/CMakeLists.txt
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
@@ -378,10 +378,10 @@ if(NOT DISABLE_SHARED_LIBS)
add_library(monosgen-shared SHARED $<TARGET_OBJECTS:monosgen-objects>)
target_compile_definitions(monosgen-objects PRIVATE -DMONO_DLL_EXPORT)
@@ -400,9 +400,9 @@ if(NOT DISABLE_SHARED_LIBS)
endif()
- # Alpine Linux implements ucontext in a different library
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)
+ # musl-libc implements ucontext in a different library
+ 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 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")
@@ -560,10 +560,10 @@ if(NOT DISABLE_EXECUTABLES)
@@ -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})
@ -80,8 +78,3 @@ index d23b7985802..b5f63fc638c 100644
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}")
diff --git a/src/runtime/src/coreclr/pgosupport.cmake.orig b/src/runtime/src/coreclr/pgosupport.cmake
index 719ac14..34a4278 100644
--- a/src/runtime/src/coreclr/pgosupport.cmake.orig
+++ b/src/runtime/src/coreclr/pgosupport.cmake

View file

@ -0,0 +1,30 @@
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,42 +0,0 @@
diff --git a/src/runtime/src/mono/CMakeLists.txt b/src/runtime/src/mono/CMakeLists.txt
index fad619577bf..91a4a545c42 100644
--- a/src/runtime/src/mono/CMakeLists.txt
+++ b/src/runtime/src/mono/CMakeLists.txt
@@ -943,7 +943,7 @@ else()
set(DISABLE_DLLMAP 1)
endif()
-if(CLR_CMAKE_HOST_ALPINE_LINUX)
+if(CLR_CMAKE_TARGET_LINUX_MUSL)
# Setting RLIMIT_NOFILE breaks debugging of coreclr on Alpine Linux 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
diff --git a/src/runtime/src/mono/mono/mini/CMakeLists.txt b/src/runtime/src/mono/mono/mini/CMakeLists.txt
index d23b7985802..da7563ac4d3 100644
--- a/src/runtime/src/mono/mono/mini/CMakeLists.txt
+++ b/src/runtime/src/mono/mono/mini/CMakeLists.txt
@@ -379,9 +379,9 @@ if(NOT DISABLE_SHARED_LIBS)
target_compile_definitions(monosgen-objects PRIVATE -DMONO_DLL_EXPORT)
endif()
# 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")
@@ -561,9 +561,9 @@ if(NOT DISABLE_EXECUTABLES)
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)
+ 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}")