diff --git a/testing/dotnet5-bootstrap/APKBUILD b/testing/dotnet5-bootstrap/APKBUILD new file mode 100644 index 00000000000..fe53ff0758f --- /dev/null +++ b/testing/dotnet5-bootstrap/APKBUILD @@ -0,0 +1,354 @@ +# Maintainer: Antoine Martin (ayakael) +# Contributor: Antoine Martin (ayakael) + +# +# This is generated from dotnet5-build's APKBUILD. +# Any modifications to be done in that APKBUILD and propagated by +# executing 'abuild _update_bootstrap' +# +# Variables for dotnet build version 5.0 +# This APKBUILD is designed to be the same for version 5.0 and under +# except for the variables in this first section +# + +pkgname=dotnet5-bootstrap +pkgver=5.0.211 +pkgrel=0 + +# Tag of tarball generator. This may change from usual due to mistakes from upstream +_installertag="v$pkgver-SDK" + +# Tag of SBRP builder for dotnet 5.0 +_sbrptag=6ce5818b1c1828ccdc8ac63d460d029c6391a401 + +# this should match what is sourced by source-build's ./prep.sh script +# and, at the very least, the artifacts version sourced, as defined in +# eng/Version.Details.xml by var PrivateSourceBuiltArtifactsPackageVersion +# Sometimes, this needs updating by stage0 scripts, thus it is bumped from this +# version to establish that we are moving away from upstream +_bootstrapver=5.0.211-r0 + +# LLVM version to be used for this build +_llvmver=12 + +# 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=" + application-insights_fix-net40-location.patch + build_darc-fix-alpine.patch + build_musl-build.patch + installer_forgotten-MicrosoftAspNetCoreAppRuntimePac.patch + references_sh-build-fix.patch + roslyn_added-previously-built-artifacts-repo.patch + runtime_add-rid-for-alpine-315.patch + runtime_use-latest-microsoftnetcoreplatformspackage.patch + runtime_link-order.patch + runtime_non-portable-distrorid-fix-alpine.patch + sdk_add-zsh-compdef-completion-script.patch + sdk_telemetry-optout.patch + " + +# Custom prepare +default_prepare() { + local _artifactsver=$(find /usr/share/dotnet/artifacts/$_pkgver_macro* -maxdepth 0 -type d | tail -n1 | sed 's|..*\/||') + sed -i "s|/path/to/artifacts|/usr/share/dotnet/artifacts/$_artifactsver|" "$srcdir"/roslyn_added-previously-built-artifacts-repo.patch +} + +# Following for for dotnet builds version 5.0 and under +_pkgver_macro=${pkgver%.*} +_pkgver_prior=${pkgver%.*.*} +_pkgver_name=${_pkgver_macro//[.0]} +pkgdesc="The .NET $_pkgver_macro SDK" +arch="x86_64" +case $CARCH in + x86_64) _dotnet_arch=x64;; + aarch64) _dotnet_arch=arm64;; + armv7) _dotnet_arch=arm;; +esac +url=https://www.microsoft.com/net/core +license="MIT" +_bootstrappkg="stage0" +makedepends=" + bash + clang + cmake + dotnet$_pkgver_name-$_bootstrappkg=$_bootstrapver + dotnet$_pkgver_name-$_bootstrappkg-artifacts=$_bootstrapver + findutils + git + grep + icu-dev + inetutils-syslogd + krb5-dev + libgit2-dev + libintl + libunwind-dev + libxml2-dev + libxml2-utils + linux-headers + lldb-dev + llvm$_llvmver-dev + lttng-ust-dev + nodejs + openssl-dev + zlib-dev + " +options="!check" # No test suite + +# packages artifacts if building bootstrap +[ "$_bootstrappkg" = "stage0" ] && subpackages="$pkgname-artifacts" + +source=" + source-build-$_installertag.tar.gz::https://github.com/dotnet/source-build/archive/refs/tags/$_installertag.tar.gz + source-build-reference-packages-$_sbrptag.tar.gz::https://github.com/dotnet/source-build-reference-packages/archive/$_sbrptag.tar.gz + $_patches + " +builddir="$srcdir/source-build-${_installertag/v}" +_sbrpdir="$srcdir"/source-build-reference-packages-$_sbrptag +_artifactsdir="/usr/share/dotnet/artifacts/${_bootstrapver/-*}" +_referencesdir="/usr/share/dotnet/artifacts/${_bootstrapver/-*}/SourceBuildReferencePackages" +_cli_root="$srcdir"/bootstrap + +# Custom patch logics for dotnet version 5.0 and under +_patch() { + local i failed= + if ! have_patches; then + return 0 + fi + [ -d "$builddir" ] || { error "Is \$builddir set correctly?"; return 1; } + msg "Deploying patches" + for i in $source; do + case ${i%::*} in + build_*.patch) + echo "applying $i to sourcebuild" + cd "$builddir" + patch ${patch_args:--Np1} -i "$srcdir/$(filename_from_uri $i)" || failed="$failed $i" + ;; + references_*.patch) + echo "applying $i to references" + cd "$_sbrpdir" + patch ${patch_args:--Np1} -i "$srcdir/$(filename_from_uri $i)" || failed="$failed $i" + ;; + *.patch) + local _package=$(echo $i | sed 's|_.*||') + local _patch=$(echo $i | sed "s|$_package\_||") + echo "deploying $_patch to $_package for application by sourcebuild" + [ -d "$builddir"/patches/$_package ] || mkdir -p "$builddir"/patches/$_package + cp "$srcdir"/"$i" "$builddir"/patches/$_package/$_patch + ;; + esac + done + + if [ -z "$failed" ]; then + return 0 + fi + error "The following patches failed to apply:" + for i in $failed; do + printf " %s\n" "$i" + done +} + +# aport for bootstrap is effectively a copy of this aport, except that it +# builds using stage0 bits, which are sourced from Microsoft prebuilts. +# Another major difference is that rather than package build artifacts +# under $dotnet_path/build to be packages later, it send artifacts to +# $dotnet_path/bootstrap, as this is the directory that is sourced by +# _prepare_bootstrap for build. +_update_bootstrap() { + msg "Updating bootstrap APKBUILD" + # Copy patches + rm ../dotnet$_pkgver_name-bootstrap/*.patch || true + for i in ../dotnet"$_pkgver_name"-build/*.patch; do + cp $i ${i/$_pkgver_name-build/$_pkgver_name-bootstrap} + done + + # Generate bootstrap + { + echo -n "# " + echo "Maintainer: Antoine Martin (ayakael) " + echo "# Contributor: Antoine Martin (ayakael) " + echo + echo "#" + echo "# This is generated from dotnet$_pkgver_name-build's APKBUILD." + echo "# Any modifications to be done in that APKBUILD and propagated by" + echo -n "# executing 'abuild _update_bootstrap'" + sed \ + -e "s/pkgname=dotnet$_pkgver_name-build/pkgname=dotnet$_pkgver_name-bootstrap/" \ + -e "s/_bootstrappkg=\"bootstrap\"/_bootstrappkg=\"stage0\"/" \ + -e "1,2d" \ + ../dotnet$_pkgver_name-build/APKBUILD + } > ../dotnet$_pkgver_name-bootstrap/APKBUILD +} + +_build_sbrp() { + msg "Building source build reference packages" + cd "$_sbrpdir" + ./build.sh \ + --with-sdk "$_cli_root" \ + --with-packages "$builddir"/artifacts/$_dotnet_arch/Release/Private.SourceBuilt.Artifacts.*.tar.gz \ + > build.log || { tail -n 1000 build.log; return 1; } +} + +# dotnet relies on itself when building, we thus need a bootstrap runtime +# that is copied to write-capable folder +_prepare_bootstrap() { + msg "Settings up bootstrap" + cp -r /usr/share/dotnet/bootstrap/${_bootstrapver/-*} "$_cli_root" + + # Corrupt libcoreclrtraceptprovider.so when lttng <=2.13.0 + # is detected as tracing is broken on dotnet platform + # due to ABI changes + # See https://github.com/dotnet/runtime/issues/57784. + if [ -f "/usr/lib/liblttng-ust.so.1 " ]; then + rm "$_cli_root"/shared/Microsoft.NETCore.App/*/libcoreclrtraceptprovider.so + fi +} + +# Build doesn't set all the right executable bits for the right file types +_fix_executable() { + # add executable bit + find "$1" -type f \( \ + -name 'apphost' -o \ + -name 'singlefilehost' -o \ + -name 'lib*so' \ + \) \ + -exec chmod +x '{}' \; + + # remove executable bit + find "$1" -type f \( \ + -name '*.a' -o \ + -name '*.dll' -o \ + -name '*.h' -o \ + -name '*.json' -o \ + -name '*.pdb' -o \ + -name '*.props' -o \ + -name '*.pubxml' -o \ + -name '*.targets' -o \ + -name '*.txt' -o \ + -name '*.xml' \ + \) \ + -exec chmod -x '{}' \; +} + +prepare() { + default_prepare + + # source-build expects to be in a git repo + git init + git add ./* + git commit -m 'initial commit' + git remote add origin https://github.com/dotnet/source-build.git + + _patch + _prepare_bootstrap + + # by default build populates these folders using Artifacts and SBRP archives + # we are instead going to populate them from the prebuilt artifacts provided + # by dotnetx-bootstrap-artifacts + [ -f "$builddir/packages" ] || mkdir -p "$builddir"/packages + cp -r "$_artifactsdir" "$builddir"/packages/prebuilt + mv "$builddir"/packages/prebuilt/SourceBuildReferencePackages "$builddir"/packages/reference + # make sure archives wont be downloaded or aren't expected. + [ -d "$builddir"/packages/archive ] && rm -r "$builddir"/packages/archive + + # by default, coreclr-tools is not sourced from dotnetx-bootstrap-artifacts, thus + # it'll be the wrong architecture. Below replaces default coreclr-tools with + # versions from artifacts, which have been built properly + mkdir -p "$builddir"/Tools/source-built + cp -r "$builddir"/packages/prebuilt/coreclr-tools "$builddir"/Tools/source-built/. +} + +build() { + msg "Building $pkgname-$pkgver" + + # logs args, else the output is forwarded to log files which isn't ideal in a + # pipeline environment + local args=" + /v:minimal + /p:LogVerbosity=minimal + /p:MinimalConsoleLogOutput=true + " + + # defaults args for build on Alpine + local args="$args + /p:SkipDownloadingPreviouslySourceBuiltPackages=true + /p:SkipDownloadingReferencePackages=true + /p:ContinueOnPrebuiltBaselineError=true + /p:SkipPrebuiltEnforcement=true + /p:UseSystemLibraries=true + /p:UseSystemLibunwind=true + " + + ./build.sh \ + --with-sdk "$_cli_root" \ + $args | tee -a build.log + + # only build references when building with stage0 + if [ "$_bootstrappkg" = "stage0" ]; then _build_sbrp; fi +} + +package() { + local subdir=${pkgname/*-} + local targetdir="$pkgdir"/usr/share/dotnet/$subdir/$pkgver + + # directory creation + install -dm 755 \ + "$targetdir"/docs \ + "$targetdir"/comp + + # unpack build artifacts to subdir defined by pkgname. If bootstrap, unpacks + # to bootstrap, if build unpacks to build + tar -xzf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz -C "$targetdir"/ --no-same-owner + + # assemble completions + install -m 755 "$builddir"/artifacts/src/sdk.*/scripts/register-completions.bash "$targetdir"/comp/ + install -m 755 "$builddir"/artifacts/src/sdk.*/scripts/register-completions.zsh "$targetdir"/comp/ + + # assemble docs + find "$builddir" -iname 'dotnet*.1' -type f -exec cp '{}' "$targetdir"/docs/ \; + + # some files either should or should not have executable bits + _fix_executable "$pkgdir" + + # See https://github.com/dotnet/source-build/issues/2579 + find "$pkgdir" -type f -name 'testhost.x86' -delete + find "$pkgdir" -type f -name 'vstest.console' -delete +} + +# 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" + + # directory creation + install -dm 755 \ + "$subpkgdir"/usr/share/dotnet/artifacts/$pkgver/SourceBuildReferencePackages \ + "$subpkgdir"/usr/share/licenses + + # extract artifacts to artifacts dir for use by future dotnet builds + tar -xzf "$builddir"/artifacts/$_dotnet_arch/Release/Private.SourceBuilt.Artifacts.*.tar.gz -C "$subpkgdir"/usr/share/dotnet/artifacts/$pkgver/ --no-same-owner \ + --exclude '*Intermediate*' + + # pulls SBRP artifacts + install -m 644 "$_sbrpdir"/artifacts/reference-packages/* "$subpkgdir"/usr/share/dotnet/artifacts/$pkgver/SourceBuildReferencePackages/. +} + +sha512sums=" +e4866c779d7a67ae934d80216af2623914dc5c2b64682171be004a429120e5aa31122bef9efe9b728abc1df68e953c6bd6646d9490925cc576371880c8a88fc5 source-build-v5.0.211-SDK.tar.gz +4d15c4a62342c6186053a5d9391567e0ee2c916382a1c81d6a8aff0dc0092f7889d49d7d5b357abda85d4c709d9599726bba8c2593236360b0373c35e3261208 source-build-reference-packages-6ce5818b1c1828ccdc8ac63d460d029c6391a401.tar.gz +fb1cffcacba8cf6439c05781442167905b8147d36665aef8df4fc7a573c26fa3dd0f1ed2ec680039715d25d73646c3633f5ad9f658f6e9ec85f6850efec87935 application-insights_fix-net40-location.patch +d77500c50ce9a9ce35281d54a1f6d9c00e1ca391567f1a05f3b0509aa6212353f48c2163fc277103930ee21ee143304997c55522fdf8e3de83d0ea9d7e2a6b13 build_darc-fix-alpine.patch +1df4da20afe8bc65ebe1ea6e8c2684be4a73794c255597429197aab52a690ae34563da0e4d23755e314c98edc4f3f584b53c33ccbb23e8415a64de185fc518d9 build_musl-build.patch +6f620d9d2644dd4a2b5157c1713aec8c0865c41a2b94499b290869f4fef724e5d60950e25ee767b5b9af6be3961ca4f42fde3c3714c4b24f08c65cd5dadaa447 installer_forgotten-MicrosoftAspNetCoreAppRuntimePac.patch +8acf2f6df8310eee7a786715b304100247cfbaebae17c51449b0c81085763e5babd17774f995668f487107ebd5ac7a1cda77ebc8b91409c88725fcf63581d1ce references_sh-build-fix.patch +72ee7064fb9042d4c37ca22c1fe8cd5c393db51086279db3c965142ac8367f6b34b3e6f7d1f36269d945d65587cd0cda068fa0f5e94a203a2383db530f805964 roslyn_added-previously-built-artifacts-repo.patch +70ca8f5177f9ef3b40c9d0ad0d527877a4179e61db7e4e90e69fb7a0ed214034b6a963ff1fd93dca197ef1b9ea03ca1fa85f84dea685d6f02589a88f84aa732d runtime_add-rid-for-alpine-315.patch +8cb8e38fb0d4bfc10b3a214ed2deabbcabaef85cbe2f2ad02cac9589a3e9a613116ef79e38122474fd5c3d6d1a24a2f7efe8f5c61855bb386e90198388bfcd4d runtime_use-latest-microsoftnetcoreplatformspackage.patch +619ebecf68bac7bd4ecf68effe31e84d1d338f3b850bc49288b957a5528fe3ed27ed844032f99c2c337c3ed214d1163db81923507100e6ec5f78af502dd610e1 runtime_link-order.patch +4a480d9502ad9d8c0c9a11879de29f181c2f7eff2e88ef7bd61611dc62ac23fbff9cf904b59186a05d4f5bb7a48d74aae4e09105f16d85a7a95082e2a9af2dd0 runtime_non-portable-distrorid-fix-alpine.patch +55afa9c74be6f5a87f1ff5aa44caad094cf620eb4388f6407218acf3d58a878f5565a0e875e95c3dbe0efca1879c120ee4b8076c521bfc9d6069a652c4a4fdd8 sdk_add-zsh-compdef-completion-script.patch +9fabfa18197f5a8104f816e2cd64156c72565709470b81fa323516b3cd5c55dbaf5383b065e2b7ae995303ee1020205995a5b52987b539abecc3700c261b59e4 sdk_telemetry-optout.patch +" diff --git a/testing/dotnet5-bootstrap/README.md b/testing/dotnet5-bootstrap/README.md new file mode 100644 index 00000000000..5b9c6ac4033 --- /dev/null +++ b/testing/dotnet5-bootstrap/README.md @@ -0,0 +1,12 @@ +# Description +APKBUILD for dotnet5-bootstrap, acting as intermediary between stage0 and +untainted dotnet build. This is a workaround for buildrepo, allowing automatic +build of dotnet after stage0, insuring that end-user doesn't have any binaries +"tainted" by Microsoft prebuilt binaries + +# Generated packages +* dotnet5-bootstrap (used by dotnet5-build for first untainted dotnet build) +* dotnet5-bootstrap-artifacts (provides nupkgs for dotnet5-build) + +# Special functions +To update, execute 'abuild _update_bootstrap diff --git a/testing/dotnet5-bootstrap/application-insights_fix-net40-location.patch b/testing/dotnet5-bootstrap/application-insights_fix-net40-location.patch new file mode 100644 index 00000000000..1f0f9bcb504 --- /dev/null +++ b/testing/dotnet5-bootstrap/application-insights_fix-net40-location.patch @@ -0,0 +1,22 @@ +From 387efb0ac01e40cd85cf9f5ce770be6437265ca4 Mon Sep 17 00:00:00 2001 +From: Antoine Martin +Date: Fri, 4 Jun 2021 13:32:53 +0000 +Subject: [PATCH] FIxed Net40 location + +Because paths on Linux are case sensitive. Applications insights looks +for /src/Core/Managed/net40 in net40 +while the repo has a Net40. Patch moves whatever is in Net40 to net40 + +(see https://github.com/microsoft/ApplicationInsights-dotnet/issues/2498) +--- + src/Core/Managed/{Net40 => net40}/CorrelationHelper.cs | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) + rename src/Core/Managed/{Net40 => net40}/CorrelationHelper.cs (100%) + +diff --git a/src/Core/Managed/Net40/CorrelationHelper.cs b/src/Core/Managed/net40/CorrelationHelper.cs +similarity index 100% +rename from src/Core/Managed/Net40/CorrelationHelper.cs +rename to src/Core/Managed/net40/CorrelationHelper.cs +-- +2.30.2 + diff --git a/testing/dotnet5-bootstrap/build_darc-fix-alpine.patch b/testing/dotnet5-bootstrap/build_darc-fix-alpine.patch new file mode 100644 index 00000000000..5241580a5bd --- /dev/null +++ b/testing/dotnet5-bootstrap/build_darc-fix-alpine.patch @@ -0,0 +1,32 @@ +From d07d50c6f8a5793badc50fb2c964b87dec87a3a1 Mon Sep 17 00:00:00 2001 +Patch-Source: https://github.com/dotnet/source-build/issues/1868 +From: Antoine Martin +Date: Thu, 15 Jul 2021 15:37:33 +0000 +Subject: [PATCH 1/1] Fixed darc init for Alpine + +Darc has a segmentation fault on Alpine due to not chosing the correct +binary architecture. This patch deletes all the wrong ones so that it +is forced to chose the correct one. This issue only occurs when using +dotnet-stage0-runtime, thus libunwind is suspected to be the issue as +stage0 wasn't built with system libunwind. +--- + eng/common/darc-init.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh +index 82b2b57..5227a37 100755 +--- a/eng/common/darc-init.sh ++++ b/eng/common/darc-init.sh +@@ -77,6 +77,9 @@ function InstallDarcCli { + else + echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath") + fi ++ for i in win* ubuntu* rhel* osx fedora* debian*; do ++ rm -R $toolpath/.store/microsoft.dotnet.darc/*/microsoft.dotnet.darc/*/tools/netcoreapp3.0/any/runtimes/${i} ++ done + } + + InstallDarcCli +-- +2.30.2 + diff --git a/testing/dotnet5-bootstrap/build_musl-build.patch b/testing/dotnet5-bootstrap/build_musl-build.patch new file mode 100644 index 00000000000..dda8692cc9c --- /dev/null +++ b/testing/dotnet5-bootstrap/build_musl-build.patch @@ -0,0 +1,75 @@ +From 345cf51b619d2b89b399a7e39b538baf5d1f2307 Mon Sep 17 00:00:00 2001 +From: "build@apk-groulx" +Date: Tue, 22 Feb 2022 18:38:01 +0000 +Subject: [PATCH 1/1] musl-build + +--- + Directory.Build.props | 2 +- + repos/aspnetcore.proj | 1 + + repos/installer.proj | 2 +- + repos/runtime.common.props | 4 ++-- + 4 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/Directory.Build.props b/Directory.Build.props +index d1b268bf..e2c5d5d3 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -202,7 +202,7 @@ + + freebsd-$(Platform) + osx-$(Platform) +- linux-$(Platform) ++ linux-musl-$(Platform) + win-$(Platform) + + +diff --git a/repos/aspnetcore.proj b/repos/aspnetcore.proj +index 23cac6d1..3d6f648c 100644 +--- a/repos/aspnetcore.proj ++++ b/repos/aspnetcore.proj +@@ -22,6 +22,7 @@ + $(BuildCommandArgs) /p:UseAppHost=false + $(BuildCommandArgs) /p:PublishCompressedFilesPathPrefix=$(SourceBuiltAspNetCoreRuntime) + $(BuildCommandArgs) /p:CheckEolTargetFramework=false ++ $(BuildCommandArgs) --os-name linux-musl + + +diff --git a/repos/installer.proj b/repos/installer.proj +index fd8a95be..1e55548a 100644 +--- a/repos/installer.proj ++++ b/repos/installer.proj +@@ -27,7 +27,7 @@ + $(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir) + + +- $(BuildCommandArgs) /p:AspNetCoreSharedFxInstallerRid=linux-$(Platform) ++ $(BuildCommandArgs) /p:AspNetCoreSharedFxInstallerRid=linux-musl-$(Platform) + + $(BuildCommandArgs) /p:CoreSetupRid=freebsd-x64 /p:PortableBuild=true + $(BuildCommandArgs) /p:CoreSetupRid=osx-x64 +diff --git a/repos/runtime.common.props b/repos/runtime.common.props +index 97ceb231..87126cbd 100644 +--- a/repos/runtime.common.props ++++ b/repos/runtime.common.props +@@ -15,7 +15,7 @@ + osx-x64 + freebsd-x64 + win-x64 +- linux-$(Platform) ++ linux-musl-$(Platform) + + false + false +@@ -43,7 +43,7 @@ + + $(CoreClrBuildArguments) /p:NoPgoOptimize=true + $(CoreClrBuildArguments) /p:KeepNativeSymbols=true +- $(CoreClrBuildArguments) /p:RuntimeOS=$(OverrideTargetRid.Substring(0, $(OverrideTargetRid.IndexOf("-")))) ++ $(CoreClrBuildArguments) /p:RuntimeOS=$(OverrideTargetRid.Substring(0, $(OverrideTargetRid.IndexOf("-"))))-musl + $(CoreClrBuildArguments) /p:RuntimeOS=$(OverrideTargetRid) + + +-- +2.34.1 + diff --git a/testing/dotnet5-bootstrap/installer_forgotten-MicrosoftAspNetCoreAppRuntimePac.patch b/testing/dotnet5-bootstrap/installer_forgotten-MicrosoftAspNetCoreAppRuntimePac.patch new file mode 100644 index 00000000000..1cce3a151a3 --- /dev/null +++ b/testing/dotnet5-bootstrap/installer_forgotten-MicrosoftAspNetCoreAppRuntimePac.patch @@ -0,0 +1,29 @@ +From 324b874cbadcf0d9a7f9187af51008f8efb2f9c1 Mon Sep 17 00:00:00 2001 +From: Antoine Martin +Date: Tue, 22 Feb 2022 20:07:56 +0000 +Subject: [PATCH 1/1] aspnetcore-fix + + Somewhere along the way, installer forgets MicrosoftAspNetCoreApp- + RuntimePackageVersion, thus expects version 5.0.14-servicing when + it actual file is for 5.0.14 This reminds installer what version + AspNetCoreappRuntime is by re-setting it as what it is usually set. + +--- + src/redist/targets/GenerateLayout.targets | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/redist/targets/GenerateLayout.targets b/src/redist/targets/GenerateLayout.targets +index 8e50a8ff7..4da6cef95 100644 +--- a/src/redist/targets/GenerateLayout.targets ++++ b/src/redist/targets/GenerateLayout.targets +@@ -11,6 +11,7 @@ + + + ++ $(MicrosoftNETCoreDotNetHostResolverPackageVersion) + $(MicrosoftAspNetCoreAppRuntimePackageVersion) + $(MicrosoftNETCoreAppRuntimeVersion) + $(MicrosoftWindowsDesktopAppPackageVersion) +-- +2.34.1 + diff --git a/testing/dotnet5-bootstrap/references_sh-build-fix.patch b/testing/dotnet5-bootstrap/references_sh-build-fix.patch new file mode 100644 index 00000000000..d2212db931d --- /dev/null +++ b/testing/dotnet5-bootstrap/references_sh-build-fix.patch @@ -0,0 +1,27 @@ +From f46cf7c4d6e8c92053993ff2081b820aae4ed886 Mon Sep 17 00:00:00 2001 +From: Antoine Martin +Date: Sat, 8 Jan 2022 17:18:05 +0000 +Subject: [PATCH 1/1] fix for sh + +Exec Command issue with bad character for busybox sh. +This patches by removing bad character so that it can run with busybox + +--- + src/targetPacks/assemble.targets | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/targetPacks/assemble.targets b/src/targetPacks/assemble.targets +index e7330ba0..a5ecb921 100644 +--- a/src/targetPacks/assemble.targets ++++ b/src/targetPacks/assemble.targets +@@ -87,7 +87,7 @@ + + + +- ++ + + + +-- +2.34.1 diff --git a/testing/dotnet5-bootstrap/roslyn_added-previously-built-artifacts-repo.patch b/testing/dotnet5-bootstrap/roslyn_added-previously-built-artifacts-repo.patch new file mode 100644 index 00000000000..e0e6ccbd8e7 --- /dev/null +++ b/testing/dotnet5-bootstrap/roslyn_added-previously-built-artifacts-repo.patch @@ -0,0 +1,30 @@ +From cd89c9d2f0a1692a8e12b7c00ba93168de716e0a Mon Sep 17 00:00:00 2001 +Patch-Source: https://github.com/dotnet/source-build/issues/2695 +From: Antoine Martin +Date: Thu, 20 Jan 2022 14:24:10 +0000 +Subject: [PATCH 1/1] roslyn_added-previously-built-artifacts-repo + +On rebuild, roslyn cannot seem to find certain nuget packages that are +usually provided by artifacts. Thus, this adds a nuget repo that points +to a yet-to-be-defined /path/to/artifacts. APKBUILD, using sed, adds +correct path to /usr/share/dotnet/artifacts/$_artifactsver in +default_prepare() function +--- + NuGet.config | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/NuGet.config b/NuGet.config +index 3cd2f6f4e6a..80f080d84e6 100644 +--- a/NuGet.config ++++ b/NuGet.config +@@ -3,6 +3,7 @@ + + + ++ + + + +-- +2.34.1 + diff --git a/testing/dotnet5-bootstrap/runtime_add-rid-for-alpine-315.patch b/testing/dotnet5-bootstrap/runtime_add-rid-for-alpine-315.patch new file mode 100644 index 00000000000..f395566eb1c --- /dev/null +++ b/testing/dotnet5-bootstrap/runtime_add-rid-for-alpine-315.patch @@ -0,0 +1,190 @@ +From 01a517aee9ad501c2b7dd90e44e316ffb8e2c35d Mon Sep 17 00:00:00 2001 +Patch-Source: https://github.com/dotnet/runtime/pull/62938 +From: Antoine Martin +Date: Sun, 2 Jan 2022 22:00:09 +0000 +Subject: [PATCH 2/2] add RID for Alpine 3.15 + +As of version 5.0.12, runtime does not have the RIDs for Alpine Linux 3.15. +This patch adds them. + +--- + .../runtime.compatibility.json | 114 ++++++++++++++++++ + .../Microsoft.NETCore.Platforms/runtime.json | 23 ++++ + .../runtimeGroups.props | 2 +- + 3 files changed, 138 insertions(+), 1 deletion(-) + +diff --git a/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json b/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json +index 844590f8022..6ff9cdd2cae 100644 +--- a/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json ++++ b/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json +@@ -508,6 +508,120 @@ + "any", + "base" + ], ++ "alpine.3.15": [ ++ "alpine.3.15", ++ "alpine.3.14", ++ "alpine.3.13", ++ "alpine.3.12", ++ "alpine.3.11", ++ "alpine.3.10", ++ "alpine.3.9", ++ "alpine.3.8", ++ "alpine.3.7", ++ "alpine.3.6", ++ "alpine", ++ "linux-musl", ++ "linux", ++ "unix", ++ "any", ++ "base" ++ ], ++ "alpine.3.15-arm": [ ++ "alpine.3.15-arm", ++ "alpine.3.15", ++ "alpine.3.14-arm", ++ "alpine.3.14", ++ "alpine.3.13-arm", ++ "alpine.3.13", ++ "alpine.3.12-arm", ++ "alpine.3.12", ++ "alpine.3.11-arm", ++ "alpine.3.11", ++ "alpine.3.10-arm", ++ "alpine.3.10", ++ "alpine.3.9-arm", ++ "alpine.3.9", ++ "alpine.3.8-arm", ++ "alpine.3.8", ++ "alpine.3.7-arm", ++ "alpine.3.7", ++ "alpine.3.6-arm", ++ "alpine.3.6", ++ "alpine-arm", ++ "alpine", ++ "linux-musl-arm", ++ "linux-musl", ++ "linux-arm", ++ "linux", ++ "unix-arm", ++ "unix", ++ "any", ++ "base" ++ ], ++ "alpine.3.15-arm64": [ ++ "alpine.3.15-arm64", ++ "alpine.3.15", ++ "alpine.3.14-arm64", ++ "alpine.3.14", ++ "alpine.3.13-arm64", ++ "alpine.3.13", ++ "alpine.3.12-arm64", ++ "alpine.3.12", ++ "alpine.3.11-arm64", ++ "alpine.3.11", ++ "alpine.3.10-arm64", ++ "alpine.3.10", ++ "alpine.3.9-arm64", ++ "alpine.3.9", ++ "alpine.3.8-arm64", ++ "alpine.3.8", ++ "alpine.3.7-arm64", ++ "alpine.3.7", ++ "alpine.3.6-arm64", ++ "alpine.3.6", ++ "alpine-arm64", ++ "alpine", ++ "linux-musl-arm64", ++ "linux-musl", ++ "linux-arm64", ++ "linux", ++ "unix-arm64", ++ "unix", ++ "any", ++ "base" ++ ], ++ "alpine.3.15-x64": [ ++ "alpine.3.15-x64", ++ "alpine.3.15", ++ "alpine.3.14-x64", ++ "alpine.3.14", ++ "alpine.3.13-x64", ++ "alpine.3.13", ++ "alpine.3.12-x64", ++ "alpine.3.12", ++ "alpine.3.11-x64", ++ "alpine.3.11", ++ "alpine.3.10-x64", ++ "alpine.3.10", ++ "alpine.3.9-x64", ++ "alpine.3.9", ++ "alpine.3.8-x64", ++ "alpine.3.8", ++ "alpine.3.7-x64", ++ "alpine.3.7", ++ "alpine.3.6-x64", ++ "alpine.3.6", ++ "alpine-x64", ++ "alpine", ++ "linux-musl-x64", ++ "linux-musl", ++ "linux-x64", ++ "linux", ++ "unix-x64", ++ "unix", ++ "any", ++ "base" ++ ], + "alpine.3.6": [ + "alpine.3.6", + "alpine", +diff --git a/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.json b/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.json +index 7d6aa102b50..a663a88166e 100644 +--- a/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.json ++++ b/src/libraries/pkg/Microsoft.NETCore.Platforms/runtime.json +@@ -138,6 +138,29 @@ + "alpine.3.13-x64" + ] + }, ++ "alpine.3.15": { ++ "#import": [ ++ "alpine.3.14" ++ ] ++ }, ++ "alpine.3.15-arm": { ++ "#import": [ ++ "alpine.3.15", ++ "alpine.3.14-arm" ++ ] ++ }, ++ "alpine.3.15-arm64": { ++ "#import": [ ++ "alpine.3.15", ++ "alpine.3.14-arm64" ++ ] ++ }, ++ "alpine.3.15-x64": { ++ "#import": [ ++ "alpine.3.15", ++ "alpine.3.14-x64" ++ ] ++ }, + "alpine.3.6": { + "#import": [ + "alpine" +diff --git a/src/libraries/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props b/src/libraries/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props +index 3cb3d2df858..c7a346d1672 100644 +--- a/src/libraries/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props ++++ b/src/libraries/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props +@@ -16,7 +16,7 @@ + + linux-musl + x64;arm;arm64 +- 3.6;3.7;3.8;3.9;3.10;3.11;3.12;3.13;3.14 ++ 3.6;3.7;3.8;3.9;3.10;3.11;3.12;3.13;3.14;3.15 + + + +-- +2.34.1 + diff --git a/testing/dotnet5-bootstrap/runtime_link-order.patch b/testing/dotnet5-bootstrap/runtime_link-order.patch new file mode 100644 index 00000000000..64acfbcfa06 --- /dev/null +++ b/testing/dotnet5-bootstrap/runtime_link-order.patch @@ -0,0 +1,34 @@ +From 6e549ddb51fbebe1778143bc91b8cd434d751870 Mon Sep 17 00:00:00 2001 +From: Antoine Martin +Date: Wed, 1 Dec 2021 02:34:39 +0000 +Subject: [PATCH 1/1] Runtime link order patch for alpine + +For some reason, runtime does not link in the right order. This fixes that. +--- + src/installer/corehost/cli/apphost/static/CMakeLists.txt | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/installer/corehost/cli/apphost/static/CMakeLists.txt b/src/installer/corehost/cli/apphost/static/CMakeLists.txt +index ffb4f3ed02c..b05a05e70e2 100644 +--- a/src/installer/corehost/cli/apphost/static/CMakeLists.txt ++++ b/src/installer/corehost/cli/apphost/static/CMakeLists.txt +@@ -207,12 +207,12 @@ target_link_libraries( + libhostcommon + ${CORECLR_LIBRARIES} + +- ${ZLIB_LIBRARIES} +- ${LIBGSS} +- ${NATIVE_LIBS_EXTRA} +- + ${START_WHOLE_ARCHIVE} + ${RUNTIMEINFO_LIB} + ${NATIVE_LIBS} + ${END_WHOLE_ARCHIVE} ++ ++ ${ZLIB_LIBRARIES} ++ ${LIBGSS} ++ ${NATIVE_LIBS_EXTRA} + ) +-- +2.34.0 + diff --git a/testing/dotnet5-bootstrap/runtime_non-portable-distrorid-fix-alpine.patch b/testing/dotnet5-bootstrap/runtime_non-portable-distrorid-fix-alpine.patch new file mode 100644 index 00000000000..3efb160e212 --- /dev/null +++ b/testing/dotnet5-bootstrap/runtime_non-portable-distrorid-fix-alpine.patch @@ -0,0 +1,30 @@ +From a557508590dca1536345e13ba1b043f33defe13a Mon Sep 17 00:00:00 2001 +Patch-Source: https://github.com/dotnet/runtime/pull/62942 +From: Antoine Martin +Date: Wed, 1 Dec 2021 02:52:05 +0000 +Subject: [PATCH] Fix last version digit present on alpine non-portable + +Runtime adds the extra subversion in its calculation of Alpine's +DistroRID when a non-portable build, but does so inconsistently. +This creates an error when it generates its nuget package. + +--- + eng/native/init-distro-rid.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh +index b6921a90346..091738944a7 100644 +--- a/eng/native/init-distro-rid.sh ++++ b/eng/native/init-distro-rid.sh +@@ -41,7 +41,7 @@ initNonPortableDistroRid() + # We have forced __PortableBuild=0. This is because -portablebuld + # has been passed as false. + if (( isPortable == 0 )); then +- if [ "${ID}" = "rhel" ]; then ++ if [ "${ID}" = "rhel" ] || [ "${ID}" = "alpine" ]; then + # remove the last version digit + VERSION_ID="${VERSION_ID%.*}" + fi +-- +2.34.0 + diff --git a/testing/dotnet5-bootstrap/runtime_use-latest-microsoftnetcoreplatformspackage.patch b/testing/dotnet5-bootstrap/runtime_use-latest-microsoftnetcoreplatformspackage.patch new file mode 100644 index 00000000000..a6d42f95d6f --- /dev/null +++ b/testing/dotnet5-bootstrap/runtime_use-latest-microsoftnetcoreplatformspackage.patch @@ -0,0 +1,31 @@ +From c897096d5bac2bab228779a2c5602fc4bd296a0a Mon Sep 17 00:00:00 2001 +From: Antoine Martin +Date: Sun, 2 Jan 2022 21:59:58 +0000 +Subject: [PATCH 1/2] use version 5.0.4 of + MicrosoftNETCorePlatformsPackageVersion for up-to-date RIDs + +In stock build, an old version of MicrosoftNETCorePlatformsPackage is used. +Thus, dotnet5-runtime is shipped without RIDs for alpine 3.13 and up, causing +a segmentation fault for dotnet projects. Related to dotnet/runtime#24189 and +dotnet/runtime#50739. This patches eng/Versions.props to use latest version. + +--- + eng/Versions.props | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/eng/Versions.props b/eng/Versions.props +index 89c46cbb735..8ddd5d17900 100644 +--- a/eng/Versions.props ++++ b/eng/Versions.props +@@ -66,7 +66,7 @@ + + 5.0.0-preview.8.20359.4 + +- 5.0.0 ++ 5.0.4 + 5.0.0 + 4.5.1 + 4.3.0 +-- +2.34.1 + diff --git a/testing/dotnet5-bootstrap/sdk_add-zsh-compdef-completion-script.patch b/testing/dotnet5-bootstrap/sdk_add-zsh-compdef-completion-script.patch new file mode 100644 index 00000000000..6bba2504342 --- /dev/null +++ b/testing/dotnet5-bootstrap/sdk_add-zsh-compdef-completion-script.patch @@ -0,0 +1,35 @@ +From 4c74721e1f5da9642adab03075dda2f55719ac7b Mon Sep 17 00:00:00 2001 +Patch-Source: https://github.com/dotnet/sdk/pull/14239 +From: Esgariot +Date: Mon, 19 Oct 2020 23:42:37 +0200 +Subject: [PATCH 1/1] Add zsh compdef completion script. + +Continuing off of PR 13384 in upstream. +This commit is ready to be rebased to include appropriate co-authors +before merging PR. + +--- + scripts/register-completions.zsh | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) + +diff --git a/scripts/register-completions.zsh b/scripts/register-completions.zsh +index 8eebe9a867..faa32fef71 100644 +--- a/scripts/register-completions.zsh ++++ b/scripts/register-completions.zsh +@@ -1,10 +1,3 @@ +-# zsh parameter completion for the dotnet CLI +- +-_dotnet_zsh_complete() +-{ +- local completions=("$(dotnet complete "$words")") +- +- reply=( "${(ps:\n:)completions}" ) +-} +- +-compctl -K _dotnet_zsh_complete dotnet ++#compdef dotnet ++local completions=("$(dotnet complete "$words")") ++[[ -n "$completions" ]] && compadd -- "${(ps:\n:)completions}" +-- +2.34.1 + diff --git a/testing/dotnet5-bootstrap/sdk_telemetry-optout.patch b/testing/dotnet5-bootstrap/sdk_telemetry-optout.patch new file mode 100644 index 00000000000..21849ecf4a5 --- /dev/null +++ b/testing/dotnet5-bootstrap/sdk_telemetry-optout.patch @@ -0,0 +1,26 @@ +From f4cd793116461ec3794799e89d0b213516c94868 Mon Sep 17 00:00:00 2001 +From: Antoine Martin +Date: Fri, 21 Jan 2022 19:22:34 +0000 +Subject: [PATCH 1/1] Optouts of telemetry + +Optouts of telemetry gathering +--- + src/Cli/dotnet/Program.cs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Cli/dotnet/Program.cs b/src/Cli/dotnet/Program.cs +index f8114728c0..26982c0f6c 100644 +--- a/src/Cli/dotnet/Program.cs ++++ b/src/Cli/dotnet/Program.cs +@@ -187,7 +187,7 @@ internal static int ProcessArgs(string[] args, TimeSpan startupTime, ITelemetry + bool generateAspNetCertificate = + environmentProvider.GetEnvironmentVariableAsBool("DOTNET_GENERATE_ASPNET_CERTIFICATE", defaultValue: true); + bool telemetryOptout = +- environmentProvider.GetEnvironmentVariableAsBool("DOTNET_CLI_TELEMETRY_OPTOUT", defaultValue: false); ++ environmentProvider.GetEnvironmentVariableAsBool("DOTNET_CLI_TELEMETRY_OPTOUT", defaultValue: true); + bool addGlobalToolsToPath = + environmentProvider.GetEnvironmentVariableAsBool("DOTNET_ADD_GLOBAL_TOOLS_TO_PATH", defaultValue: true); + bool nologo = +-- +2.34.1 +