Merge pull request #290351 from corngood/dotnet-fixes

dotnet: infrastructure cleanup
This commit is contained in:
David McFarland 2024-03-09 11:34:48 -04:00 committed by GitHub
commit 445b240555
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 139 additions and 131 deletions

View file

@ -52,6 +52,7 @@ for package in *; do
fi
used_source="$(jq -r '.source' "$version"/.nupkg.metadata)"
found=false
if [[ -d "$used_source" ]]; then
continue
@ -80,7 +81,7 @@ for package in *; do
fi
done
if ! ${found-false}; then
if [[ $found = false ]]; then
echo "couldn't find $package $version" >&2
exit 1
fi

View file

@ -36,11 +36,11 @@ release_platform_attr () {
platform_sources () {
local release_files="$1"
local platforms=( \
"x86_64-linux linux-x64" \
"aarch64-linux linux-arm64" \
"x86_64-darwin osx-x64" \
"aarch64-darwin osx-arm64" \
local platforms=(
"x86_64-linux linux-x64"
"aarch64-linux linux-arm64"
"x86_64-darwin osx-x64"
"aarch64-darwin osx-arm64"
)
echo "srcs = {"
@ -85,7 +85,7 @@ version_older () {
cur_version=$1
max_version=$2
result=$(nix-instantiate -I ../../../../. \
--eval -E "(import <nixpkgs> {}).lib.versionOlder \"$cur_version\" \"$max_version\"")
--eval -E "(import ../../../../. {}).lib.versionOlder \"$cur_version\" \"$max_version\"")
if [[ "$result" == "true" ]]; then
return 0
else
@ -117,31 +117,31 @@ aspnetcore_packages () {
# Due to this, make sure to check if new SDK versions introduce any new packages.
# This should not happend in minor or bugfix updates, but probably happens
# with every new major .NET release.
local pkgs=( \
"Microsoft.AspNetCore.App.Runtime.linux-arm" \
"Microsoft.AspNetCore.App.Runtime.linux-arm64" \
"Microsoft.AspNetCore.App.Runtime.linux-musl-arm64" \
"Microsoft.AspNetCore.App.Runtime.linux-musl-x64" \
"Microsoft.AspNetCore.App.Runtime.linux-x64" \
"Microsoft.AspNetCore.App.Runtime.osx-x64" \
"Microsoft.AspNetCore.App.Runtime.win-arm64" \
"Microsoft.AspNetCore.App.Runtime.win-x64" \
"Microsoft.AspNetCore.App.Runtime.win-x86" \
local pkgs=(
"Microsoft.AspNetCore.App.Runtime.linux-arm"
"Microsoft.AspNetCore.App.Runtime.linux-arm64"
"Microsoft.AspNetCore.App.Runtime.linux-musl-arm64"
"Microsoft.AspNetCore.App.Runtime.linux-musl-x64"
"Microsoft.AspNetCore.App.Runtime.linux-x64"
"Microsoft.AspNetCore.App.Runtime.osx-x64"
"Microsoft.AspNetCore.App.Runtime.win-arm64"
"Microsoft.AspNetCore.App.Runtime.win-x64"
"Microsoft.AspNetCore.App.Runtime.win-x86"
)
# These packages are currently broken on .NET 8
if version_older "$version" "8"; then
pkgs+=( \
"Microsoft.AspNetCore.App.Runtime.win-arm" \
pkgs+=(
"Microsoft.AspNetCore.App.Runtime.win-arm"
)
fi
# Packages that only apply to .NET 6 and up
if ! version_older "$version" "6"; then
pkgs+=( \
"Microsoft.AspNetCore.App.Ref" \
"Microsoft.AspNetCore.App.Runtime.linux-musl-arm" \
"Microsoft.AspNetCore.App.Runtime.osx-arm64" \
pkgs+=(
"Microsoft.AspNetCore.App.Ref"
"Microsoft.AspNetCore.App.Runtime.linux-musl-arm"
"Microsoft.AspNetCore.App.Runtime.osx-arm64"
)
fi
@ -173,93 +173,93 @@ sdk_packages () {
# Due to this, make sure to check if new SDK versions introduce any new packages.
# This should not happend in minor or bugfix updates, but probably happens
# with every new major .NET release.
local pkgs=( \
"Microsoft.NETCore.App.Host.linux-arm" \
"Microsoft.NETCore.App.Host.linux-arm64" \
"Microsoft.NETCore.App.Host.linux-musl-arm64" \
"Microsoft.NETCore.App.Host.linux-musl-x64" \
"Microsoft.NETCore.App.Host.linux-x64" \
"Microsoft.NETCore.App.Host.osx-x64" \
"Microsoft.NETCore.App.Host.win-arm64" \
"Microsoft.NETCore.App.Host.win-x64" \
"Microsoft.NETCore.App.Host.win-x86" \
"Microsoft.NETCore.App.Runtime.linux-arm" \
"Microsoft.NETCore.App.Runtime.linux-arm64" \
"Microsoft.NETCore.App.Runtime.linux-musl-arm64" \
"Microsoft.NETCore.App.Runtime.linux-musl-x64" \
"Microsoft.NETCore.App.Runtime.linux-x64" \
"Microsoft.NETCore.App.Runtime.osx-x64" \
"Microsoft.NETCore.App.Runtime.win-arm64" \
"Microsoft.NETCore.App.Runtime.win-x64" \
"Microsoft.NETCore.App.Runtime.win-x86" \
"Microsoft.NETCore.DotNetAppHost" \
"Microsoft.NETCore.DotNetHost" \
"Microsoft.NETCore.DotNetHostPolicy" \
"Microsoft.NETCore.DotNetHostResolver" \
"runtime.linux-arm64.Microsoft.NETCore.DotNetAppHost" \
"runtime.linux-arm64.Microsoft.NETCore.DotNetHost" \
"runtime.linux-arm64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.linux-arm64.Microsoft.NETCore.DotNetHostResolver" \
"runtime.linux-arm.Microsoft.NETCore.DotNetAppHost" \
"runtime.linux-arm.Microsoft.NETCore.DotNetHost" \
"runtime.linux-arm.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.linux-arm.Microsoft.NETCore.DotNetHostResolver" \
"runtime.linux-musl-arm64.Microsoft.NETCore.DotNetAppHost" \
"runtime.linux-musl-arm64.Microsoft.NETCore.DotNetHost" \
"runtime.linux-musl-arm64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.linux-musl-arm64.Microsoft.NETCore.DotNetHostResolver" \
"runtime.linux-musl-x64.Microsoft.NETCore.DotNetAppHost" \
"runtime.linux-musl-x64.Microsoft.NETCore.DotNetHost" \
"runtime.linux-musl-x64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.linux-musl-x64.Microsoft.NETCore.DotNetHostResolver" \
"runtime.linux-x64.Microsoft.NETCore.DotNetAppHost" \
"runtime.linux-x64.Microsoft.NETCore.DotNetHost" \
"runtime.linux-x64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver" \
"runtime.osx-x64.Microsoft.NETCore.DotNetAppHost" \
"runtime.osx-x64.Microsoft.NETCore.DotNetHost" \
"runtime.osx-x64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver" \
"runtime.win-arm64.Microsoft.NETCore.DotNetAppHost" \
"runtime.win-arm64.Microsoft.NETCore.DotNetHost" \
"runtime.win-arm64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.win-arm64.Microsoft.NETCore.DotNetHostResolver" \
"runtime.win-x64.Microsoft.NETCore.DotNetAppHost" \
"runtime.win-x64.Microsoft.NETCore.DotNetHost" \
"runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.win-x64.Microsoft.NETCore.DotNetHostResolver" \
"runtime.win-x86.Microsoft.NETCore.DotNetAppHost" \
"runtime.win-x86.Microsoft.NETCore.DotNetHost" \
"runtime.win-x86.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.win-x86.Microsoft.NETCore.DotNetHostResolver" \
"Microsoft.NETCore.App.Host.linux-musl-arm" \
"Microsoft.NETCore.App.Host.osx-arm64" \
"Microsoft.NETCore.App.Runtime.linux-musl-arm" \
"Microsoft.NETCore.App.Runtime.osx-arm64" \
"Microsoft.NETCore.App.Ref" \
"Microsoft.NETCore.App.Runtime.Mono.linux-arm" \
"Microsoft.NETCore.App.Runtime.Mono.linux-arm64" \
"Microsoft.NETCore.App.Runtime.Mono.linux-musl-x64" \
"Microsoft.NETCore.App.Runtime.Mono.linux-x64" \
"Microsoft.NETCore.App.Runtime.Mono.osx-arm64" \
"Microsoft.NETCore.App.Runtime.Mono.osx-x64" \
"Microsoft.NETCore.App.Runtime.Mono.win-x64" \
"Microsoft.NETCore.App.Runtime.Mono.win-x86" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetAppHost" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHost" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHostResolver" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetAppHost" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHost" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver" \
"Microsoft.NETCore.App.Crossgen2.linux-musl-arm" \
"Microsoft.NETCore.App.Crossgen2.linux-musl-arm64" \
"Microsoft.NETCore.App.Crossgen2.linux-musl-x64" \
"Microsoft.NETCore.App.Crossgen2.linux-arm" \
"Microsoft.NETCore.App.Crossgen2.linux-arm64" \
"Microsoft.NETCore.App.Crossgen2.linux-x64" \
"Microsoft.NETCore.App.Crossgen2.osx-x64" \
local pkgs=(
"Microsoft.NETCore.App.Host.linux-arm"
"Microsoft.NETCore.App.Host.linux-arm64"
"Microsoft.NETCore.App.Host.linux-musl-arm64"
"Microsoft.NETCore.App.Host.linux-musl-x64"
"Microsoft.NETCore.App.Host.linux-x64"
"Microsoft.NETCore.App.Host.osx-x64"
"Microsoft.NETCore.App.Host.win-arm64"
"Microsoft.NETCore.App.Host.win-x64"
"Microsoft.NETCore.App.Host.win-x86"
"Microsoft.NETCore.App.Runtime.linux-arm"
"Microsoft.NETCore.App.Runtime.linux-arm64"
"Microsoft.NETCore.App.Runtime.linux-musl-arm64"
"Microsoft.NETCore.App.Runtime.linux-musl-x64"
"Microsoft.NETCore.App.Runtime.linux-x64"
"Microsoft.NETCore.App.Runtime.osx-x64"
"Microsoft.NETCore.App.Runtime.win-arm64"
"Microsoft.NETCore.App.Runtime.win-x64"
"Microsoft.NETCore.App.Runtime.win-x86"
"Microsoft.NETCore.DotNetAppHost"
"Microsoft.NETCore.DotNetHost"
"Microsoft.NETCore.DotNetHostPolicy"
"Microsoft.NETCore.DotNetHostResolver"
"runtime.linux-arm64.Microsoft.NETCore.DotNetAppHost"
"runtime.linux-arm64.Microsoft.NETCore.DotNetHost"
"runtime.linux-arm64.Microsoft.NETCore.DotNetHostPolicy"
"runtime.linux-arm64.Microsoft.NETCore.DotNetHostResolver"
"runtime.linux-arm.Microsoft.NETCore.DotNetAppHost"
"runtime.linux-arm.Microsoft.NETCore.DotNetHost"
"runtime.linux-arm.Microsoft.NETCore.DotNetHostPolicy"
"runtime.linux-arm.Microsoft.NETCore.DotNetHostResolver"
"runtime.linux-musl-arm64.Microsoft.NETCore.DotNetAppHost"
"runtime.linux-musl-arm64.Microsoft.NETCore.DotNetHost"
"runtime.linux-musl-arm64.Microsoft.NETCore.DotNetHostPolicy"
"runtime.linux-musl-arm64.Microsoft.NETCore.DotNetHostResolver"
"runtime.linux-musl-x64.Microsoft.NETCore.DotNetAppHost"
"runtime.linux-musl-x64.Microsoft.NETCore.DotNetHost"
"runtime.linux-musl-x64.Microsoft.NETCore.DotNetHostPolicy"
"runtime.linux-musl-x64.Microsoft.NETCore.DotNetHostResolver"
"runtime.linux-x64.Microsoft.NETCore.DotNetAppHost"
"runtime.linux-x64.Microsoft.NETCore.DotNetHost"
"runtime.linux-x64.Microsoft.NETCore.DotNetHostPolicy"
"runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver"
"runtime.osx-x64.Microsoft.NETCore.DotNetAppHost"
"runtime.osx-x64.Microsoft.NETCore.DotNetHost"
"runtime.osx-x64.Microsoft.NETCore.DotNetHostPolicy"
"runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver"
"runtime.win-arm64.Microsoft.NETCore.DotNetAppHost"
"runtime.win-arm64.Microsoft.NETCore.DotNetHost"
"runtime.win-arm64.Microsoft.NETCore.DotNetHostPolicy"
"runtime.win-arm64.Microsoft.NETCore.DotNetHostResolver"
"runtime.win-x64.Microsoft.NETCore.DotNetAppHost"
"runtime.win-x64.Microsoft.NETCore.DotNetHost"
"runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy"
"runtime.win-x64.Microsoft.NETCore.DotNetHostResolver"
"runtime.win-x86.Microsoft.NETCore.DotNetAppHost"
"runtime.win-x86.Microsoft.NETCore.DotNetHost"
"runtime.win-x86.Microsoft.NETCore.DotNetHostPolicy"
"runtime.win-x86.Microsoft.NETCore.DotNetHostResolver"
"Microsoft.NETCore.App.Host.linux-musl-arm"
"Microsoft.NETCore.App.Host.osx-arm64"
"Microsoft.NETCore.App.Runtime.linux-musl-arm"
"Microsoft.NETCore.App.Runtime.osx-arm64"
"Microsoft.NETCore.App.Ref"
"Microsoft.NETCore.App.Runtime.Mono.linux-arm"
"Microsoft.NETCore.App.Runtime.Mono.linux-arm64"
"Microsoft.NETCore.App.Runtime.Mono.linux-musl-x64"
"Microsoft.NETCore.App.Runtime.Mono.linux-x64"
"Microsoft.NETCore.App.Runtime.Mono.osx-arm64"
"Microsoft.NETCore.App.Runtime.Mono.osx-x64"
"Microsoft.NETCore.App.Runtime.Mono.win-x64"
"Microsoft.NETCore.App.Runtime.Mono.win-x86"
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetAppHost"
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHost"
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHostPolicy"
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHostResolver"
"runtime.osx-arm64.Microsoft.NETCore.DotNetAppHost"
"runtime.osx-arm64.Microsoft.NETCore.DotNetHost"
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy"
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver"
"Microsoft.NETCore.App.Crossgen2.linux-musl-arm"
"Microsoft.NETCore.App.Crossgen2.linux-musl-arm64"
"Microsoft.NETCore.App.Crossgen2.linux-musl-x64"
"Microsoft.NETCore.App.Crossgen2.linux-arm"
"Microsoft.NETCore.App.Crossgen2.linux-arm64"
"Microsoft.NETCore.App.Crossgen2.linux-x64"
"Microsoft.NETCore.App.Crossgen2.osx-x64"
"Microsoft.NETCore.App.Crossgen2.osx-arm64"
)
@ -274,27 +274,27 @@ sdk_packages () {
# These packages were removed on .NET 8
if version_older "$version" "8"; then
pkgs+=( \
"Microsoft.NETCore.App.Host.win-arm" \
"Microsoft.NETCore.App.Runtime.win-arm" \
"runtime.win-arm.Microsoft.NETCore.DotNetAppHost" \
"runtime.win-arm.Microsoft.NETCore.DotNetHost" \
"runtime.win-arm.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.win-arm.Microsoft.NETCore.DotNetHostResolver" \
"Microsoft.NETCore.App.Composite" \
pkgs+=(
"Microsoft.NETCore.App.Host.win-arm"
"Microsoft.NETCore.App.Runtime.win-arm"
"runtime.win-arm.Microsoft.NETCore.DotNetAppHost"
"runtime.win-arm.Microsoft.NETCore.DotNetHost"
"runtime.win-arm.Microsoft.NETCore.DotNetHostPolicy"
"runtime.win-arm.Microsoft.NETCore.DotNetHostResolver"
"Microsoft.NETCore.App.Composite"
)
fi
# Packages that only apply to .NET 7 and up
if ! version_older "$version" "7"; then
pkgs+=( \
"runtime.linux-arm64.Microsoft.DotNet.ILCompiler" \
"runtime.linux-musl-arm64.Microsoft.DotNet.ILCompiler" \
"runtime.linux-musl-x64.Microsoft.DotNet.ILCompiler" \
"runtime.linux-x64.Microsoft.DotNet.ILCompiler" \
"runtime.osx-x64.Microsoft.DotNet.ILCompiler" \
"runtime.win-arm64.Microsoft.DotNet.ILCompiler" \
"runtime.win-x64.Microsoft.DotNet.ILCompiler" \
pkgs+=(
"runtime.linux-arm64.Microsoft.DotNet.ILCompiler"
"runtime.linux-musl-arm64.Microsoft.DotNet.ILCompiler"
"runtime.linux-musl-x64.Microsoft.DotNet.ILCompiler"
"runtime.linux-x64.Microsoft.DotNet.ILCompiler"
"runtime.osx-x64.Microsoft.DotNet.ILCompiler"
"runtime.win-arm64.Microsoft.DotNet.ILCompiler"
"runtime.win-x64.Microsoft.DotNet.ILCompiler"
)
fi
@ -368,6 +368,13 @@ Examples:
channel_version=$(jq -r '."channel-version"' <<< "$content")
support_phase=$(jq -r '."support-phase"' <<< "$content")
aspnetcore_sources="$(platform_sources "$aspnetcore_files")"
runtime_sources="$(platform_sources "$runtime_files")"
sdk_sources="$(platform_sources "$sdk_files")"
aspnetcore_packages="$(aspnetcore_packages "${aspnetcore_version}")"
sdk_packages="$(sdk_packages "${runtime_version}")"
result=$(mktemp)
trap "rm -f $result" TERM INT EXIT
@ -377,20 +384,20 @@ Examples:
{
aspnetcore_$major_minor_underscore = buildAspNetCore {
version = \"${aspnetcore_version}\";
$(platform_sources "$aspnetcore_files")
$aspnetcore_sources
};
runtime_$major_minor_underscore = buildNetRuntime {
version = \"${runtime_version}\";
$(platform_sources "$runtime_files")
$runtime_sources
};
sdk_$major_minor_underscore = buildNetSdk {
version = \"${sdk_version}\";
$(platform_sources "$sdk_files")
$sdk_sources
packages = { fetchNuGet }: [
$(aspnetcore_packages "${aspnetcore_version}")
$(sdk_packages "${runtime_version}")
$aspnetcore_packages
$sdk_packages
];
};
}" > "${result}"