From a008701dd96fa758aef737cd278569701581e4b8 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Jan 09 2023 16:36:38 +0000 Subject: Merge branch 'dotnet-sig/main' --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..537942d --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +/dotnet-v3.1.101-SDK.tar.gz +/dotnet-v3.1.102-SDK.tar.gz +/dotnet-v3.1.103.2-SDK.tar.gz +/dotnet-v5.0.102-SDK-arm64-bootstrap.tar.gz +/dotnet-v5.0.102-SDK-x64-bootstrap.tar.gz +/dotnet-v5.0.102-SDK.tar.gz +/dotnet-v5.0.103-SDK.tar.gz +/dotnet-v5.0.104-SDK.tar.gz +/dotnet-v5.0.202-SDK.tar.gz +/dotnet-v5.0.203-SDK.tar.gz +/dotnet-v5.0.204-SDK.tar.gz +/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c-x64-bootstrap.tar.xz +/dotnet-arm64-prebuilts-2021-10-29.tar.gz +/dotnet-s390x-prebuilts-2021-10-29.tar.gz +/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c.tar.gz +/dotnet-v6.0.101.tar.gz +/dotnet-v6.0.102.tar.gz +/dotnet-v6.0.103.tar.gz +/dotnet-v6.0.104.tar.gz +/dotnet-v6.0.105.tar.gz diff --git a/README.md b/README.md index b26d88d..d46fa1f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,138 @@ # dotnet7.0 -The dotnet7.0 package +This is the work-in-progress .NET 7.0 package for Fedora. When it's ready, it +will be merged into Fedora proper. + +This package is maintained by the Fedora DotNet SIG (Special Interest +Group). You can find out more about the DotNet SIG at: + +- https://fedoraproject.org/wiki/SIGs/DotNet +- https://fedoraproject.org/wiki/DotNet +- https://lists.fedoraproject.org/archives/list/dotnet-sig@lists.fedoraproject.org/ + +Please report any issues [using +bugzilla](https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=dotnet7.0). + +# Specification + +This package follows [package naming and contents suggested by +upstream](https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging), +with one exception. It installs dotnet to `/usr/lib64/dotnet` (aka +`%{_libdir}`). + +# Contributing + +The steps below are for the final package. Please only contribute to this +pre-release version this if you know what you are doing. Original instructions +follow. + +## General Changes + +1. Fork the repo. + +2. Checkout the forked repository. + + - `git clone ssh://$USER@pkgs.fedoraproject.org/forks/$USER/rpms/dotnet7.0.git` + - `cd dotnet7.0` + +3. Make your changes. Don't forget to add a changelog. + +4. Do local builds. + + - `fedpkg local` + +5. Fix any errors that come up and rebuild until it works locally. + +6. Do builds in koji. + + - `fedpkg scratch-build --srpm` + +8. Commit the changes to the git repo. + + - `git add` any new patches + - `git remove` any now-unnecessary patches + - `git commit -a` + - `git push` + +9. Create a pull request with your changes. + +10. Once the tests in the pull-request pass, and reviewers are happy, do a real + build. + + - `fedpkg build` + +11. For non-rawhide releases, file updates using bodhi to ship the just-built + package out to users. + + - https://bodhi.fedoraproject.org/updates/new + + OR + + - `fedpkg update` + +## Updating to an new upstream release + +1. Fork the repo. + +2. Checkout the forked repository. + + - `git clone ssh://$USER@pkgs.fedoraproject.org/forks/$USER/rpms/dotnet7.0.git` + - `cd dotnet7.0` + +3. Build the new upstream source tarball. Update the versions in the + spec file. Add a changelog. This is generally automated by the + following. + + - `./update-release ` + + If this fails because of compiler errors, you might have to figure + out a fix, then add the patch in `build-dotnet-tarball` script + rather than the spec file. + +4. Do local builds. + + - `fedpkg local` + +5. Fix any errors that come up and rebuild until it works locally. Any + patches that are needed at this point should be added to the spec file. + +6. Do builds in koji. + + - `fedpkg scratch-build --srpm` + +7. Upload the source archive to the Fedora look-aside cache. + + - `fedpkg new-sources path-to-generated-dotnet-source-tarball.tar.gz` + +8. Commit the changes to the git repo. + + - `git add` any new patches + - `git remove` any now-unnecessary patches + - `git commit -a` + - `git push` + +9. Create a pull request with your changes. + +10. Once the tests in the pull-request pass, and reviewers are happy, do a real + build. + + - `fedpkg build` + +11. For non-rawhide releases, file updates using bodhi to ship the just-built + package out to users. + + - https://bodhi.fedoraproject.org/updates/new + + OR + + - `fedpkg update` + +# Testing + +This package uses CI tests as defined in `tests/test.yml`. Creating a +pull-request or running a build will fire off tests and flag any issues. We have +enabled gating (via `gating.yaml`) on the tests. That prevents a build +that fails any test from being released until the failures are waived. + +The tests themselves are contained in this external repository: +https://github.com/redhat-developer/dotnet-regular-tests/ diff --git a/aspnetcore-44583-ppc64le-crossgen.patch b/aspnetcore-44583-ppc64le-crossgen.patch new file mode 100644 index 0000000..d21fc15 --- /dev/null +++ b/aspnetcore-44583-ppc64le-crossgen.patch @@ -0,0 +1,24 @@ +From d77f55bc7c5f6dd087113b6e93b7778d3ebcdbb4 Mon Sep 17 00:00:00 2001 +From: Sapana Khemkar +Date: Fri, 14 Oct 2022 05:44:54 +0000 +Subject: [PATCH] add ppc64le arch to crossgen2 not available list + +--- + .../App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +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 c062788037..4dfa88f7d6 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 +@@ -42,8 +42,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant + + $(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder);.r2rmap + +- +- false ++ ++ false + true + + diff --git a/build-arm64-bootstrap-tarball b/build-arm64-bootstrap-tarball new file mode 100755 index 0000000..bfd7f02 --- /dev/null +++ b/build-arm64-bootstrap-tarball @@ -0,0 +1,55 @@ +#!/bin/bash + +# Usage: +# ./build-arm64-bootstrap-tarball [SDK-version] + +set -euo pipefail + +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") + +version=${2:-$(jq -r '.tools.dotnet' "$bootstrap_dir"/global.json)} + +date=$(date +%F) + +mkdir -p "dotnet-arm64-prebuilts-$date" + +pushd "dotnet-arm64-prebuilts-$date" + +# Binaries can be at one of several different URLs: +wget https://dotnetcli.azureedge.net/dotnet/Sdk/$version/dotnet-sdk-$version-linux-arm64.tar.gz +#wget https://dotnetbuilds.azureedge.net/public/Sdk/$version/dotnet-sdk-$version-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) + + for package in "${linux_x64_packages[@]}"; do + if [[ "$package" = *'.Intermediate.'* ]]; then + continue; + fi + + read -r name version < <(parse-nuget-name-version-from-file "$package") + + arm_name=${name/linux-x64/linux-arm64} + + # https://gist.github.com/omajid/c04b6025de49d0b7b18ab4a7e789484e + nappo download --verbose "$arm_name" "$version" + + done +done + +popd + +tar czf "dotnet-arm64-prebuilts-$date.tar.gz" "dotnet-arm64-prebuilts-$date" diff --git a/build-dotnet-tarball b/build-dotnet-tarball new file mode 100755 index 0000000..7c9a3aa --- /dev/null +++ b/build-dotnet-tarball @@ -0,0 +1,190 @@ +#!/bin/bash + +# Usage: +# build-dotnet-tarball [--bootstrap] +# +# Creates a source archive from a tag (or commit) at github.com/dotnet/installer +# +# Clone dotnet/installer, check out the tag (if any), and build the +# source-tarball. + +set -euo pipefail +IFS=$'\n\t' + +function print_usage { + echo "Usage:" + echo "$0 [--bootstrap] " + echo + echo "Creates a source archive from a tag at https://github.com/dotnet/installer" + echo "" + echo " --bootstrap build a source tarball usable for bootstrapping .NET" +} + +function clean_dotnet_cache { + rm -rf ~/.aspnet ~/.dotnet/ ~/.nuget/ ~/.local/share/NuGet ~/.templateengine + rm -rf /tmp/NuGet /tmp/NuGetScratch /tmp/.NETCore* /tmp/.NETStandard* /tmp/.dotnet /tmp/dotnet.* /tmp/clr-debug-pipe* /tmp/Razor-Server /tmp/CoreFxPipe* /tmp/VBCSCompiler /tmp/.NETFramework* +} + +function check_bootstrap_environment { + if rpm -qa | grep dotnet ; then + echo "error: dotnet is installed. Not a good idea for bootstrapping." + exit 1 + fi + if [ -d /usr/lib/dotnet ] || [ -d /usr/lib64/dotnet ] || [ -d /usr/share/dotnet ] ; then + echo "error: one of /usr/lib/dotnet /usr/lib64/dotnet or /usr/share/dotnet/ exists. Not a good idea for bootstrapping." + exit 1 + fi + if command -v dotnet ; then + echo "error: dotnet is in $PATH. Not a good idea for bootstrapping." + exit 1 + fi +} + +function runtime_id { + + source /etc/os-release + case "${ID}" in + # Remove the RHEL minor version + rhel) rid_version=${VERSION_ID%.*} ;; + + *) rid_version=${VERSION_ID} ;; + esac + + echo "${ID}.${rid_version}-${arch}" +} + +build_bootstrap=false + +declare -A archmap +archmap=( + ["aarch64"]="arm64" + ["amd64"]="x64" + ["armv8l"]="arm" + ["i386"]="x86" + ["i686"]="x86" + ["ppc64le"]="ppc64le" + ["s390x"]="s390x" + ["x86_64"]="x64" +) + +arch=${archmap["$(uname -m)"]} + + +positional_args=() +while [[ "$#" -gt 0 ]]; do + arg="${1}" + case "${arg}" in + --bootstrap) + check_bootstrap_environment + build_bootstrap=true + shift + ;; + -h|--help) + print_usage + exit 0 + ;; + *) + positional_args+=("$1") + shift + ;; + esac +done + + +tag=${positional_args[0]:-} +if [[ -z ${tag} ]]; then + echo "error: missing tag to build" + exit 1 +fi + +set -x + +dir_name="dotnet-${tag}" +unmodified_tarball_name="${dir_name}-original" +tarball_name="${dir_name}" +tarball_suffix=.tar.gz + +if [[ ${build_bootstrap} == true ]]; then + unmodified_tarball_name="${unmodified_tarball_name}-${arch}-bootstrap" + tarball_name="${tarball_name}-${arch}-bootstrap" + tarball_suffix=.tar.xz +fi + +if [ -f "${tarball_name}${tarball_suffix}" ]; then + echo "error: ${tarball_name}${tarball_suffix} already exists" + exit 1 +fi + +if [ ! -f "${unmodified_tarball_name}.tar.gz" ]; then + temp_dir=$(mktemp -d -p "$(pwd)") + pushd "${temp_dir}" + mkdir installer + pushd installer + git init + git remote add origin https://github.com/dotnet/installer + git fetch --depth 1 origin "${tag}" + git checkout FETCH_HEAD + git submodule update --init --recursive + clean_dotnet_cache + mkdir -p "../${unmodified_tarball_name}" + ./build.sh /p:ArcadeBuildTarball=true + popd + + popd + + cp -a \ + "${temp_dir}"/installer/artifacts/packages/Debug/Shipping/dotnet-sdk-source-7*.tar.gz \ + "${unmodified_tarball_name}.tar.gz" + + rm -rf "${temp_dir}" +fi + +rm -rf "${tarball_name}" + +tar xf "${unmodified_tarball_name}.tar.gz" +mv "${unmodified_tarball_name}" "${tarball_name}" + +pushd "${tarball_name}" + +if [[ ${build_bootstrap} == true ]]; then + ./prep.sh --bootstrap +else + find . -type f -iname '*.tar.gz' -delete + rm -rf .dotnet +fi + +# Remove files with funny licenses and crypto implementations and +# other not-very-useful artifacts. We MUST NOT ship any files that +# have unapproved licenses and unexpected cryptographic +# implementations. +# +# We use rm -r (no -f) to make sure the operation fails if the files +# are not at the expected locations. If the files are not at the +# expected location, we need to find the new location of the files and +# delete them, or verify that upstream has already removed the files. + +# Binaries for gradle +rm -r src/aspnetcore/src/SignalR/clients/java/signalr/gradle* + +# https://github.com/dotnet/aspnetcore/issues/34785 +find src/aspnetcore/src -type d -name samples -print0 | xargs -0 rm -r + +# Unnecessary crypto implementation: IDEA +rm -r src/runtime/src/tests/JIT/Performance/CodeQuality/Bytemark/ + +# https://github.com/NuGet/Home/issues/11094 +rm -r src/nuget-client/test/EndToEnd + +# https://github.com/microsoft/ApplicationInsights-dotnet/issues/2670 +rm -r src/source-build-externals/src/application-insights/LOGGING/test/Shared/CustomTelemetryChannel.cs + +# CC-BY-SA https://gitlab.com/fedora/legal/fedora-license-data/-/issues/104#note_1230640823 +rm -r src/runtime/src/tests/sizeondisk/sodbench + +popd + +if [[ ${build_bootstrap} == true ]]; then + tar -I 'xz -9 -T 0' -cf "${tarball_name}${tarball_suffix}" "${tarball_name}" +else + tar -czf "${tarball_name}${tarball_suffix}" "${tarball_name}" +fi diff --git a/check-debug-symbols.py b/check-debug-symbols.py new file mode 100755 index 0000000..d759f47 --- /dev/null +++ b/check-debug-symbols.py @@ -0,0 +1,135 @@ +#!/usr/bin/python3 + +""" +Check debug symbols are present in shared object and can identify +code. + +It starts scanning from a directory and recursively scans all ELF +files found in it for various symbols to ensure all debuginfo is +present and nothing has been stripped. + +Usage: + +./check-debug-symbols /path/of/dir/to/scan/ + + +Example: + +./check-debug-symbols /usr/lib64 +""" + +# This technique was explained to me by Mark Wielaard (mjw). + +import collections +import os +import re +import subprocess +import sys + +ScanResult = collections.namedtuple('ScanResult', + 'file_name debug_info debug_abbrev file_symbols gnu_debuglink') + + +def scan_file(file): + "Scan the provided file and return a ScanResult containing results of the scan." + + # Test for .debug_* sections in the shared object. This is the main test. + # Stripped objects will not contain these. + readelf_S_result = subprocess.run(['eu-readelf', '-S', file], + stdout=subprocess.PIPE, encoding='utf-8', check=True) + has_debug_info = any(line for line in readelf_S_result.stdout.split('\n') if '] .debug_info' in line) + + has_debug_abbrev = any(line for line in readelf_S_result.stdout.split('\n') if '] .debug_abbrev' in line) + + # Test FILE symbols. These will most likely be removed by anyting that + # manipulates symbol tables because it's generally useless. So a nice test + # that nothing has messed with symbols. + def contains_file_symbols(line): + parts = line.split() + if len(parts) < 8: + return False + return \ + parts[2] == '0' and parts[3] == 'FILE' and parts[4] == 'LOCAL' and parts[5] == 'DEFAULT' and \ + parts[6] == 'ABS' and re.match(r'((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx))?', parts[7]) + + readelf_s_result = subprocess.run(["eu-readelf", '-s', file], + stdout=subprocess.PIPE, encoding='utf-8', check=True) + has_file_symbols = any(line for line in readelf_s_result.stdout.split('\n') if contains_file_symbols(line)) + + # Test that there are no .gnu_debuglink sections pointing to another + # debuginfo file. There shouldn't be any debuginfo files, so the link makes + # no sense either. + has_gnu_debuglink = any(line for line in readelf_s_result.stdout.split('\n') if '] .gnu_debuglink' in line) + + return ScanResult(file, has_debug_info, has_debug_abbrev, has_file_symbols, has_gnu_debuglink) + +def is_elf(file): + result = subprocess.run(['file', file], stdout=subprocess.PIPE, encoding='utf-8', check=True) + return re.search(r'ELF 64-bit [LM]SB (?:pie )?(?:executable|shared object)', result.stdout) + +def scan_file_if_sensible(file): + if is_elf(file): + return scan_file(file) + return None + +def scan_dir(dir): + results = [] + for root, _, files in os.walk(dir): + for name in files: + result = scan_file_if_sensible(os.path.join(root, name)) + if result: + results.append(result) + return results + +def scan(file): + file = os.path.abspath(file) + if os.path.isdir(file): + return scan_dir(file) + elif os.path.isfile(file): + return [scan_file_if_sensible(file)] + +def is_bad_result(result): + return not result.debug_info or not result.debug_abbrev or not result.file_symbols or result.gnu_debuglink + +def print_scan_results(results, verbose): + # print(results) + for result in results: + file_name = result.file_name + found_issue = False + if not result.debug_info: + found_issue = True + print('error: missing .debug_info section in', file_name) + if not result.debug_abbrev: + found_issue = True + print('error: missing .debug_abbrev section in', file_name) + if not result.file_symbols: + found_issue = True + print('error: missing FILE symbols in', file_name) + if result.gnu_debuglink: + found_issue = True + print('error: unexpected .gnu_debuglink section in', file_name) + if verbose and not found_issue: + print('OK: ', file_name) + +def main(args): + verbose = False + files = [] + for arg in args: + if arg == '--verbose' or arg == '-v': + verbose = True + else: + files.append(arg) + + results = [] + for file in files: + results.extend(scan(file)) + + print_scan_results(results, verbose) + + if any(is_bad_result(result) for result in results): + return 1 + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/copr-build b/copr-build new file mode 100755 index 0000000..97faa2b --- /dev/null +++ b/copr-build @@ -0,0 +1,13 @@ +#!/bin/bash + +set -euo pipefail + +set -x + +fedpkg --release f36 srpm 2>&1 | tee fedpkg.output + +srpm_name=$(grep 'Wrote: ' fedpkg.output | cut -d' ' -f 2) + +ls -alh "${srpm_name}" + +copr-cli --debug build @dotnet-sig/dotnet-preview "${srpm_name}" diff --git a/dotnet.sh.in b/dotnet.sh.in new file mode 100644 index 0000000..65b92a0 --- /dev/null +++ b/dotnet.sh.in @@ -0,0 +1,14 @@ + +# Set location for AppHost lookup +[ -z "$DOTNET_ROOT" ] && export DOTNET_ROOT=@LIBDIR@/dotnet + +# Add dotnet tools directory to PATH +DOTNET_TOOLS_PATH="$HOME/.dotnet/tools" +case "$PATH" in + *"$DOTNET_TOOLS_PATH"* ) true ;; + * ) PATH="$PATH:$DOTNET_TOOLS_PATH" ;; +esac + +# Extract self-contained executables under HOME +# to avoid multi-user issues from using the default '/var/tmp'. +[ -z "$DOTNET_BUNDLE_EXTRACT_BASE_DIR" ] && export DOTNET_BUNDLE_EXTRACT_BASE_DIR="${XDG_CACHE_HOME:-"$HOME"/.cache}/dotnet_bundle_extract" diff --git a/dotnet7.0.rpmlintrc b/dotnet7.0.rpmlintrc new file mode 100644 index 0000000..1396c43 --- /dev/null +++ b/dotnet7.0.rpmlintrc @@ -0,0 +1,35 @@ +# Tarball is generated, no upstream URL +addFilter("W:.*invalid-url Source0: dotnet-.*tar.gz") + +# macOS is the correct name +addFilter("W: spelling-error %description -l en_US macOS ->.*") +# The name of the nuget package includes NETCore +addFilter("W: spelling-error .* NETCore -> Net Core.*") + +# Upstream really has no README or documentation files. They suggest using online resources. +addFilter("W: no-documentation") + +# This is a script that we run; it's expected to have execute permissions +addFilter("W: strange-permission check-debug-symbols.py") + +# libicu is a required dependency, but it's used via a dlopen() +addFilter("E: explicit-lib-dependency libicu") + +# There's no devel package for us to place .h files +addFilter("W: devel-file-in-non-devel-package /usr/lib64/dotnet/.*\.h") +addFilter("W: devel-file-in-non-devel-package /usr/lib64/dotnet/.*\.a") + +# These paths are non-standard, so we need $ORIGIN to find these libraries +addFilter("E: binary-or-shlib-defines-rpath /usr/lib64/dotnet/.*\['\$ORIGIN/netcoredeps'\]") +addFilter("E: binary-or-shlib-defines-rpath /usr/lib64/dotnet/.*\['\$ORIGIN'\]") + +# We put dll files in /usr/lib/dotnet, but rpmlint somehow doesn't see it as a binary? +addFilter("W: only-non-binary-in-usr-lib") + +# We use a number of zero-length files, including _._ +addFilter("E: zero-length /usr/lib64/dotnet/.*/_\._") + +# Upstream uses hidden files, even though we ask them not to, as much as possible +addFilter("W: hidden-file-or-dir /usr/lib64/dotnet/.*/\.version") +addFilter("W: hidden-file-or-dir /usr/lib64/dotnet/.*/\.toolsetversion") + diff --git a/dotnet7.0.spec b/dotnet7.0.spec new file mode 100644 index 0000000..2ec2d5f --- /dev/null +++ b/dotnet7.0.spec @@ -0,0 +1,969 @@ +%bcond_without bootstrap + +# LTO triggers a compilation error for a source level issue. Given that LTO should not +# change the validity of any given source and the nature of the error (undefined enum), I +# suspect a generator program is mis-behaving in some way. This needs further debugging, +# until that's done, disable LTO. This has to happen before setting the flags below. +%define _lto_cflags %{nil} + +%global dotnetver 7.0 + +%global host_version 7.0.0-rc.2.22472.3 +%global runtime_version 7.0.0-rc.2.22472.3 +%global aspnetcore_runtime_version 7.0.0-rc.2.22476.2 +%global sdk_version 7.0.100-rc.2.22511.1 +%global sdk_feature_band_version %(echo %{sdk_version} | cut -d '-' -f 1 | sed -e 's|[[:digit:]][[:digit:]]$|00|') +%global templates_version 7.0.0-rc.2.22476.2 +#%%global templates_version %%(echo %%{runtime_version} | awk 'BEGIN { FS="."; OFS="." } {print $1, $2, $3+1 }') + +%global host_rpm_version 7.0.0 +%global runtime_rpm_version 7.0.0 +%global aspnetcore_runtime_rpm_version 7.0.0 +%global sdk_rpm_version 7.0.100 + +# upstream can update releases without revving the SDK version so these don't always match +#%%global upstream_tag v%%{sdk_version} +%global upstream_tag v7.0.100-rc.2.22477.23 + +%if 0%{?fedora} || 0%{?rhel} < 8 +%global use_bundled_libunwind 0 +%else +%global use_bundled_libunwind 1 +%endif + +%ifarch aarch64 ppc64le s390x +%global use_bundled_libunwind 1 +%endif + +%ifarch aarch64 +%global runtime_arch arm64 +%endif +%ifarch ppc64le +%global runtime_arch ppc64le +%endif +%ifarch s390x +%global runtime_arch s390x +%endif +%ifarch x86_64 +%global runtime_arch x64 +%endif + +%global mono_archs s390x ppc64le + +%{!?runtime_id:%global runtime_id %(. /etc/os-release ; echo "${ID}.${VERSION_ID%%.*}")-%{runtime_arch}} + +Name: dotnet%{dotnetver} +Version: %{sdk_rpm_version} +Release: 0%{?dist}.1 +Summary: .NET Runtime and SDK +License: 0BSD AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSL-1.0 AND bzip2-1.0.6 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-PDDC AND CNRI-Python AND EPL-1.0 AND GPL-2.0-only AND (GPL-2.0-only WITH GCC-exception-2.0) AND GPL-2.0-or-later AND GPL-3.0-only AND ICU AND ISC AND LGPL-2.1-only AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND LicenseRef-ISO-8879 AND MIT AND MIT-Wu AND MS-PL AND MS-RL AND NCSA AND OFL-1.1 AND OpenSSL AND Unicode-DFS-2015 AND Unicode-DFS-2016 AND W3C-19980720 AND X11 AND Zlib + +URL: https://github.com/dotnet/ + +%if %{with bootstrap} +# The source is generated on a Fedora box via: +# ./build-dotnet-tarball --bootstrap %%{upstream_tag} +Source0: dotnet-%{upstream_tag}-x64-bootstrap.tar.xz +# Generated via ./build-arm64-bootstrap-tarball +Source1: dotnet-arm64-prebuilts-2022-10-12.tar.gz +# Generated manually, same pattern as the arm64 tarball +Source2: dotnet-ppc64le-prebuilts-2022-10-21.tar.gz +# Generated manually, same pattern as the arm64 tarball +Source3: dotnet-s390x-prebuilts-2022-10-12.tar.gz +%else +# The source is generated on a Fedora box via: +# ./build-dotnet-tarball %%{upstream_tag} +Source0: dotnet-%{upstream_tag}.tar.gz +%endif + +Source10: check-debug-symbols.py +Source11: dotnet.sh.in + +# https://github.com/dotnet/runtime/pull/76916 +Patch1: runtime-76916-mono-s390x-opcheckthis.patch +# https://github.com/microsoft/vstest/pull/4028 +Patch2: vstest-4028-ppc64le.patch +# https://github.com/microsoft/vstest/pull/4066 +Patch3: vstest-4066-s390x-ppc64le.patch +# https://github.com/dotnet/installer/pull/14631 +Patch4: installer-14631-ppc64le.patch +# https://github.com/dotnet/installer/pull/14792 +Patch5: installer-14792-mono.patch +# https://github.com/dotnet/aspnetcore/pull/44583 +Patch6: aspnetcore-44583-ppc64le-crossgen.patch +# https://github.com/dotnet/runtime/pull/77269 +Patch7: runtime-77269-mono-ppc64le-opcheckthis.patch +# https://github.com/dotnet/runtime/pull/77270 +Patch8: runtime-77270-ppc64le-fsharp-crash.patch +# https://github.com/dotnet/runtime/pull/77308 +Patch9: runtime-77308-ppc64le-delegate.patch +# Disable apphost; there's no net6.0 apphost for ppc64le +Patch10: roslyn-analyzers-ppc64le-apphost.patch +# Fix ppc64le build with clang 15 +# TODO upstream this +Patch11: runtime-mono-ppc64le-clang15.patch + + +%if 0%{?fedora} || 0%{?rhel} >= 8 +ExclusiveArch: aarch64 ppc64le s390x x86_64 +%else +ExclusiveArch: x86_64 +%endif + + +BuildRequires: clang +BuildRequires: cmake +BuildRequires: coreutils +%if %{without bootstrap} +BuildRequires: dotnet-sdk-%{dotnetver} +BuildRequires: dotnet-sdk-%{dotnetver}-source-built-artifacts +%endif +BuildRequires: findutils +BuildRequires: git +%if 0%{?fedora} || 0%{?rhel} > 7 +BuildRequires: glibc-langpack-en +%endif +BuildRequires: hostname +BuildRequires: krb5-devel +BuildRequires: libicu-devel +%if ! %{use_bundled_libunwind} +BuildRequires: libunwind-devel +%endif +%ifarch aarch64 +BuildRequires: lld +%endif +# If the build ever crashes, then having lldb installed might help the +# runtime generate a backtrace for the crash +BuildRequires: lldb +BuildRequires: llvm +BuildRequires: lttng-ust-devel +BuildRequires: make +BuildRequires: openssl-devel +BuildRequires: python3 +BuildRequires: tar +BuildRequires: util-linux +BuildRequires: zlib-devel + +# Avoid generating provides and requires for private libraries +%global privlibs libhostfxr +%global privlibs %{privlibs}|libclrgc +%global privlibs %{privlibs}|libclrjit +%global privlibs %{privlibs}|libcoreclr +%global privlibs %{privlibs}|libcoreclrtraceptprovider +%global privlibs %{privlibs}|libhostpolicy +%global privlibs %{privlibs}|libmscordaccore +%global privlibs %{privlibs}|libmscordbi +%global privlibs %{privlibs}|libnethost +%global privlibs %{privlibs}|libSystem.Globalization.Native +%global privlibs %{privlibs}|libSystem.IO.Compression.Native +%global privlibs %{privlibs}|libSystem.Native +%global privlibs %{privlibs}|libSystem.Net.Security.Native +%global privlibs %{privlibs}|libSystem.Security.Cryptography.Native.OpenSsl +%global __provides_exclude ^(%{privlibs})\\.so +%global __requires_exclude ^(%{privlibs})\\.so + + +%description +.NET is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, macOS and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +.NET contains a runtime conforming to .NET Standards a set of +framework libraries, an SDK containing compilers and a 'dotnet' +application to drive everything. + +# The `dotnet` package was a bit of historical mistake. Users +# shouldn't be asked to install .NET without a version because .NET +# code (source or build) is generally version specific. We have kept +# it around in older versions of RHEL and Fedora. But no reason to +# continue this mistake. +%if ( 0%{?fedora} && 0%{?fedora} < 38 ) || ( 0%{?rhel} && 0%{?rhel} < 8 ) + +%package -n dotnet + +Version: %{sdk_rpm_version} +Summary: .NET CLI tools and runtime + +Requires: dotnet-sdk-%{dotnetver}%{?_isa} >= %{sdk_rpm_version}-%{release} + +%description -n dotnet +.NET is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, macOS and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +.NET contains a runtime conforming to .NET Standards a set of +framework libraries, an SDK containing compilers and a 'dotnet' +application to drive everything. + +%endif + +%package -n dotnet-host + +Version: %{host_rpm_version} +Summary: .NET command line launcher + +%description -n dotnet-host +The .NET host is a command line program that runs a standalone +.NET application or launches the SDK. + +.NET is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + + +%package -n dotnet-hostfxr-%{dotnetver} + +Version: %{host_rpm_version} +Summary: .NET command line host resolver + +# Theoretically any version of the host should work. But lets aim for the one +# provided by this package, or from a newer version of .NET +Requires: dotnet-host%{?_isa} >= %{host_rpm_version}-%{release} + +%description -n dotnet-hostfxr-%{dotnetver} +The .NET host resolver contains the logic to resolve and select +the right version of the .NET SDK or runtime to use. + +.NET is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + + +%package -n dotnet-runtime-%{dotnetver} + +Version: %{runtime_rpm_version} +Summary: NET %{dotnetver} runtime + +Requires: dotnet-hostfxr-%{dotnetver}%{?_isa} >= %{host_rpm_version}-%{release} + +# libicu is dlopen()ed +Requires: libicu%{?_isa} + +# See src/runtime/src/libraries/Native/AnyOS/brotli-version.txt +Provides: bundled(libbrotli) = 1.0.9 +%if %{use_bundled_libunwind} +# See src/runtime/src/coreclr/pal/src/libunwind/libunwind-version.txt +Provides: bundled(libunwind) = 1.5.rc1.28.g9165d2a1 +%endif + +%description -n dotnet-runtime-%{dotnetver} +The .NET runtime contains everything needed to run .NET applications. +It includes a high performance Virtual Machine as well as the framework +libraries used by .NET applications. + +.NET is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + + +%package -n aspnetcore-runtime-%{dotnetver} + +Version: %{aspnetcore_runtime_rpm_version} +Summary: ASP.NET Core %{dotnetver} runtime + +Requires: dotnet-runtime-%{dotnetver}%{?_isa} = %{runtime_rpm_version}-%{release} + +%description -n aspnetcore-runtime-%{dotnetver} +The ASP.NET Core runtime contains everything needed to run .NET +web applications. It includes a high performance Virtual Machine as +well as the framework libraries used by .NET applications. + +ASP.NET Core is a fast, lightweight and modular platform for creating +cross platform web applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + + +%package -n dotnet-templates-%{dotnetver} + +Version: %{sdk_rpm_version} +Summary: .NET %{dotnetver} templates + +# Theoretically any version of the host should work. But lets aim for the one +# provided by this package, or from a newer version of .NET +Requires: dotnet-host%{?_isa} >= %{host_rpm_version}-%{release} + +%description -n dotnet-templates-%{dotnetver} +This package contains templates used by the .NET SDK. + +.NET is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + + +%package -n dotnet-sdk-%{dotnetver} + +Version: %{sdk_rpm_version} +Summary: .NET %{dotnetver} Software Development Kit + +Provides: bundled(js-jquery) + +Requires: dotnet-runtime-%{dotnetver}%{?_isa} >= %{runtime_rpm_version}-%{release} +Requires: aspnetcore-runtime-%{dotnetver}%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release} + +Requires: dotnet-apphost-pack-%{dotnetver}%{?_isa} >= %{runtime_rpm_version}-%{release} +Requires: dotnet-targeting-pack-%{dotnetver}%{?_isa} >= %{runtime_rpm_version}-%{release} +Requires: aspnetcore-targeting-pack-%{dotnetver}%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release} +Requires: netstandard-targeting-pack-2.1%{?_isa} >= %{sdk_rpm_version}-%{release} + +Requires: dotnet-templates-%{dotnetver}%{?_isa} >= %{sdk_rpm_version}-%{release} + +%description -n dotnet-sdk-%{dotnetver} +The .NET SDK is a collection of command line applications to +create, build, publish and run .NET applications. + +.NET is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + + +%global dotnet_targeting_pack() %{expand: +%package -n %{1} + +Version: %{2} +Summary: Targeting Pack for %{3} %{4} + +Requires: dotnet-host%{?_isa} + +%description -n %{1} +This package provides a targeting pack for %{3} %{4} +that allows developers to compile against and target %{3} %{4} +applications using the .NET SDK. + +%files -n %{1} +%dir %{_libdir}/dotnet/packs +%{_libdir}/dotnet/packs/%{5} +} + +%dotnet_targeting_pack dotnet-apphost-pack-%{dotnetver} %{runtime_rpm_version} Microsoft.NETCore.App %{dotnetver} Microsoft.NETCore.App.Host.%{runtime_id} +%dotnet_targeting_pack dotnet-targeting-pack-%{dotnetver} %{runtime_rpm_version} Microsoft.NETCore.App %{dotnetver} Microsoft.NETCore.App.Ref +%dotnet_targeting_pack aspnetcore-targeting-pack-%{dotnetver} %{aspnetcore_runtime_rpm_version} Microsoft.AspNetCore.App %{dotnetver} Microsoft.AspNetCore.App.Ref +%dotnet_targeting_pack netstandard-targeting-pack-2.1 %{sdk_rpm_version} NETStandard.Library 2.1 NETStandard.Library.Ref + + +%package -n dotnet-sdk-%{dotnetver}-source-built-artifacts + +Version: %{sdk_rpm_version} +Summary: Internal package for building .NET %{dotnetver} Software Development Kit + +%description -n dotnet-sdk-%{dotnetver}-source-built-artifacts +The .NET source-built archive is a collection of packages needed +to build the .NET SDK itself. + +These are not meant for general use. + + +%prep +%if %{without bootstrap} +%setup -q -n dotnet-%{upstream_tag} + +# Remove all prebuilts +find -iname '*.dll' -type f -delete +find -iname '*.so' -type f -delete +find -iname '*.tar.gz' -type f -delete +find -iname '*.nupkg' -type f -delete +find -iname '*.zip' -type f -delete + +rm -rf .dotnet/ +rm -rf packages/source-built + +mkdir -p packages/archive +ln -s %{_libdir}/dotnet/source-built-artifacts/Private.SourceBuilt.Artifacts.*.tar.gz packages/archive/ + +%else + +%setup -q -T -b 0 -n dotnet-%{upstream_tag}-x64-bootstrap + +%ifnarch x86_64 + +rm -rf .dotnet +%ifarch aarch64 +tar -x --strip-components=1 -f %{SOURCE1} -C packages/prebuilt +%endif +%ifarch ppc64le +tar -x --strip-components=1 -f %{SOURCE2} -C packages/prebuilt +%endif +%ifarch s390x +tar -x --strip-components=1 -f %{SOURCE3} -C packages/prebuilt +%endif + +mkdir -p .dotnet +tar xf packages/prebuilt/dotnet-sdk*.tar.gz -C .dotnet/ +rm packages/prebuilt/dotnet-sdk*.tar.gz + +boot_sdk_version=$(ls -1 .dotnet/sdk/) +sed -i -E 's|"dotnet": "[^"]+"|"dotnet" : "'$boot_sdk_version'"|' global.json + +%ifarch ppc64le s390x +ilasm_version=$(ls packages/prebuilt| grep -i ilasm | tr 'A-Z' 'a-z' | sed -E 's|runtime.linux-'%{runtime_arch}'.microsoft.netcore.ilasm.||' | sed -E 's|.nupkg$||') +echo $ilasm_version + +mkdir -p packages-customized-local +pushd packages-customized-local +tar xf ../packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz +sed -i -E 's|[^<]+|'$ilasm_version'|' PackageVersions.props +sed -i -E 's|[^<]+|'$ilasm_version'|' PackageVersions.props +tar czf ../packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz * +popd + +%endif + +%endif + +%endif + +%autopatch -p1 + +# Fix bad hardcoded path in build +sed -i 's|/usr/share/dotnet|%{_libdir}/dotnet|' src/runtime/src/native/corehost/hostmisc/pal.unix.cpp + +%if ! %{use_bundled_libunwind} +sed -i -E 's|( /p:BuildDebPackage=false)|\1 --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE|' src/runtime/eng/SourceBuild.props +%endif + + +%build +cat /etc/os-release + +%if %{without bootstrap} +# We need to create a copy because we will mutate this +cp -a %{_libdir}/dotnet previously-built-dotnet +find previously-built-dotnet +%endif + +%if 0%{?fedora} || 0%{?rhel} >= 9 +# Setting this macro ensures that only clang supported options will be +# added to ldflags and cflags. +%global toolchain clang +%set_build_flags +%else +# Filter flags not supported by clang +%global dotnet_cflags %(echo %optflags | sed -re 's/-specs=[^ ]*//g') +%global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g') +export CFLAGS="%{dotnet_cflags}" +export CXXFLAGS="%{dotnet_cflags}" +export LDFLAGS="%{dotnet_ldflags}" +%endif + +# -fstack-clash-protection breaks CoreCLR +CFLAGS=$(echo $CFLAGS | sed -e 's/-fstack-clash-protection//' ) +CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/-fstack-clash-protection//' ) + +%ifarch aarch64 +# -mbranch-protection=standard breaks unwinding in CoreCLR through libunwind +CFLAGS=$(echo $CFLAGS | sed -e 's/-mbranch-protection=standard //') +CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/-mbranch-protection=standard //') +%endif + +%ifarch s390x +# -march=z13 -mtune=z14 makes clang crash while compiling .NET +CFLAGS=$(echo $CFLAGS | sed -e 's/ -march=z13//') +CFLAGS=$(echo $CFLAGS | sed -e 's/ -mtune=z14//') +CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/ -march=z13//') +CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/ -mtune=z14//') +%endif + +export EXTRA_CFLAGS="$CFLAGS" +export EXTRA_CXXFLAGS="$CXXFLAGS" +export EXTRA_LDFLAGS="$LDFLAGS" + +# Disable tracing, which is incompatible with certain versions of +# lttng See https://github.com/dotnet/runtime/issues/57784. The +# suggested compile-time change doesn't work, unfortunately. +export COMPlus_LTTng=0 + +# OpenSSL 3.0 in RHEL 9 and newer versions of Fedora has disabled +# SHA1, used by .NET for strong name signing. See +# https://github.com/dotnet/runtime/issues/67304 +# https://gitlab.com/redhat/centos-stream/rpms/openssl/-/commit/78fb78d30755ae18fdaef28ef392f4e67c662ff6 +export OPENSSL_ENABLE_SHA1_SIGNATURES=1 + +VERBOSE=1 ./build.sh \ +%if %{without bootstrap} + --with-sdk previously-built-dotnet \ +%endif +%ifarch %{mono_archs} + --use-mono-runtime \ +%endif + -- \ + /p:MinimalConsoleLogOutput=false \ + /p:ContinueOnPrebuiltBaselineError=true \ + /v:n \ + /p:LogVerbosity=n \ + + +echo \ + /p:SkipPortableRuntimeBuild=true \ + + +sed -e 's|[@]LIBDIR[@]|%{_libdir}|g' %{SOURCE11} > dotnet.sh + + +%install +install -dm 0755 %{buildroot}%{_libdir}/dotnet +ls artifacts/%{runtime_arch}/Release +tar xf artifacts/%{runtime_arch}/Release/dotnet-sdk-%{sdk_version}-%{runtime_id}.tar.gz -C %{buildroot}%{_libdir}/dotnet/ + +# See https://github.com/dotnet/source-build/issues/2579 +find %{buildroot}%{_libdir}/dotnet/ -type f -name 'testhost.x86' -delete +find %{buildroot}%{_libdir}/dotnet/ -type f -name 'vstest.console' -delete + +# Install managed symbols: disabled because they don't contain sources +# but point to the paths the sources would have been at in the build +# servers. The end user experience is pretty bad atm. +# tar xf artifacts/%%{runtime_arch}/Release/runtime/dotnet-runtime-symbols-%%{runtime_id}-%%{runtime_version}.tar.gz \ +# -C %%{buildroot}/%%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%%{runtime_version}/ + +# Fix executable permissions on files +find %{buildroot}%{_libdir}/dotnet/ -type f -name 'apphost' -exec chmod +x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name 'singlefilehost' -exec chmod +x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name 'lib*so' -exec chmod +x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.a' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.dll' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.h' -exec chmod 0644 {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.json' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.pdb' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.props' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.pubxml' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.targets' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.txt' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.xml' -exec chmod -x {} \; + +install -dm 0755 %{buildroot}%{_sysconfdir}/profile.d/ +install dotnet.sh %{buildroot}%{_sysconfdir}/profile.d/ + +install -dm 0755 %{buildroot}/%{_datadir}/bash-completion/completions +# dynamic completion needs the file to be named the same as the base command +install src/sdk/scripts/register-completions.bash %{buildroot}/%{_datadir}/bash-completion/completions/dotnet + +# TODO: the zsh completion script needs to be ported to use #compdef +#install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions +#install src/cli/scripts/register-completions.zsh %%{buildroot}/%%{_datadir}/zsh/site-functions/_dotnet + +install -dm 0755 %{buildroot}%{_bindir} +ln -s ../../%{_libdir}/dotnet/dotnet %{buildroot}%{_bindir}/ + +for section in 1 7; do + install -dm 0755 %{buildroot}%{_mandir}/man${section}/ + find -iname 'dotnet*'.${section} -type f -exec cp {} %{buildroot}%{_mandir}/man${section}/ \; +done + +install -dm 0755 %{buildroot}%{_sysconfdir}/dotnet +echo "%{_libdir}/dotnet" >> install_location +install install_location %{buildroot}%{_sysconfdir}/dotnet/ +echo "%{_libdir}/dotnet" >> install_location_%{runtime_arch} +install install_location_%{runtime_arch} %{buildroot}%{_sysconfdir}/dotnet/ + +install -dm 0755 %{buildroot}%{_libdir}/dotnet/source-built-artifacts +install -m 0644 artifacts/%{runtime_arch}/Release/Private.SourceBuilt.Artifacts.*.tar.gz %{buildroot}/%{_libdir}/dotnet/source-built-artifacts/ + + +# Quick and dirty check for https://github.com/dotnet/source-build/issues/2731 +test -f %{buildroot}%{_libdir}/dotnet/sdk/%{sdk_version}/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props + +# Check debug symbols in all elf objects. This is not in %%check +# because native binaries are stripped by rpm-build after %%install. +# So we need to do this check earlier. +echo "Testing build results for debug symbols..." +%{SOURCE10} -v %{buildroot}%{_libdir}/dotnet/ + + + +%check +%if 0%{?fedora} > 35 +# lttng in Fedora > 35 is incompatible with .NET +export COMPlus_LTTng=0 +%endif + +%{buildroot}%{_libdir}/dotnet/dotnet --info +%{buildroot}%{_libdir}/dotnet/dotnet --version + + +%if ( 0%{?fedora} && 0%{?fedora} < 38 ) || ( 0%{?rhel} && 0%{?rhel} < 9 ) +%files -n dotnet +# empty package useful for dependencies +%endif + +%files -n dotnet-host +%dir %{_libdir}/dotnet +%{_libdir}/dotnet/dotnet +%dir %{_libdir}/dotnet/host +%dir %{_libdir}/dotnet/host/fxr +%{_bindir}/dotnet +%license %{_libdir}/dotnet/LICENSE.txt +%license %{_libdir}/dotnet/ThirdPartyNotices.txt +%doc %{_mandir}/man1/dotnet*.1.* +%doc %{_mandir}/man7/dotnet*.7.* +%config(noreplace) %{_sysconfdir}/profile.d/dotnet.sh +%config(noreplace) %{_sysconfdir}/dotnet +%dir %{_datadir}/bash-completion +%dir %{_datadir}/bash-completion/completions +%{_datadir}/bash-completion/completions/dotnet + +%files -n dotnet-hostfxr-%{dotnetver} +%dir %{_libdir}/dotnet/host/fxr +%{_libdir}/dotnet/host/fxr/%{host_version} + +%files -n dotnet-runtime-%{dotnetver} +%dir %{_libdir}/dotnet/shared +%dir %{_libdir}/dotnet/shared/Microsoft.NETCore.App +%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version} + +%files -n aspnetcore-runtime-%{dotnetver} +%dir %{_libdir}/dotnet/shared +%dir %{_libdir}/dotnet/shared/Microsoft.AspNetCore.App +%{_libdir}/dotnet/shared/Microsoft.AspNetCore.App/%{aspnetcore_runtime_version} + +%files -n dotnet-templates-%{dotnetver} +%dir %{_libdir}/dotnet/templates +%{_libdir}/dotnet/templates/%{templates_version} + +%files -n dotnet-sdk-%{dotnetver} +%dir %{_libdir}/dotnet/sdk +%{_libdir}/dotnet/sdk/%{sdk_version} +%dir %{_libdir}/dotnet/sdk-manifests +%{_libdir}/dotnet/sdk-manifests/%{sdk_feature_band_version} +%{_libdir}/dotnet/sdk-manifests/%{sdk_feature_band_version}-rc.1 +%{_libdir}/dotnet/metadata +%dir %{_libdir}/dotnet/packs + +%files -n dotnet-sdk-%{dotnetver}-source-built-artifacts +%dir %{_libdir}/dotnet +%{_libdir}/dotnet/source-built-artifacts + + +%changelog +* Thu Nov 10 2022 Omair Majid - 7.0.100-0.1 +- Update to .NET 7 RC 2 + +* Wed May 11 2022 Omair Majid - 6.0.105-1 +- Update to .NET SDK 6.0.105 and Runtime 6.0.5 + +* Tue Apr 12 2022 Omair Majid - 6.0.104-1 +- Update to .NET SDK 6.0.104 and Runtime 6.0.4 + +* Thu Mar 10 2022 Omair Majid - 6.0.103-1 +- Update to .NET SDK 6.0.103 and Runtime 6.0.3 + +* Mon Feb 14 2022 Omair Majid - 6.0.102-1 +- Update to .NET SDK 6.0.102 and Runtime 6.0.2 + +* Fri Jan 28 2022 Omair Majid - 6.0.101-3 +- Update to .NET SDK 6.0.101 and Runtime 6.0.1 + +* Thu Jan 20 2022 Fedora Release Engineering - 6.0.100-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Dec 20 2021 Omair Majid - 6.0.100-2 +- Disable bootstrap + +* Sun Dec 19 2021 Omair Majid - 6.0.100-1 +- Update to .NET 6 + +* Fri Oct 22 2021 Omair Majid - 6.0.0-0.7.rc2 +- Update to .NET 6 RC2 + +* Fri Oct 08 2021 Omair Majid - 6.0.0-0.6.28be3e9a006d90d8c6e87d4353b77882829df718 +- Enable building on arm64 +- Related: RHBZ#1986017 + +* Sun Oct 03 2021 Omair Majid - 6.0.0-0.5.28be3e9a006d90d8c6e87d4353b77882829df718 +- Enable building on s390x +- Related: RHBZ#1986017 + +* Sun Oct 03 2021 Omair Majid - 6.0.0-0.4.28be3e9a006d90d8c6e87d4353b77882829df718 +- Clean up tarball and add initial support for s390x +- Related: RHBZ#1986017 + +* Sun Sep 26 2021 Omair Majid - 6.0.0-0.3.28be3e9a006d90d8c6e87d4353b77882829df718 +- Update to work-in-progress RC2 release + +* Wed Aug 25 2021 Omair Majid - 6.0.0-0.2.preview6 +- Updated to build the latest source-build preview + +* Fri Jul 23 2021 Omair Majid - 6.0.0-0.1.preview6 +- Initial package for .NET 6 + +* Thu Jun 10 2021 Omair Majid - 5.0.204-1 +- Update to .NET SDK 5.0.204 and Runtime 5.0.7 + +* Wed May 12 2021 Omair Majid - 5.0.203-1 +- Update to .NET SDK 5.0.203 and Runtime 5.0.6 + +* Wed Apr 14 2021 Omair Majid - 5.0.202-1 +- Update to .NET SDK 5.0.202 and Runtime 5.0.5 + +* Tue Apr 06 2021 Omair Majid - 5.0.104-2 +- Mark files under /etc/ as config(noreplace) +- Add an rpm-inspect configuration file +- Add an rpmlintrc file +- Enable gating for release branches and ELN too + +* Tue Mar 16 2021 Omair Majid - 5.0.104-1 +- Update to .NET SDK 5.0.104 and Runtime 5.0.4 +- Drop unneeded/upstreamed patches + +* Wed Feb 17 2021 Omair Majid - 5.0.103-2 +- Add Fedora 35 RIDs + +* Thu Feb 11 2021 Omair Majid - 5.0.103-1 +- Update to .NET SDK 5.0.103 and Runtime 5.0.3 + +* Fri Jan 29 2021 Omair Majid - 5.0.102-2 +- Disable bootstrap + +* Fri Dec 18 2020 Omair Majid - 5.0.100-2 +- Update to .NET Core Runtime 5.0.0 and SDK 5.0.100 commit 9c4e5de + +* Fri Dec 04 2020 Omair Majid - 5.0.100-1 +- Update to .NET Core Runtime 5.0.0 and SDK 5.0.100 + +* Thu Dec 03 2020 Omair Majid - 5.0.100-0.4.20201202git337413b +- Update to latest 5.0 pre-GA commit + +* Tue Nov 24 2020 Omair Majid - 5.0.100-0.4.20201123gitdee899c +- Update to 5.0 pre-GA commit + +* Mon Sep 14 2020 Omair Majid - 5.0.100-0.3.preview8 +- Update to Preview 8 + +* Fri Jul 10 2020 Omair Majid - 5.0.100-0.2.preview4 +- Fix building with custom CFLAGS/CXXFLAGS/LDFLAGS +- Clean up patches + +* Mon Jul 06 2020 Omair Majid - 5.0.100-0.1.preview4 +- Initial build + +* Sat Jun 27 2020 Omair Majid - 3.1.105-4 +- Disable bootstrap + +* Fri Jun 26 2020 Omair Majid - 3.1.105-3 +- Re-bootstrap aarch64 + +* Fri Jun 19 2020 Omair Majid - 3.1.105-3 +- Disable bootstrap + +* Thu Jun 18 2020 Omair Majid - 3.1.105-1 +- Bootstrap aarch64 + +* Tue Jun 16 2020 Chris Rummel - 3.1.105-1 +- Update to .NET Core Runtime 3.1.5 and SDK 3.1.105 + +* Fri Jun 05 2020 Chris Rummel - 3.1.104-1 +- Update to .NET Core Runtime 3.1.4 and SDK 3.1.104 + +* Thu Apr 09 2020 Chris Rummel - 3.1.103-1 +- Update to .NET Core Runtime 3.1.3 and SDK 3.1.103 + +* Mon Mar 16 2020 Omair Majid - 3.1.102-1 +- Update to .NET Core Runtime 3.1.2 and SDK 3.1.102 + +* Fri Feb 28 2020 Omair Majid - 3.1.101-4 +- Disable bootstrap + +* Fri Feb 28 2020 Omair Majid - 3.1.101-3 +- Enable bootstrap +- Add Fedora 33 runtime ids + +* Thu Feb 27 2020 Omair Majid - 3.1.101-2 +- Disable bootstrap + +* Tue Jan 21 2020 Omair Majid - 3.1.101-1 +- Update to .NET Core Runtime 3.1.1 and SDK 3.1.101 + +* Thu Dec 05 2019 Omair Majid - 3.1.100-1 +- Update to .NET Core Runtime 3.1.0 and SDK 3.1.100 + +* Mon Nov 18 2019 Omair Majid - 3.1.100-0.4.preview3 +- Fix apphost permissions + +* Fri Nov 15 2019 Omair Majid - 3.1.100-0.3.preview3 +- Update to .NET Core Runtime 3.1.0-preview3.19553.2 and SDK + 3.1.100-preview3-014645 + +* Wed Nov 06 2019 Omair Majid - 3.1.100-0.2 +- Update to .NET Core 3.1 Preview 2 + +* Wed Oct 30 2019 Omair Majid - 3.1.100-0.1 +- Update to .NET Core 3.1 Preview 1 + +* Thu Oct 24 2019 Omair Majid - 3.0.100-5 +- Add cgroupv2 support to .NET Core + +* Wed Oct 16 2019 Omair Majid - 3.0.100-4 +- Include fix from coreclr for building on Fedora 32 + +* Wed Oct 16 2019 Omair Majid - 3.0.100-3 +- Harden built binaries to pass annocheck + +* Fri Oct 11 2019 Omair Majid - 3.0.100-2 +- Export DOTNET_ROOT in profile to make apphost lookup work + +* Fri Sep 27 2019 Omair Majid - 3.0.100-1 +- Update to .NET Core Runtime 3.0.0 and SDK 3.0.100 + +* Wed Sep 25 2019 Omair Majid - 3.0.100-0.18.rc1 +- Update to .NET Core Runtime 3.0.0-rc1-19456-20 and SDK 3.0.100-rc1-014190 + +* Tue Sep 17 2019 Omair Majid - 3.0.100-0.16.preview9 +- Fix files duplicated between dotnet-apphost-pack-3.0 and dotnet-targeting-pack-3.0 +- Fix dependencies between .NET SDK and the targeting packs + +* Mon Sep 16 2019 Omair Majid - 3.0.100-0.15.preview9 +- Update to .NET Core Runtime 3.0.0-preview 9 and SDK 3.0.100-preview9 + +* Mon Aug 19 2019 Omair Majid - 3.0.100-0.11.preview8 +- Update to .NET Core Runtime 3.0.0-preview8-28405-07 and SDK + 3.0.100-preview8-013656 + +* Tue Jul 30 2019 Omair Majid - 3.0.100-0.9.preview7 +- Update to .NET Core Runtime 3.0.0-preview7-27912-14 and SDK + 3.0.100-preview7-012821 + +* Fri Jul 26 2019 Omair Majid - 3.0.100-0.8.preview7 +- Update to .NET Core Runtime 3.0.0-preview7-27902-19 and SDK + 3.0.100-preview7-012802 + +* Wed Jun 26 2019 Omair Majid - 3.0.0-0.7.preview6 +- Obsolete dotnet-sdk-3.0.1xx +- Add supackages for targeting packs +- Add -fcf-protection to CFLAGS + +* Wed Jun 26 2019 Omair Majid - 3.0.0-0.6.preview6 +- Update to .NET Core Runtime 3.0.0-preview6-27804-01 and SDK 3.0.100-preview6-012264 +- Set dotnet installation location in /etc/dotnet/install_location +- Update targeting packs +- Install managed symbols +- Completely conditionalize libunwind bundling + +* Tue May 07 2019 Omair Majid - 3.0.0-0.3.preview4 +- Update to .NET Core 3.0 preview 4 + +* Tue Dec 18 2018 Omair Majid - 3.0.0-0.1.preview1 +- Update to .NET Core 3.0 preview 1 + +* Fri Dec 07 2018 Omair Majid - 2.2.100 +- Update to .NET Core 2.2.0 + +* Wed Nov 07 2018 Omair Majid - 2.2.100-0.2.preview3 +- Update to .NET Core 2.2.0-preview3 + +* Fri Nov 02 2018 Omair Majid - 2.1.403-3 +- Add host-fxr-2.1 subpackage + +* Mon Oct 15 2018 Omair Majid - 2.1.403-2 +- Disable telemetry by default +- Users have to manually export DOTNET_CLI_TELEMETRY_OPTOUT=0 to enable + +* Tue Oct 02 2018 Omair Majid - 2.1.403-1 +- Update to .NET Core Runtime 2.1.5 and SDK 2.1.403 + +* Wed Sep 26 2018 Omair Majid - 2.1.402-2 +- Add ~/.dotnet/tools to $PATH to make it easier to use dotnet tools + +* Thu Sep 13 2018 Omair Majid - 2.1.402-1 +- Update to .NET Core Runtime 2.1.4 and SDK 2.1.402 + +* Wed Sep 05 2018 Omair Majid - 2.1.401-2 +- Use distro-standard flags when building .NET Core + +* Tue Aug 21 2018 Omair Majid - 2.1.401-1 +- Update to .NET Core Runtime 2.1.3 and SDK 2.1.401 + +* Mon Aug 20 2018 Omair Majid - 2.1.302-1 +- Update to .NET Core Runtime 2.1.2 and SDK 2.1.302 + +* Fri Jul 20 2018 Omair Majid - 2.1.301-1 +- Update to .NET Core 2.1 + +* Thu May 03 2018 Omair Majid - 2.0.7-1 +- Update to .NET Core 2.0.7 + +* Wed Mar 28 2018 Omair Majid - 2.0.6-2 +- Enable bash completion for dotnet +- Remove redundant buildrequires and requires + +* Wed Mar 14 2018 Omair Majid - 2.0.6-1 +- Update to .NET Core 2.0.6 + +* Fri Feb 23 2018 Omair Majid - 2.0.5-1 +- Update to .NET Core 2.0.5 + +* Wed Jan 24 2018 Omair Majid - 2.0.3-5 +- Don't apply corefx clang warnings fix on clang < 5 + +* Fri Jan 19 2018 Omair Majid - 2.0.3-4 +- Add a test script to sanity check debug and symbol info. +- Build with clang 5.0 +- Make main package real instead of using a virtual provides (see RHBZ 1519325) + +* Wed Nov 29 2017 Omair Majid - 2.0.3-3 +- Add a Provides for 'dotnet' +- Fix conditional macro + +* Tue Nov 28 2017 Omair Majid - 2.0.3-2 +- Fix build on Fedora 27 + +* Fri Nov 17 2017 Omair Majid - 2.0.3-1 +- Update to .NET Core 2.0.3 + +* Thu Oct 19 2017 Omair Majid - 2.0.0-4 +- Add a hack to let omnisharp work + +* Wed Aug 30 2017 Omair Majid - 2.0.0-3 +- Add a patch for building coreclr and core-setup correctly on Fedora >= 27 + +* Fri Aug 25 2017 Omair Majid - 2.0.0-2 +- Move libicu/libcurl/libunwind requires to runtime package +- Make sdk depend on the exact version of the runtime package + +* Thu Aug 24 2017 Omair Majid - 2.0.0-1 +- Update to 2.0.0 final release + +* Wed Jul 26 2017 Omair Majid - 2.0.0-0.3.preview2 +- Add man pages + +* Tue Jul 25 2017 Omair Majid - 2.0.0-0.2.preview2 +- Add Requires on libicu +- Split into multiple packages +- Do not repeat first-run message + +* Fri Jul 21 2017 Omair Majid - 2.0.0-0.1.preview2 +- Update to .NET Core 2.0 Preview 2 + +* Thu Mar 16 2017 Nemanja Milošević - 1.1.0-7 +- rebuilt with latest libldb +* Wed Feb 22 2017 Nemanja Milosevic - 1.1.0-6 +- compat-openssl 1.0 for F26 for now +* Sun Feb 19 2017 Nemanja Milosevic - 1.1.0-5 +- Fix wrong commit id's +* Sat Feb 18 2017 Nemanja Milosevic - 1.1.0-4 +- Use commit id's instead of branch names +* Sat Feb 18 2017 Nemanja Milosevic - 1.1.0-3 +- Improper patch5 fix +* Sat Feb 18 2017 Nemanja Milosevic - 1.1.0-2 +- SPEC cleanup +- git removal (using all tarballs for reproducible builds) +- more reasonable versioning +* Thu Feb 09 2017 Nemanja Milosevic - 1.1.0-1 +- Fixed debuginfo going to separate package (Patch1) +- Added F25/F26 RIL and fixed the version info (Patch2) +- Added F25/F26 RIL in Microsoft.NETCore.App suported runtime graph (Patch3) +- SPEC file cleanup +* Wed Jan 11 2017 Nemanja Milosevic - 1.1.0-0 +- Initial RPM for Fedora 25/26. diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..8574546 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,20 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_testing +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/installer-14631-ppc64le.patch b/installer-14631-ppc64le.patch new file mode 100644 index 0000000..5691df5 --- /dev/null +++ b/installer-14631-ppc64le.patch @@ -0,0 +1,98 @@ +From 564e481e39511d214d0d26dd902022decd0d93ea Mon Sep 17 00:00:00 2001 +From: Swapnali911 +Date: Fri, 30 Sep 2022 05:07:55 -0400 +Subject: [PATCH] Adding ppc64le arch for source build + +--- + Directory.Build.props | 1 + + src/SourceBuild/tarball/content/Directory.Build.props | 1 + + src/redist/targets/Crossgen.targets | 4 ++-- + src/redist/targets/GenerateBundledVersions.targets | 9 ++++++--- + 4 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/Directory.Build.props b/Directory.Build.props +index 61cc6ff6746..860785575f7 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -19,6 +19,7 @@ + $([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) + $(BuildArchitecture) + $(BuildArchitecture) ++ $(BuildArchitecture) + x64 + + false +diff --git a/src/installer/Directory.Build.props b/src/installer/Directory.Build.props +index 15c9d27b734..b87eeccca0d 100644 +--- a/src/installer/Directory.Build.props ++++ b/src/installer/Directory.Build.props +@@ -11,6 +11,7 @@ + $([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) + $(BuildArchitecture) + $(BuildArchitecture) ++ $(BuildArchitecture) + x64 + + +diff --git a/src/installer/src/redist/targets/Crossgen.targets b/src/installer/src/redist/targets/Crossgen.targets +index c7a7642e4eb..da7d186a152 100644 +--- a/src/installer/src/redist/targets/Crossgen.targets ++++ b/src/installer/src/redist/targets/Crossgen.targets +@@ -1,7 +1,7 @@ + +- ++ + + + +diff --git a/src/installer/src/redist/targets/GenerateBundledVersions.targets b/src/installer/src/redist/targets/GenerateBundledVersions.targets +index d1bee676355..58d1abfa720 100644 +--- a/src/installer/src/redist/targets/GenerateBundledVersions.targets ++++ b/src/installer/src/redist/targets/GenerateBundledVersions.targets +@@ -168,6 +168,7 @@ + linux-bionic-arm64; + linux-bionic-x64; + linux-bionic-x86; ++ linux-ppc64le; + "/> + + + + + +- ++ ++ + + + +@@ -444,7 +447,7 @@ Copyright (c) .NET Foundation. All rights reserved. + TargetingPackName="Microsoft.AspNetCore.App.Ref" + TargetingPackVersion="$(MicrosoftAspNetCoreAppRefPackageVersion)" + RuntimePackNamePatterns="Microsoft.AspNetCore.App.Runtime.**RID**" +- RuntimePackRuntimeIdentifiers="@(AspNetCoreRuntimePackRids, '%3B')" ++ RuntimePackRuntimeIdentifiers="@(AspNetCore70RuntimePackRids, '%3B')" + RuntimePackExcludedRuntimeIdentifiers="android" + /> + +@@ -569,7 +572,7 @@ Copyright (c) .NET Foundation. All rights reserved. + TargetingPackName="Microsoft.AspNetCore.App.Ref" + TargetingPackVersion="$(_AspNet60TargetingPackVersion)" + RuntimePackNamePatterns="Microsoft.AspNetCore.App.Runtime.**RID**" +- RuntimePackRuntimeIdentifiers="@(AspNetCoreRuntimePackRids, '%3B')" ++ RuntimePackRuntimeIdentifiers="@(AspNetCore60RuntimePackRids, '%3B')" + /> + + +Date: Wed, 19 Oct 2022 15:21:40 +0200 +Subject: [PATCH] Enabled source-building with mono runtime on any + architecture. + +Adds an argument to the top-level build script to use the mono +runtime, and sets the flags needed for the different repos +to work with mono. +--- + eng/SourceBuild.props | 1 + + .../tarball/content/Directory.Build.props | 5 ++ + src/SourceBuild/tarball/content/build.sh | 4 ++ + .../content/repos/Directory.Build.props | 1 + + ...d-support-building-with-mono-runtime.patch | 24 +++++++++ + ...d-support-building-with-mono-runtime.patch | 24 +++++++++ + ...d-support-building-with-mono-runtime.patch | 51 +++++++++++++++++++ + 7 files changed, 110 insertions(+) + create mode 100644 src/SourceBuild/tarball/patches/aspnetcore/0002-source-build-support-building-with-mono-runtime.patch + create mode 100644 src/SourceBuild/tarball/patches/runtime/0001-source-build-support-building-with-mono-runtime.patch + create mode 100644 src/SourceBuild/tarball/patches/sdk/0001-source-build-support-building-with-mono-runtime.patch + +diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props +index a2831d57455..9ebca97ff90 100644 +--- a/src/installer/eng/SourceBuild.props ++++ b/src/installer/eng/SourceBuild.props +@@ -11,6 +11,7 @@ + $(InnerBuildArgs) /p:IncludeNuGetPackageArchive=false + $(InnerBuildArgs) /p:IncludeAdditionalSharedFrameworks=false + $(InnerBuildArgs) /p:IncludeSharedFrameworksForBackwardsCompatibilityTests=false ++ $(InnerBuildArgs) /p:DISABLE_CROSSGEN=true + + + +diff --git a/Directory.Build.props b/Directory.Build.props +index 860785575f7..982fb7f0725 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -24,6 +24,11 @@ + + false + ++ false ++ ++ true ++ true ++ + +diff --git a/build.sh b/build.sh +index e899d2f808c..17699c78cb7 100755 +--- a/build.sh ++++ b/build.sh +@@ -11,6 +11,7 @@ usage() { + echo " --run-smoke-test don't build; run smoke tests" + echo " --with-packages use the specified directory of previously-built packages" + echo " --with-sdk use the SDK in the specified directory for bootstrapping" ++ echo " --use-mono-runtime output uses the mono runtime" + echo "use -- to send the remaining arguments to MSBuild" + echo "" + } +@@ -65,6 +66,9 @@ while :; do + fi + shift + ;; ++ --use-mono-runtime) ++ MSBUILD_ARGUMENTS+=( "/p:SourceBuildUseMonoRuntime=true" ) ++ ;; + --) + shift + echo "Detected '--': passing remaining parameters '$@' as build.sh arguments." +diff --git a/repos/Directory.Build.props b/repos/Directory.Build.props +index e4e3060af7f..04ab89d11dc 100644 +--- a/repos/Directory.Build.props ++++ b/repos/Directory.Build.props +@@ -143,6 +143,7 @@ + $(StandardSourceBuildArgs) /p:AdditionalSourceBuiltNupkgCacheDir="$(SourceBuiltPackagesPath)" + $(StandardSourceBuildArgs) /p:ReferencePackageNupkgCacheDir="$(ReferencePackagesDir)" + $(StandardSourceBuildArgs) /p:PreviouslySourceBuiltNupkgCacheDir="$(PrebuiltSourceBuiltPackagesPath)" ++ $(StandardSourceBuildArgs) /p:SourceBuildUseMonoRuntime=$(SourceBuildUseMonoRuntime) + + $(ProjectDirectory)\build$(ShellExtension) + +diff --git a/src/aspnetcore/eng/SourceBuild.props b/src/aspnetcore/eng/SourceBuild.props +index 32108e1f..3dfbd5ef 100644 +--- a/src/aspnetcore/eng/SourceBuild.props ++++ b/src/aspnetcore/eng/SourceBuild.props +@@ -55,6 +55,7 @@ + + + $(InnerBuildArgs) /p:SourceBuildRuntimeIdentifier=$(TargetRuntimeIdentifier) ++ $(InnerBuildArgs) /p:CrossgenOutput=false + + + +diff --git a/src/runtime/eng/SourceBuild.props b/src/runtime/eng/SourceBuild.props +index c197d8afd..55c1c1d22 100644 +--- a/src/runtime/eng/SourceBuild.props ++++ b/src/runtime/eng/SourceBuild.props +@@ -41,6 +41,7 @@ + $(InnerBuildArgs) /p:BuildDebPackage=false + $(InnerBuildArgs) /p:EnableNgenOptimization=false + $(InnerBuildArgs) /p:EnablePackageValidation=false ++ $(InnerBuildArgs) /p:PrimaryRuntimeFlavor=Mono /p:RuntimeFlavor=Mono + + + +diff --git a/src/sdk/eng/SourceBuild.props b/src/sdk/eng/SourceBuild.props +index 61b9a913708..2107a718419 100644 +--- a/src/sdk/eng/SourceBuild.props ++++ b/src/sdk/eng/SourceBuild.props +@@ -8,6 +8,7 @@ + + $(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)\source-build.slnf" + $(InnerBuildArgs) /p:UseSharedCompilation=false ++ $(InnerBuildArgs) /p:NativeAotSupported=false + + + +diff --git a/src/sdk/src/Layout/redist/targets/BundledSdks.targets b/src/sdk/src/Layout/redist/targets/BundledSdks.targets +index 6f8b0fc3b33..64638ef1cff 100644 +--- a/src/sdk/src/Layout/redist/targets/BundledSdks.targets ++++ b/src/sdk/src/Layout/redist/targets/BundledSdks.targets +@@ -5,6 +5,6 @@ + + + +- ++ + + +diff --git a/src/sdk/src/Tasks/Common/Resources/Strings.resx b/src/sdk/src/Tasks/Common/Resources/Strings.resx +index a347c736df5..426cb6aa96d 100644 +--- a/src/sdk/src/Tasks/Common/Resources/Strings.resx ++++ b/src/sdk/src/Tasks/Common/Resources/Strings.resx +@@ -875,4 +875,8 @@ You may need to build the project on another operating system or architecture, o + NETSDK1191: A runtime identifier for the property '{0}' couldn't be inferred. Specify a rid explicitly. + {StrBegin="NETSDK1191: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +index e477f7a489b..c75990f94e2 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.cs.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: Sestavení nelze optimalizovat pro kompilaci s předstihem: nebyl nalezen platný balíček modulu runtime. Buď nastavte vlastnost PublishAot na hodnotu false, nebo při publikování použijte podporovaný identifikátor modulu runtime. Při cílení na .NET 7 nebo vyšší nezapomeňte obnovit balíčky s vlastností PublishAot nastavenou na hodnotu true. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: Konfigurační soubor aplikace musí obsahovat kořenový element konfigurace. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.de.xlf +index d8cd9725269..2e427931dd1 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.de.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.de.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: Assemblys können nicht für Ahead-of-time-Kompilierung optimiert werden: Es wurde kein gültiges Runtimepaket gefunden. Legen Sie entweder die PublishAot-Eigenschaft auf FALSE fest, oder verwenden Sie beim Veröffentlichen einen unterstützten Runtimebezeichner. Wenn Sie .NET 7 oder höher verwenden, stellen Sie sicher, dass Sie Pakete wiederherstellen, bei denen die PublishAot-Eigenschaft auf TRUE festgelegt ist. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: Die Anwendungskonfigurationsdatei muss das Stammkonfigurationselement enthalten. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.es.xlf +index 4c61e20b937..cb654c521fb 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.es.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.es.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: No se pueden optimizar los ensamblados para la compilación Ahead of time: no se ha encontrado un paquete en tiempo de ejecución válido. Establezca la propiedad PublishAot en false o use un identificador de tiempo de ejecución compatible al publicar. Cuando el destino sea .NET 7 o una versión posterior, asegúrese de restaurar los paquetes con la propiedad PublishAot establecida en true. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: El archivo de configuración de la aplicación debe tener el elemento de configuración raíz. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +index dfbb0391549..a97af754880 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.fr.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: Impossible d'optimiser les assemblys pour la compilation Ahead of time : un package d'exécution valide n'a pas été trouvé. Définissez la propriété PublishAot sur false ou utilisez un identificateur d'exécution pris en charge lors de la publication. Lorsque vous ciblez .NET 7 ou supérieur, assurez-vous de restaurer les packages avec la propriété PublishAot définie sur true. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: Le fichier de configuration de l'application doit avoir un élément de configuration racine. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.it.xlf +index a768517271c..70fe2939526 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.it.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.it.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: non è possibile ottimizzare gli assembly per la compilazione Ahead Of Time perché non è stato trovato alcun pacchetto di runtime valido. Impostare la proprietà PublishAot su false oppure usare un identificatore di runtime supportato durante la pubblicazione. Quando si usa .NET 7 o versioni successive, assicurarsi di ripristinare i pacchetti con la proprietà PublishAot impostata su true. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: il file di configurazione dell'applicazione deve avere un elemento di configurazione radice. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +index c3713a3bb6f..42ba79f1034 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ja.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: Ahead Of Time コンパイル用にアセンブリを最適化できません: 有効なランタイム パッケージが見つかりませんでした。PublishAot プロパティを false に設定するか、公開時に、サポートされているランタイム識別子を使用してください。.NET 7 以降を対象とする場合は、必ず PublishAot プロパティを true に設定してパッケージを復元してください。 + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: アプリケーション構成ファイルには、ルート構成要素が必要です。 +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +index 86d77d024ad..f9695e37529 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ko.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: Ahead of Time 컴파일을 위해 어셈블리를 최적화할 수 없습니다. 유효한 런타임 패키지를 찾을 수 없습니다. PublishAot 속성을 false로 설정하거나 게시할 때 지원되는 런타임 식별자를 사용하세요. .NET 7 이상을 대상으로 하는 경우 PublishAot 속성이 true로 설정된 패키지를 복원해야 합니다. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: 애플리케이션 구성 파일에는 루트 구성 요소가 있어야 합니다. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +index b954c4f64f5..0594cfc5bad 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.pl.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: Nie można zoptymalizować zestawów pod kątem kompilacji z wyprzedzeniem: nie znaleziono prawidłowego pakietu środowiska uruchomieniowego. Ustaw właściwość PublishAot na wartość false lub użyj obsługiwanego identyfikatora środowiska uruchomieniowego podczas publikowania. W przypadku określania wartości docelowej platformy .NET 7 lub nowszej należy przywrócić pakiety z właściwością PublishAot ustawioną na wartość true. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: Plik konfiguracji aplikacji musi mieć główny element konfiguracji. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +index 4153425cfce..ae701f4dc3b 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: Não é possível otimizar assemblies para compilação antecipada: um pacote de tempo de execução válido não foi encontrado. Defina a propriedade PublishAot como false ou use um identificador de tempo de execução com suporte ao publicar. Ao direcionar o .NET 7 ou superior, certifique-se de restaurar os pacotes com a propriedade PublishAot definida como true. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: o arquivo de configuração do aplicativo deve ter um elemento de configuração raiz. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +index e66e13cd417..1780c0eb89b 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ru.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: не удалось оптимизировать сборки для компиляции Ahead Of Time: не найден допустимый пакет среды выполнения. Задайте для свойства PublishAot значение false либо используйте поддерживаемый идентификатор среды выполнения при публикации. При выборе .NET 7 или более поздней версии в качестве цели восстановите пакеты со свойством PublishAot со значением true. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: В файле конфигурации приложения должен присутствовать корневой элемент конфигурации. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +index 4121fe024d6..d4ec2bbfea3 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.tr.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: Derlemeler, AOT derlemesi için iyileştirilemedi: geçerli bir çalışma zamanı paketi bulunamadı. PublishAot özelliğini false olarak ayarlayın veya yayımlarken desteklenen bir çalışma zamanı tanımlayıcısı kullanın. .NET 7 veya üzerini hedeflerken PublishAot özelliği true olarak ayarlanmış paketleri geri yüklediğinizden emin olun. + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: Uygulama yapılandırma dosyasının kök yapılandırma öğesi olmalıdır. +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +index 5bd5617ccba..77323667f98 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: 无法优化程序集以实现提前编译: 找不到有效的运行时包。将 PublishAot 属性设置为 false,或在发布时使用支持的运行时标识符。面向 .NET 7 或更高版本时,请确保还原将 PublishAot 属性设置为 true 的包。 + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: 应用程序配置文件必须具有根配置元素。 +diff --git a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +index c2e6be8b9be..ae573c7ed8b 100644 +--- a/src/sdk/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf ++++ b/src/sdk/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +@@ -12,6 +12,11 @@ + NETSDK1183: 無法為提前編譯最佳化組件: 找不到有效的執行階段套件。請將 PublishAot 屬性設為 false,或在發佈時使用支援的執行階段識別碼。以 .NET 7 或更高版本為目標時,請務必還原套件,將 PublishAot 屬性設為 true。 + {StrBegin="NETSDK1183: "} + ++ ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ NETSDK1193: The SDK does not support Ahead of time compilation. Set the PublishAot property to false. ++ {StrBegin="NETSDK1193: "} ++ + + NETSDK1070: The application configuration file must have root configuration element. + NETSDK1070: 應用程式組態檔必須有根組態元素。 +diff --git a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +index 84b21ee0dd8..72d10f518af 100644 +--- a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets ++++ b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +@@ -178,6 +178,9 @@ Copyright (c) .NET Foundation. All rights reserved. + ResourceName="ImplicitRuntimeIdentifierResolutionForPublishPropertyFailed" + FormatArguments="PublishAot"/> + ++ ++ + + +diff --git a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props +index 73a182102d1..b7eee4dfe3d 100644 +--- a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props ++++ b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props +@@ -116,6 +116,8 @@ Copyright (c) .NET Foundation. All rights reserved. + true + true + ++ false ++ true + + + +@@ -151,7 +153,7 @@ Copyright (c) .NET Foundation. All rights reserved. + + + +- ++ + + + +diff --git a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets +index 4311ec0ecea..1f80ab9ded0 100644 +--- a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets ++++ b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets +@@ -1175,7 +1175,7 @@ Copyright (c) .NET Foundation. All rights reserved. + + + +- ++ + + + +diff --git a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets +index a943e6615bf..8593957f3d6 100644 +--- a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets ++++ b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets +@@ -111,6 +111,8 @@ Copyright (c) .NET Foundation. All rights reserved. + '$(EnableCompressionInSingleFile)' == 'true' And + '$(SelfContained)' != 'true'" + ResourceName="CompressionInSingleFileRequiresSelfContained" /> ++ + + + + +- +- + + diff --git a/rename-tarball b/rename-tarball new file mode 100755 index 0000000..ea7e65c --- /dev/null +++ b/rename-tarball @@ -0,0 +1,51 @@ +#!/bin/bash + +# Usage: +# ./rename-tarball original-name.tar.gz new-name.tar.gz + +set -euo pipefail +IFS=$'\n\t' + +positional_args=() +while [[ "$#" -gt 0 ]]; do + arg="${1}" + case "${arg}" in + -h|--help) + print_usage + exit 0 + ;; + *) + positional_args+=("$1") + shift + ;; + esac +done + +if [[ -z "${positional_args[0]:-}" ]]; then + echo "error: missing original tarball name" + exit 1 +fi + +original_path=$(readlink -f "${positional_args[0]:-}") +original_name=$(basename "$original_path") + +new_name=${positional_args[1]:-} +if [[ -z ${new_name} ]]; then + echo "error: missing new tarball name" + exit 1 +fi + +original_name=${original_name/%.tar.gz} +new_name=${new_name/.tar.gz} + +echo "Original: ${original_name}.tar.gz" +echo "New name: ${new_name}.tar.gz" + +mkdir "temp-${new_name}" +pushd "temp-${new_name}" +tar xf "${original_path}" +mv -- * "${new_name}" +tar czf ../"${new_name}.tar.gz" "${new_name}" +rm -rf "${new_name}" +popd +rmdir "temp-${new_name}" diff --git a/roslyn-analyzers-ppc64le-apphost.patch b/roslyn-analyzers-ppc64le-apphost.patch new file mode 100644 index 0000000..4dd465c --- /dev/null +++ b/roslyn-analyzers-ppc64le-apphost.patch @@ -0,0 +1,12 @@ +diff --git a/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj b/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj +index 044a2aba4..b3f8f2611 100644 +--- a/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj ++++ b/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj +@@ -4,6 +4,7 @@ + preview + disable + Exe ++ false + + + true diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..e719510 --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,21 @@ +--- +inspections: + # We ship an empty dotnet package that installs the latest SDK, but + # also a newer SDK when we have that + emptyrpm: off + # We patch upstream a lot, no need to reject patches + patches: off +badfuncs: + allowed: + # The Mono runtime (used on s390x, for example), uses inet_addr for + # debugging (such as sending the control flow graph to a remote process). + # See runtime/src/mono/mono/mini/cfgdump.c. This isn't part of any + # standard networking facility; networking APIs are implemented/used in + # libSystem*so. + /usr/lib64/dotnet/shared/Microsoft.NETCore.App/*/libcoreclr.so: + - inet_addr +runpath: + # Upstream explicitly sets $ORIGIN/netcoredeps as an RPATH + # See https://github.com/dotnet/core/blob/main/Documentation/self-contained-linux-apps.md + allowed_origin_paths: + - /netcoredeps diff --git a/runtime-76916-mono-s390x-opcheckthis.patch b/runtime-76916-mono-s390x-opcheckthis.patch new file mode 100644 index 0000000..b3724a9 --- /dev/null +++ b/runtime-76916-mono-s390x-opcheckthis.patch @@ -0,0 +1,28 @@ +From 7b46eae144e3a6a430155e824fc33e3f38fab427 Mon Sep 17 00:00:00 2001 +From: Ulrich Weigand +Date: Wed, 12 Oct 2022 09:53:09 +0200 +Subject: [PATCH] [mono][s390x] Fix wrong implementation of OP_CHECK_THIS + +* Only access a single byte in memory for OP_CHECK_THIS + +* Remove unnecessary ltgr instruction + +* Fixes https://github.com/dotnet/runtime/issues/76915 +--- + src/mono/mono/mini/mini-s390x.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/runtime/src/mono/mono/mini/mini-s390x.c b/src/runtime/src/mono/mono/mini/mini-s390x.c +index 7c7a936ed9701..26e6ba1d32a3b 100644 +--- a/src/runtime/src/mono/mono/mini/mini-s390x.c ++++ b/src/runtime/src/mono/mono/mini/mini-s390x.c +@@ -3594,8 +3594,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) + break; + case OP_CHECK_THIS: { + /* ensure ins->sreg1 is not NULL */ +- s390_lg (code, s390_r0, 0, ins->sreg1, 0); +- s390_ltgr (code, s390_r0, s390_r0); ++ s390_llgc (code, s390_r0, 0, ins->sreg1, 0); + } + break; + case OP_ARGLIST: { diff --git a/runtime-77269-mono-ppc64le-opcheckthis.patch b/runtime-77269-mono-ppc64le-opcheckthis.patch new file mode 100644 index 0000000..a959beb --- /dev/null +++ b/runtime-77269-mono-ppc64le-opcheckthis.patch @@ -0,0 +1,23 @@ +From f163003da28cd01866b15233116d5efd53b1a2ef Mon Sep 17 00:00:00 2001 +From: Sapana Khemkar +Date: Thu, 13 Oct 2022 07:45:23 +0000 +Subject: [PATCH] use byte load instruction in OP_CHECK_THIS instead of double + word instruction + +--- + src/runtime/src/mono/mono/mini/mini-ppc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/runtime/src/mono/mono/mini/mini-ppc.c b/src/runtime/src/mono/mono/mini/mini-ppc.c +index bc97b497af93a..a2d8c5a714e3b 100644 +--- a/src/runtime/src/mono/mono/mini/mini-ppc.c ++++ b/src/runtime/src/mono/mono/mini/mini-ppc.c +@@ -3837,7 +3837,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) + } + case OP_CHECK_THIS: + /* ensure ins->sreg1 is not NULL */ +- ppc_ldptr (code, ppc_r0, 0, ins->sreg1); ++ ppc_lbz (code, ppc_r0, 0, ins->sreg1); + break; + case OP_ARGLIST: { + long cookie_offset = cfg->sig_cookie + cfg->stack_usage; diff --git a/runtime-77270-ppc64le-fsharp-crash.patch b/runtime-77270-ppc64le-fsharp-crash.patch new file mode 100644 index 0000000..e135b8b --- /dev/null +++ b/runtime-77270-ppc64le-fsharp-crash.patch @@ -0,0 +1,56 @@ +From 14749457ff716cebd043b4e41aad622f9ac89586 Mon Sep 17 00:00:00 2001 +From: Alhad Deshpande +Date: Wed, 19 Oct 2022 06:29:54 +0000 +Subject: [PATCH] Fixed FSharp crash issue + +--- + src/mono/mono/mini/mini-ppc.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/runtime/src/mono/mono/mini/mini-ppc.c b/src/runtime/src/mono/mono/mini/mini-ppc.c +index bc97b497af93a..3df60c6a925f6 100644 +--- a/src/runtime/src/mono/mono/mini/mini-ppc.c ++++ b/src/runtime/src/mono/mono/mini/mini-ppc.c +@@ -3782,23 +3782,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) + ppc_addis (code, ppc_r12, cfg->frame_reg, ppc_ha(cfg->stack_usage)); + ppc_addi (code, ppc_r12, ppc_r12, cfg->stack_usage); + } +- if (!cfg->method->save_lmf) { +- pos = 0; +- for (i = 31; i >= 13; --i) { +- if (cfg->used_int_regs & (1 << i)) { +- pos += sizeof (target_mgreg_t); +- ppc_ldptr (code, i, -pos, ppc_r12); +- } +- } +- } else { +- /* FIXME restore from MonoLMF: though this can't happen yet */ +- } + + /* Copy arguments on the stack to our argument area */ + if (call->stack_usage) { + code = emit_memcpy (code, call->stack_usage, ppc_r12, PPC_STACK_PARAM_OFFSET, ppc_sp, PPC_STACK_PARAM_OFFSET); + /* r12 was clobbered */ +- g_assert (cfg->frame_reg == ppc_sp); + if (ppc_is_imm16 (cfg->stack_usage)) { + ppc_addi (code, ppc_r12, cfg->frame_reg, cfg->stack_usage); + } else { +@@ -3809,6 +3797,18 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) + } + } + ++ if (!cfg->method->save_lmf) { ++ pos = 0; ++ for (i = 31; i >= 13; --i) { ++ if (cfg->used_int_regs & (1 << i)) { ++ pos += sizeof (target_mgreg_t); ++ ppc_ldptr (code, i, -pos, ppc_r12); ++ } ++ } ++ } else { ++ /* FIXME restore from MonoLMF: though this can't happen yet */ ++ } ++ + ppc_mr (code, ppc_sp, ppc_r12); + mono_add_patch_info (cfg, (guint8*) code - cfg->native_code, MONO_PATCH_INFO_METHOD_JUMP, call->method); + cfg->thunk_area += THUNK_SIZE; diff --git a/runtime-77308-ppc64le-delegate.patch b/runtime-77308-ppc64le-delegate.patch new file mode 100644 index 0000000..4c5464a --- /dev/null +++ b/runtime-77308-ppc64le-delegate.patch @@ -0,0 +1,60 @@ +diff --git a/src/runtime/src/mono/mono/mini/mini-ppc.c b/src/runtime/src/mono/mono/mini/mini-ppc.c +index db669f8b5da0f..73a26c02b18aa 100644 +--- a/src/runtime/src/mono/mono/mini/mini-ppc.c ++++ b/src/runtime/src/mono/mono/mini/mini-ppc.c +@@ -470,10 +470,54 @@ mono_arch_get_delegate_invoke_impl (MonoMethodSignature *sig, gboolean has_targe + return start; + } + ++/** ++ * ++ * @brief Architecture-specific delegation virtual trampoline processing ++ * ++ * @param[in] @sig - Method signature ++ * @param[in] @method - Method ++ * @param[in] @offset - Offset into vtable ++ * @param[in] @load_imt_reg - Whether to load the LMT register ++ * @returns Trampoline ++ * ++ * Return a pointer to a delegation virtual trampoline ++ */ ++ + gpointer + mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg) + { +- return NULL; ++ guint8 *code, *start; ++ int size = 32; ++ ++ start = code = (guint8 *) mono_global_codeman_reserve (size); ++ ++ /* ++ * Replace the "this" argument with the target ++ */ ++ ppc_mr (code, ppc_r12, ppc_r3); ++ ppc_ldptr (code, ppc_r3, MONO_STRUCT_OFFSET(MonoDelegate, target), ppc_r12); ++ ++ /* ++ * Load the IMT register, if needed ++ */ ++ if (load_imt_reg) { ++ ppc_ldptr (code, MONO_ARCH_IMT_REG, MONO_STRUCT_OFFSET(MonoDelegate, method), ppc_r12); ++ } ++ ++ /* ++ * Load the vTable ++ */ ++ ppc_ldptr (code, ppc_r12, MONO_STRUCT_OFFSET(MonoObject, vtable), ppc_r3); ++ if (!ppc_is_imm16(offset)) ++ ppc_addis (code, ppc_r12, ppc_r12, ppc_ha(offset)); ++ ppc_ldptr (code, ppc_r12, offset, ppc_r12); ++ ppc_mtctr (code, ppc_r12); ++ ppc_bcctr (code, PPC_BR_ALWAYS, 0); ++ ++ mono_arch_flush_icache (start, code - start); ++ MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL)); ++ ++ return(start); + } + + gpointer diff --git a/runtime-mono-ppc64le-clang15.patch b/runtime-mono-ppc64le-clang15.patch new file mode 100644 index 0000000..32bf3f9 --- /dev/null +++ b/runtime-mono-ppc64le-clang15.patch @@ -0,0 +1,39 @@ +diff --git a/src/runtime/src/mono/mono/mini/mini-ppc.c b/src/runtime/src/mono/mono/mini/mini-ppc.c +index bc97b497af9..cc5e5ccc0e6 100644 +--- a/src/runtime/src/mono/mono/mini/mini-ppc.c ++++ b/src/runtime/src/mono/mono/mini/mini-ppc.c +@@ -2733,7 +2733,7 @@ handle_thunk (MonoCompile *cfg, guchar *code, const guchar *target) + cfg->arch.thunks = cfg->thunks; + cfg->arch.thunks_size = cfg->thunk_area; + #ifdef THUNK_ADDR_ALIGNMENT +- cfg->arch.thunks = ALIGN_TO(cfg->arch.thunks, THUNK_ADDR_ALIGNMENT); ++ cfg->arch.thunks = (guint8 *)ALIGN_TO(cfg->arch.thunks, THUNK_ADDR_ALIGNMENT); + #endif + } + thunks = cfg->arch.thunks; +@@ -5886,7 +5886,7 @@ host_mgreg_t* + mono_arch_context_get_int_reg_address (MonoContext *ctx, int reg) + { + if (reg == ppc_r1) +- return (host_mgreg_t)(gsize)MONO_CONTEXT_GET_SP (ctx); ++ return (host_mgreg_t *)(gsize)&ctx->sc_sp; + + return &ctx->regs [reg]; + } +diff --git a/src/runtime/src/mono/mono/mini/tramp-ppc.c b/src/runtime/src/mono/mono/mini/tramp-ppc.c +index 59bcb275a48..e0bc7f8eca4 100644 +--- a/src/runtime/src/mono/mono/mini/tramp-ppc.c ++++ b/src/runtime/src/mono/mono/mini/tramp-ppc.c +@@ -672,10 +672,10 @@ mono_arch_get_call_target (guint8 *code) + } + #if defined(TARGET_POWERPC64) && !defined(PPC_USES_FUNCTION_DESCRIPTOR) + else if (((guint32*)(code - 32)) [0] >> 26 == 15) { +- guint8 *thunk = GET_MEMORY_SLOT_THUNK_ADDRESS((guint32*)(code - 32)); ++ guint8 *thunk = (guint8 *)GET_MEMORY_SLOT_THUNK_ADDRESS((guint32*)(code - 32)); + return thunk; + } else if (((guint32*)(code - 4)) [0] >> 26 == 15) { +- guint8 *thunk = GET_MEMORY_SLOT_THUNK_ADDRESS((guint32*)(code - 4)); ++ guint8 *thunk = (guint8 *)GET_MEMORY_SLOT_THUNK_ADDRESS((guint32*)(code - 4)); + return thunk; + } + #endif diff --git a/tests/.fmf/version b/tests/.fmf/version new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tests/.fmf/version @@ -0,0 +1 @@ +2 diff --git a/tests/provision.fmf b/tests/provision.fmf new file mode 100644 index 0000000..87b3807 --- /dev/null +++ b/tests/provision.fmf @@ -0,0 +1,6 @@ +--- + +standard-inventory-qcow2: + qemu: + m: 5G + diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..b1facd8 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,39 @@ +--- +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + - container + - atomic + repositories: + - repo: "https://github.com/redhat-developer/dotnet-regular-tests.git" + dest: "dotnet-regular-tests" + version: main + tests: + - download_test_runner: + dir: ./ + run: wget --no-verbose https://github.com/redhat-developer/dotnet-bunny/releases/latest/download/turkey.tar.gz && tar xf turkey.tar.gz + - print_test_runner_version: + dir: ./ + run: dotnet turkey/Turkey.dll --version + - regular: + dir: ./ + run: dotnet turkey/Turkey.dll -l={{ remote_artifacts }} dotnet-regular-tests + required_packages: + - aspnetcore-runtime-7.0 + - babeltrace + - bash-completion + - binutils + - dotnet-sdk-7.0 + - dotnet-runtime-7.0 + - expect + - git + - jq + - lldb + - lttng-tools + - npm + - python3 + - strace + - wget + - which diff --git a/update-release b/update-release new file mode 100755 index 0000000..54c7307 --- /dev/null +++ b/update-release @@ -0,0 +1,112 @@ +#!/bin/bash + +# Usage: +# ./update-release sdk-version runtime-version [--bug bug-id] [--tarball tarball-name] [--larger-rpm-release] + +set -euo pipefail +IFS=$'\n\t' + +print_usage() { + echo " Usage:" + echo " ./update-release sdk-version runtime-version [--bug bug-id] [--tarball tarball-name] [--larger-rpm-release]" +} + +user_provided_tarball_name="" + +rpm_release=1 +positional_args=() +bug_ids=() +while [[ "$#" -gt 0 ]]; do + arg="$1" + case "${arg}" in + --bug) + bug_ids+=("$2") + shift; + shift; + ;; + -h|--help) + print_usage + exit 0 + ;; + --tarball) + user_provided_tarball_name="$2" + shift; + shift; + ;; + --larger-rpm-release) + rpm_release="2" + shift; + ;; + *) + positional_args+=("$1") + shift + ;; + esac +done + +spec_files=( ./*.spec ) +spec_file="${spec_files[0]}" + +sdk_version=${positional_args[0]:-} +if [[ -z ${sdk_version} ]]; then + echo "error: missing sdk version" + exit 1 +fi + +runtime_version=${positional_args[1]:-} +if [[ -z ${runtime_version} ]]; then + echo "error: missing runtime version" + exit 1 +fi + +host_version="$runtime_version" + +if [[ "$runtime_version" == "3.1"* ]]; then + tag=v${sdk_version}-SDK +else + tag=v${sdk_version} +fi + +if [[ -f "dotnet-${tag}-original.tar.gz" ]]; then + echo "dotnet-${tag}-original.tar.gz alredy exists, not rebuilding tarball" +else + if [[ -n "${user_provided_tarball_name}" ]]; then + ./rename-tarball "$user_provided_tarball_name" "dotnet-${tag}-original.tar.gz" + elif [[ -f "dotnet-${sdk_version}-SDK.tar.gz" ]]; then + ./rename-tarball "dotnet-${sdk_version}-SDK.tar.gz" "dotnet-${tag}-original.tar.gz" + elif [[ -f "dotnet-${sdk_version}.tar.gz" ]]; then + ./rename-tarball "dotnet-${sdk_version}.tar.gz" "dotnet-${tag}-original.tar.gz" + elif [[ -f "dotnet-${runtime_version}.tar.gz" ]]; then + ./rename-tarball "dotnet-${runtime_version}.tar.gz" "dotnet-${tag}-original.tar.gz" + fi +fi + +if [[ ! -f "dotnet-${tag}.tar.gz" ]]; then + ./build-dotnet-tarball "${tag}" +fi + +set -x + +sed -i -E "s|^%global host_version [[:digit:]]\.[[:digit:]]\.[[:digit:]]+|%global host_version ${host_version}|" "$spec_file" +sed -i -E "s|^%global runtime_version [[:digit:]]\.[[:digit:]]\.[[:digit:]]+|%global runtime_version ${runtime_version}|" "$spec_file" +sed -i -E "s|^%global sdk_version [[:digit:]]\.[[:digit:]]\.[[:digit:]][[:digit:]][[:digit:]]|%global sdk_version ${sdk_version}|" "$spec_file" + +comment="Update to .NET SDK ${sdk_version} and Runtime ${runtime_version}" +commit_message="$comment +" +for bug_id in "${bug_ids[@]}"; do + comment="$comment +- Resolves: RHBZ#$bug_id" + commit_message="$commit_message +Resolves: RHBZ#$bug_id" +done + +echo "$commit_message" > git-commit-message + +rpmdev-bumpspec --comment="$comment" "$spec_file" + +# Reset release in 'Release' tag +sed -i -E 's|^Release: [[:digit:]]+%|Release: '"$rpm_release"'%|' "$spec_file" +# Reset Release in changelog comment +# See https://stackoverflow.com/questions/18620153/find-matching-text-and-replace-next-line +sed -i -E '/^%changelog$/!b;n;s/-[[:digit:]]+$/-'"$rpm_release"'/' "$spec_file" diff --git a/vstest-4028-ppc64le.patch b/vstest-4028-ppc64le.patch new file mode 100644 index 0000000..ee31759 --- /dev/null +++ b/vstest-4028-ppc64le.patch @@ -0,0 +1,294 @@ +From 96591cb1ac589021b9f31854a13f8fe3dd565f25 Mon Sep 17 00:00:00 2001 +From: Sapana Khemkar +Date: Tue, 27 Sep 2022 13:08:43 +0530 +Subject: [PATCH 1/4] add support for ppc64le processor architecture + +--- + src/Microsoft.TestPlatform.ObjectModel/Architecture.cs | 3 ++- + .../Interfaces/System/PlatformArchitecture.cs | 1 + + .../netcore/System/PlatformEnvironment.cs | 1 + + .../netcore/System/ProcessHelper.cs | 1 + + .../Hosting/DefaultTestHostManager.cs | 1 + + src/vstest.console/TestPlatformHelpers/TestRequestManager.cs | 2 ++ + .../Processors/PlatformArgumentProcessorTests.cs | 4 ++-- + 7 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Architecture.cs b/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Architecture.cs +index 6c9b9bcde5..7879358840 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Architecture.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Architecture.cs +@@ -11,5 +11,6 @@ public enum Architecture + ARM, + AnyCPU, + ARM64, +- S390x ++ S390x, ++ PPC64le + } +diff --git a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/PlatformArchitecture.cs b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/PlatformArchitecture.cs +index b1d477c7d3..aa81ca0ffc 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/PlatformArchitecture.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/PlatformArchitecture.cs +@@ -13,4 +13,5 @@ public enum PlatformArchitecture + ARM, + ARM64, + S390x, ++ PPC64le, + } +diff --git a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/PlatformEnvironment.cs b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/PlatformEnvironment.cs +index 10d4a61570..14d1234ef6 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/PlatformEnvironment.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/PlatformEnvironment.cs +@@ -28,6 +28,7 @@ public PlatformArchitecture Architecture + // preview 6 or later, so use the numerical value for now. + // case System.Runtime.InteropServices.Architecture.S390x: + (Architecture)5 => PlatformArchitecture.S390x, ++ (Architecture)6 => PlatformArchitecture.PPC64le, + _ => throw new NotSupportedException(), + }; + } +diff --git a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs +index 6cf4b0f91b..d1e31bb0f6 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs +@@ -41,6 +41,7 @@ public PlatformArchitecture GetCurrentProcessArchitecture() + // preview 6 or later, so use the numerical value for now. + // case System.Runtime.InteropServices.Architecture.S390x: + (Architecture)5 => PlatformArchitecture.S390x, ++ (Architecture)6 => PlatformArchitecture.PPC64le, + _ => throw new NotSupportedException(), + }; + } +diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs +index 2eca302b43..54fa36e344 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs +@@ -274,6 +274,7 @@ private static string GetTestHostName(Architecture architecture, Framework targe + PlatformArchitecture.ARM => Architecture.ARM, + PlatformArchitecture.ARM64 => Architecture.ARM64, + PlatformArchitecture.S390x => Architecture.S390x, ++ PlatformArchitecture.PPC64le => Architecture.PPC64le, + _ => throw new NotSupportedException(), + }; + +diff --git a/src/vstest/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs b/src/vstest/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs +index 642e36bb9e..c7a0f93927 100644 +--- a/src/vstest/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs ++++ b/src/vstest/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs +@@ -841,6 +841,8 @@ static Architecture TranslateToArchitecture(PlatformArchitecture targetArchitect + return Architecture.ARM64; + case PlatformArchitecture.S390x: + return Architecture.S390x; ++ case PlatformArchitecture.PPC64le: ++ return Architecture.PPC64le; + default: + EqtTrace.Error($"TestRequestManager.TranslateToArchitecture: Unhandled architecture '{targetArchitecture}'."); + break; +diff --git a/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs b/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs +index 207e4590fd..472688248d 100644 +--- a/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs ++++ b/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs +@@ -85,7 +85,7 @@ public void InitializeShouldThrowIfArgumentIsNotAnArchitecture() + { + ExceptionUtilities.ThrowsException( + () => _executor.Initialize("foo"), +- "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x.", ++ "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, PPC64le.", + "foo"); + } + +@@ -94,7 +94,7 @@ public void InitializeShouldThrowIfArgumentIsNotASupportedArchitecture() + { + ExceptionUtilities.ThrowsException( + () => _executor.Initialize("AnyCPU"), +- "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x.", ++ "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, PPC64le.", + "AnyCPU"); + } + + +From 750b193e964a446dad5fc5927b745861eb19a9a9 Mon Sep 17 00:00:00 2001 +From: Sapana Khemkar +Date: Wed, 28 Sep 2022 11:06:08 +0530 +Subject: [PATCH 2/4] change enum name from PPC64le to Ppc64le to match with + System.Runtime.InteropServices.Architecture enum name + +--- + src/Microsoft.TestPlatform.ObjectModel/Architecture.cs | 2 +- + .../Interfaces/System/PlatformArchitecture.cs | 2 +- + .../netcore/System/PlatformEnvironment.cs | 2 +- + .../netcore/System/ProcessHelper.cs | 2 +- + .../Hosting/DefaultTestHostManager.cs | 2 +- + src/vstest.console/TestPlatformHelpers/TestRequestManager.cs | 4 ++-- + .../Processors/PlatformArgumentProcessorTests.cs | 4 ++-- + 7 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Architecture.cs b/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Architecture.cs +index 7879358840..f3d59e7ae4 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Architecture.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Architecture.cs +@@ -12,5 +12,5 @@ public enum Architecture + AnyCPU, + ARM64, + S390x, +- PPC64le ++ Ppc64le + } +diff --git a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/PlatformArchitecture.cs b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/PlatformArchitecture.cs +index aa81ca0ffc..907ec721dd 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/PlatformArchitecture.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/PlatformArchitecture.cs +@@ -13,5 +13,5 @@ public enum PlatformArchitecture + ARM, + ARM64, + S390x, +- PPC64le, ++ Ppc64le, + } +diff --git a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/PlatformEnvironment.cs b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/PlatformEnvironment.cs +index 14d1234ef6..f2163db898 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/PlatformEnvironment.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/PlatformEnvironment.cs +@@ -28,7 +28,7 @@ public PlatformArchitecture Architecture + // preview 6 or later, so use the numerical value for now. + // case System.Runtime.InteropServices.Architecture.S390x: + (Architecture)5 => PlatformArchitecture.S390x, +- (Architecture)6 => PlatformArchitecture.PPC64le, ++ (Architecture)8 => PlatformArchitecture.Ppc64le, + _ => throw new NotSupportedException(), + }; + } +diff --git a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs +index d1e31bb0f6..d2d048e355 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs +@@ -41,7 +41,7 @@ public PlatformArchitecture GetCurrentProcessArchitecture() + // preview 6 or later, so use the numerical value for now. + // case System.Runtime.InteropServices.Architecture.S390x: + (Architecture)5 => PlatformArchitecture.S390x, +- (Architecture)6 => PlatformArchitecture.PPC64le, ++ (Architecture)8 => PlatformArchitecture.Ppc64le, + _ => throw new NotSupportedException(), + }; + } +diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs +index 54fa36e344..02001d23ab 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs +@@ -274,7 +274,7 @@ private static string GetTestHostName(Architecture architecture, Framework targe + PlatformArchitecture.ARM => Architecture.ARM, + PlatformArchitecture.ARM64 => Architecture.ARM64, + PlatformArchitecture.S390x => Architecture.S390x, +- PlatformArchitecture.PPC64le => Architecture.PPC64le, ++ PlatformArchitecture.Ppc64le => Architecture.Ppc64le, + _ => throw new NotSupportedException(), + }; + +diff --git a/src/vstest/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs b/src/vstest/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs +index c7a0f93927..25cca0ca07 100644 +--- a/src/vstest/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs ++++ b/src/vstest/src/vstest.console/TestPlatformHelpers/TestRequestManager.cs +@@ -841,8 +841,8 @@ static Architecture TranslateToArchitecture(PlatformArchitecture targetArchitect + return Architecture.ARM64; + case PlatformArchitecture.S390x: + return Architecture.S390x; +- case PlatformArchitecture.PPC64le: +- return Architecture.PPC64le; ++ case PlatformArchitecture.Ppc64le: ++ return Architecture.Ppc64le; + default: + EqtTrace.Error($"TestRequestManager.TranslateToArchitecture: Unhandled architecture '{targetArchitecture}'."); + break; +diff --git a/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs b/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs +index 472688248d..f33166ae6c 100644 +--- a/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs ++++ b/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs +@@ -85,7 +85,7 @@ public void InitializeShouldThrowIfArgumentIsNotAnArchitecture() + { + ExceptionUtilities.ThrowsException( + () => _executor.Initialize("foo"), +- "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, PPC64le.", ++ "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, ppc64le.", + "foo"); + } + +@@ -94,7 +94,7 @@ public void InitializeShouldThrowIfArgumentIsNotASupportedArchitecture() + { + ExceptionUtilities.ThrowsException( + () => _executor.Initialize("AnyCPU"), +- "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, PPC64le.", ++ "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, ppc64le.", + "AnyCPU"); + } + + +From 4d97db82c39caf0aa6ca7bd3f47f1c3714aa6f2c Mon Sep 17 00:00:00 2001 +From: Sapana Khemkar +Date: Wed, 28 Sep 2022 17:58:27 +0530 +Subject: [PATCH 3/4] add defination of enum + Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.Ppc64le + and Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.Ppc64le in + Microsoft.TestPlatform.ObjectModel and + /Microsoft.TestPlatform.PlatformAbstractions PublicAPI.Shipped.txt file. + +--- + .../PublicAPI/PublicAPI.Shipped.txt | 1 + + .../PublicAPI/PublicAPI.Shipped.txt | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/vstest/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/PublicAPI.Shipped.txt b/src/vstest/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/PublicAPI.Shipped.txt +index 9df7e09b00..5d69e70774 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/PublicAPI.Shipped.txt ++++ b/src/vstest/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/PublicAPI.Shipped.txt +@@ -113,6 +113,7 @@ Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.ARM = 3 -> Microsof + Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.ARM64 = 5 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture + Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.Default = 0 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture + Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.S390x = 6 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture ++Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.Ppc64le = 7 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture + Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.X64 = 2 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture + Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.X86 = 1 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture + Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet +diff --git a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/PublicAPI.Shipped.txt b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/PublicAPI.Shipped.txt +index 696ed76517..8f0f763f94 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/PublicAPI.Shipped.txt ++++ b/src/vstest/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/PublicAPI.Shipped.txt +@@ -67,6 +67,7 @@ Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture + Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.ARM = 2 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture + Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.ARM64 = 3 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture + Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.S390x = 4 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture ++Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.Ppc64le = 5 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture + Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.X64 = 1 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture + Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.X86 = 0 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture + Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformAssemblyExtensions + +From 389b923569be952cfa6875af209e70d9490bfd73 Mon Sep 17 00:00:00 2001 +From: Sapana Khemkar +Date: Wed, 28 Sep 2022 19:45:55 +0530 +Subject: [PATCH 4/4] corrected typo in ppc64le arch name + +--- + .../Processors/PlatformArgumentProcessorTests.cs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs b/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs +index f33166ae6c..b452b48408 100644 +--- a/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs ++++ b/src/vstest/test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs +@@ -85,7 +85,7 @@ public void InitializeShouldThrowIfArgumentIsNotAnArchitecture() + { + ExceptionUtilities.ThrowsException( + () => _executor.Initialize("foo"), +- "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, ppc64le.", ++ "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, Ppc64le.", + "foo"); + } + +@@ -94,7 +94,7 @@ public void InitializeShouldThrowIfArgumentIsNotASupportedArchitecture() + { + ExceptionUtilities.ThrowsException( + () => _executor.Initialize("AnyCPU"), +- "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, ppc64le.", ++ "Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, Ppc64le.", + "AnyCPU"); + } + diff --git a/vstest-4066-s390x-ppc64le.patch b/vstest-4066-s390x-ppc64le.patch new file mode 100644 index 0000000..642beb6 --- /dev/null +++ b/vstest-4066-s390x-ppc64le.patch @@ -0,0 +1,37 @@ +From 7ea33be2e1949d9c63ff58b59deb5b1a84105aae Mon Sep 17 00:00:00 2001 +From: Giridhar Trivedi +Date: Wed, 12 Oct 2022 14:14:40 +0200 +Subject: [PATCH] Fix Invalid target architecture 'S390x' error + +In commit 3ae5c4aef823 ("Add support for s390x processor architecture") +support for S390x architecture was provided for .NET6. This is broken +in .NET7. Add missing case statements to fix this for S390x and also +Power architectures. +--- + .../Hosting/DotnetTestHostManager.cs | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs +index b4fa53776f..deadfcb684 100644 +--- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs ++++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs +@@ -536,6 +536,10 @@ PlatformArchitecture TranslateToPlatformArchitecture(Architecture targetArchitec + return PlatformArchitecture.ARM; + case Architecture.ARM64: + return PlatformArchitecture.ARM64; ++ case Architecture.S390x: ++ return PlatformArchitecture.S390x; ++ case Architecture.Ppc64le: ++ return PlatformArchitecture.Ppc64le; + case Architecture.AnyCPU: + case Architecture.Default: + default: +@@ -552,6 +556,8 @@ static bool IsSameArchitecture(Architecture targetArchitecture, PlatformArchitec + Architecture.X64 => platformAchitecture == PlatformArchitecture.X64, + Architecture.ARM => platformAchitecture == PlatformArchitecture.ARM, + Architecture.ARM64 => platformAchitecture == PlatformArchitecture.ARM64, ++ Architecture.S390x => platformAchitecture == PlatformArchitecture.S390x, ++ Architecture.Ppc64le => platformAchitecture == PlatformArchitecture.Ppc64le, + _ => throw new TestPlatformException($"Invalid target architecture '{targetArchitecture}'"), + }; +