Fix arm64 bootstrapping

This commit is contained in:
Omair Majid 2022-08-17 22:57:07 -04:00
parent 631a4719eb
commit 5194877324
2 changed files with 26 additions and 18 deletions

View File

@ -4,6 +4,17 @@ set -euo pipefail
set -x set -x
function parse-nuget-name-version-from-file() {
package=$1
filename=${package##*/}
version_suffix=$(echo "$filename" | grep -Eo '\.[[:digit:]]+.*\.nupkg')
version=$(echo "$version_suffix" | sed -Ee 's/^\.//' -e 's/\.nupkg$//')
name=${filename:0:(${#filename}-${#version_suffix})}
echo "$name" "$version"
}
bootstrap_dir=$(readlink -f "$1") bootstrap_dir=$(readlink -f "$1")
version=$(jq -r '.tools.dotnet' "$bootstrap_dir"/global.json) version=$(jq -r '.tools.dotnet' "$bootstrap_dir"/global.json)
@ -14,28 +25,25 @@ mkdir -p "dotnet-arm64-prebuilts-$date"
pushd "dotnet-arm64-prebuilts-$date" pushd "dotnet-arm64-prebuilts-$date"
# Getting the exact matching rc2 version gets us an arm64 build without this # Binaries can be at one of several different URLs:
# fix https://github.com/dotnet/runtime/pull/58959. That causes a segfault on # wget https://dotnetcli.azureedge.net/dotnet/Sdk/$version/dotnet-sdk-$version-linux-arm64.tar.gz
# startup. wget https://dotnetbuilds.azureedge.net/public/Sdk/$version/dotnet-sdk-$version-linux-arm64.tar.gz
# wget "https://dotnetcli.azureedge.net/dotnet/Sdk/$version/dotnet-sdk-$version-linux-arm64.tar.gz"
wget https://aka.ms/dotnet/6.0.1XX-rc2/daily/dotnet-sdk-linux-arm64.tar.gz for archive in "$bootstrap_dir"/packages/archive/*.tar.gz; do
mapfile -t linux_x64_packages < <(tar tf "$archive" | grep linux-x64)
mapfile -t linux_x64_packages < <(tar tf "$bootstrap_dir"/packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz | grep linux-x64) for package in "${linux_x64_packages[@]}"; do
if [[ "$package" = *'.Intermediate.'* ]]; then
continue;
fi
for package in "${linux_x64_packages[@]}"; do read -r name version < <(parse-nuget-name-version-from-file "$package")
if [[ "$package" = *'.Intermediate.'* ]]; then
continue;
fi
filename=${package##*/} arm_name=${name/linux-x64/linux-arm64}
name=${filename%.7.0*}
arm_name=${name/linux-x64/linux-arm64}
version="7.0${filename##*6.0}"
version=${version%.*}
nappo download --verbose "$arm_name" "$version" nappo download --verbose "$arm_name" "$version"
done
done done
popd popd

View File

@ -71,7 +71,7 @@ URL: https://github.com/dotnet/
# ./build-dotnet-tarball --bootstrap %%{upstream_tag} # ./build-dotnet-tarball --bootstrap %%{upstream_tag}
Source0: dotnet-%{upstream_tag}-x64-bootstrap.tar.xz Source0: dotnet-%{upstream_tag}-x64-bootstrap.tar.xz
# Generated via ./build-arm64-bootstrap-tarball # Generated via ./build-arm64-bootstrap-tarball
Source1: dotnet-arm64-prebuilts-2021-10-29.tar.gz Source1: dotnet-arm64-prebuilts-2022-08-17.tar.gz
# Generated manually, same pattern as the arm64 tarball # Generated manually, same pattern as the arm64 tarball
Source2: dotnet-s390x-prebuilts-2021-10-29.tar.gz Source2: dotnet-s390x-prebuilts-2021-10-29.tar.gz
%else %else
@ -87,7 +87,7 @@ Source11: dotnet.sh.in
%if 0%{?fedora} || 0%{?rhel} >= 8 %if 0%{?fedora} || 0%{?rhel} >= 8
# FIXME # FIXME
# ExclusiveArch: aarch64 x86_64 s390x # ExclusiveArch: aarch64 x86_64 s390x
ExclusiveArch: x86_64 ExclusiveArch: aarch64 x86_64
%else %else
ExclusiveArch: x86_64 ExclusiveArch: x86_64
%endif %endif