Iniitial update to .NET 5.0
This commit is contained in:
parent
2236128d3e
commit
ccec65f6fa
12
README.md
12
README.md
@ -1,6 +1,6 @@
|
|||||||
# Overview
|
# Overview
|
||||||
|
|
||||||
This is the .NET Core 3.1 package for Fedora.
|
This is the .NET Core 5.0 package for Fedora.
|
||||||
|
|
||||||
This package is maintained by the Fedora DotNet SIG (Special Interest
|
This package is maintained by the Fedora DotNet SIG (Special Interest
|
||||||
Group). You can find out more about the DotNet SIG at:
|
Group). You can find out more about the DotNet SIG at:
|
||||||
@ -10,7 +10,7 @@ Group). You can find out more about the DotNet SIG at:
|
|||||||
- https://lists.fedoraproject.org/archives/list/dotnet-sig@lists.fedoraproject.org/
|
- https://lists.fedoraproject.org/archives/list/dotnet-sig@lists.fedoraproject.org/
|
||||||
|
|
||||||
Please report any issues [using
|
Please report any issues [using
|
||||||
bugzilla](https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=dotnet3.1).
|
bugzilla](https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=dotnet5.0).
|
||||||
|
|
||||||
# Specification
|
# Specification
|
||||||
|
|
||||||
@ -27,8 +27,8 @@ with one exception. It installs dotnet to `/usr/lib64/dotnet` (aka
|
|||||||
|
|
||||||
2. Checkout the forked repository.
|
2. Checkout the forked repository.
|
||||||
|
|
||||||
- `git clone ssh://$USER@pkgs.fedoraproject.org/forks/$USER/rpms/dotnet3.1.git`
|
- `git clone ssh://$USER@pkgs.fedoraproject.org/forks/$USER/rpms/dotnet5.0.git`
|
||||||
- `cd dotnet3.1`
|
- `cd dotnet5.0`
|
||||||
|
|
||||||
3. Make your changes. Don't forget to add a changelog.
|
3. Make your changes. Don't forget to add a changelog.
|
||||||
|
|
||||||
@ -71,8 +71,8 @@ with one exception. It installs dotnet to `/usr/lib64/dotnet` (aka
|
|||||||
|
|
||||||
2. Checkout the forked repository.
|
2. Checkout the forked repository.
|
||||||
|
|
||||||
- `git clone ssh://$USER@pkgs.fedoraproject.org/forks/$USER/rpms/dotnet3.1.git`
|
- `git clone ssh://$USER@pkgs.fedoraproject.org/forks/$USER/rpms/dotnet5.0.git`
|
||||||
- `cd dotnet3.1`
|
- `cd dotnet5.0`
|
||||||
|
|
||||||
3. Build the new upstream source tarball. Update the versions in the
|
3. Build the new upstream source tarball. Update the versions in the
|
||||||
spec file. Add a changelog. This is generally automated by the
|
spec file. Add a changelog. This is generally automated by the
|
||||||
|
50
build-bootstrap-tarball
Executable file
50
build-bootstrap-tarball
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
sdk_version=3.1.105
|
||||||
|
|
||||||
|
arch=$(uname -m)
|
||||||
|
if [[ $arch == "x86_64" ]]; then
|
||||||
|
arch=x64
|
||||||
|
elif [[ $arch == "aarch64" ]]; then
|
||||||
|
arch=arm64
|
||||||
|
fi
|
||||||
|
|
||||||
|
if rpm -qa | grep libunwind; then
|
||||||
|
echo "error: libunwind is installed. Not a good idea for bootstrapping."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
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
|
||||||
|
|
||||||
|
if [ ! -d dotnet-source-build-tarball ]; then
|
||||||
|
if [ ! -d source-build ]; then
|
||||||
|
git clone https://github.com/dotnet/source-build
|
||||||
|
fi
|
||||||
|
pushd source-build
|
||||||
|
sed -i -e 's|cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE||' repos/coreclr.common.props
|
||||||
|
git clean -xdf
|
||||||
|
./build-source-tarball.sh ../dotnet-source-build-tarball/ -- -p:DownloadSourceBuildReferencePackagesTimeoutSeconds=100000
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf dotnet-v${sdk_version}-SDK dotnet-v${sdk_version}-SDK.tar.gz
|
||||||
|
|
||||||
|
cp -a dotnet-source-build-tarball dotnet-v${sdk_version}-SDK
|
||||||
|
cp -a source-build/artifacts/$arch/Release/Private.SourceBuilt.Artifacts.*.tar.gz dotnet-v${sdk_version}-SDK/packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz
|
||||||
|
|
||||||
|
tar czf dotnet-v${sdk_version}-SDK-$arch.tar.gz dotnet-v${sdk_version}-SDK
|
||||||
|
|
@ -1,54 +0,0 @@
|
|||||||
diff --git a/configurecompiler.cmake b/configurecompiler.cmake
|
|
||||||
index d769e82f57..4936c8b00d 100644
|
|
||||||
--- a/configurecompiler.cmake
|
|
||||||
+++ b/configurecompiler.cmake
|
|
||||||
@@ -474,6 +474,7 @@ if (CLR_CMAKE_PLATFORM_UNIX)
|
|
||||||
add_compile_options(-Wno-unused-variable)
|
|
||||||
add_compile_options(-Wno-unused-value)
|
|
||||||
add_compile_options(-Wno-unused-function)
|
|
||||||
+ add_compile_options(-Wno-error=misleading-indentation)
|
|
||||||
|
|
||||||
#These seem to indicate real issues
|
|
||||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-invalid-offsetof>)
|
|
||||||
diff --git a/src/inc/slist.h b/src/inc/slist.h
|
|
||||||
index f05d763dc6..abebe04d47 100644
|
|
||||||
--- a/src/inc/slist.h
|
|
||||||
+++ b/src/inc/slist.h
|
|
||||||
@@ -160,13 +160,13 @@ public:
|
|
||||||
void Init()
|
|
||||||
{
|
|
||||||
LIMITED_METHOD_CONTRACT;
|
|
||||||
- m_pHead = &m_link;
|
|
||||||
+ m_pHead = PTR_SLink(&m_link);
|
|
||||||
// NOTE :: fHead variable is template argument
|
|
||||||
// the following code is a compiled in, only if the fHead flag
|
|
||||||
// is set to false,
|
|
||||||
if (!fHead)
|
|
||||||
{
|
|
||||||
- m_pTail = &m_link;
|
|
||||||
+ m_pTail = PTR_SLink(&m_link);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ public:
|
|
||||||
SLink *ret = SLink::FindAndRemove(m_pHead, GetLink(pObj), &prior);
|
|
||||||
|
|
||||||
if (ret == m_pTail)
|
|
||||||
- m_pTail = prior;
|
|
||||||
+ m_pTail = PTR_SLink(prior);
|
|
||||||
|
|
||||||
return GetObject(ret);
|
|
||||||
}
|
|
||||||
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
|
|
||||||
index 08a35c8f62..43eb648a14 100644
|
|
||||||
--- a/src/pal/inc/pal.h
|
|
||||||
+++ b/src/pal/inc/pal.h
|
|
||||||
@@ -145,7 +145,7 @@ typedef PVOID NATIVE_LIBRARY_HANDLE;
|
|
||||||
|
|
||||||
/******************* Compiler-specific glue *******************************/
|
|
||||||
#ifndef THROW_DECL
|
|
||||||
-#if defined(_MSC_VER) || defined(__llvm__) || !defined(__cplusplus)
|
|
||||||
+#if defined(_MSC_VER) || !defined(__cplusplus)
|
|
||||||
#define THROW_DECL
|
|
||||||
#else
|
|
||||||
#define THROW_DECL throw()
|
|
@ -91,14 +91,10 @@ if [ ! -f "${unmodified_tarball_name}.tar.gz" ]; then
|
|||||||
git checkout "${tag}"
|
git checkout "${tag}"
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
clean_dotnet_cache
|
clean_dotnet_cache
|
||||||
sed -i -e 's|cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE||' repos/coreclr.proj
|
sed -i -e 's|cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE||' repos/runtime.common.props
|
||||||
mkdir -p patches/coreclr/
|
# FIXME remove contineuonprebuilterror
|
||||||
cp ../../build-coreclr-clang10.patch patches/coreclr
|
./build.sh -p:SkipPrebuiltEnforcement=true -p:ContinueOnPrebuiltBaselineError=true -p:ArchiveDownloadedPackages=true
|
||||||
mkdir -p patches/corefx/
|
./build-source-tarball.sh "${unmodified_tarball_name}" --skip-build -- -p:ContinueOnPrebuiltBaselineError=true -p:SkipPrebuiltEnforcement=true
|
||||||
cp ../../corefx-42900-clang-10.patch patches/corefx
|
|
||||||
cp -r /usr/lib64/dotnet "${temp_dir}"
|
|
||||||
./build.sh --with-sdk ../dotnet /p:ArchiveDownloadedPackages=true
|
|
||||||
./build-source-tarball.sh "${unmodified_tarball_name}" --skip-build --with-sdk ../dotnet
|
|
||||||
popd
|
popd
|
||||||
popd
|
popd
|
||||||
|
|
||||||
@ -114,11 +110,12 @@ mv "${unmodified_tarball_name}" "${tarball_name}"
|
|||||||
pushd "${tarball_name}"
|
pushd "${tarball_name}"
|
||||||
# Remove files with funny licenses, crypto implementations and other
|
# Remove files with funny licenses, crypto implementations and other
|
||||||
# not-very-useful artifacts to reduce tarball size
|
# not-very-useful artifacts to reduce tarball size
|
||||||
|
rm -rf .dotnet
|
||||||
find -type f -iname '*.tar.gz' -delete
|
find -type f -iname '*.tar.gz' -delete
|
||||||
rm -r src/aspnetcore.*/src/SignalR/clients/java/signalr/gradle*
|
rm -r src/AspNetCore.*/src/SignalR/clients/java/signalr/gradle*
|
||||||
find src/aspnetcore.*/src -type d -name samples -print0 | xargs -0 rm -r
|
find src/AspNetCore.*/src -type d -name samples -print0 | xargs -0 rm -r
|
||||||
rm -r src/NuGet.Client.*/test/EndToEnd/ProjectTemplates/NetCoreWebApplication1.0.zip
|
rm -r src/NuGet.Client.*/test/EndToEnd/ProjectTemplates/NetCoreWebApplication1.0.zip
|
||||||
find src/coreclr.*/ -depth -name tests -print0 | xargs -0 rm -r
|
find src/runtime.*/ -depth -name tests -print0 | xargs -0 rm -r
|
||||||
popd
|
popd
|
||||||
|
|
||||||
tar czf "${tarball_name}.tar.gz" "${tarball_name}"
|
tar czf "${tarball_name}.tar.gz" "${tarball_name}"
|
||||||
|
11
copr-build
Executable file
11
copr-build
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
fedpkg --release f32 srpm 2>&1 | tee fedpkg.output
|
||||||
|
|
||||||
|
srpm_name=$(grep 'Wrote: ' fedpkg.output | cut -d' ' -f 2)
|
||||||
|
|
||||||
|
copr-cli build @dotnet-sig/dotnet-preview "${srpm_name}"
|
@ -1,11 +0,0 @@
|
|||||||
diff --git a/src/settings.cmake b/src/settings.cmake
|
|
||||||
--- a/src/settings.cmake
|
|
||||||
+++ b/src/settings.cmake
|
|
||||||
@@ -218,6 +218,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id=sha1")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id=sha1")
|
|
||||||
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
|
|
||||||
add_compile_options(-fstack-protector-strong)
|
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
||||||
add_compile_options(-fstack-protector)
|
|
@ -1,11 +0,0 @@
|
|||||||
diff --git a/src/debug/createdump/CMakeLists.txt b/src/debug/createdump/CMakeLists.txt
|
|
||||||
--- a/src/debug/createdump/CMakeLists.txt
|
|
||||||
+++ b/src/debug/createdump/CMakeLists.txt
|
|
||||||
@@ -21,6 +21,7 @@ include_directories(BEFORE ${VM_DIR})
|
|
||||||
add_definitions(-DPAL_STDCPP_COMPAT)
|
|
||||||
|
|
||||||
add_compile_options(-fPIE)
|
|
||||||
+add_link_options(-pie)
|
|
||||||
|
|
||||||
set(CREATEDUMP_SOURCES
|
|
||||||
createdump.cpp
|
|
@ -1,46 +0,0 @@
|
|||||||
From 1864630f762160e1cb439362cc0577471624192a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Omair Majid <omajid@redhat.com>
|
|
||||||
Date: Fri, 19 Jul 2019 19:18:51 -0400
|
|
||||||
Subject: [PATCH] Fix up cgroup2fs in Interop.MountPoints.FormatInfo
|
|
||||||
|
|
||||||
`stat -fc %T /sys/fs/cgroup` calls this file system `cgroup2fs`
|
|
||||||
|
|
||||||
Add the cgroup2fs file system magic number. Available from:
|
|
||||||
|
|
||||||
- https://www.kernel.org/doc/Documentation/cgroup-v2.txt
|
|
||||||
- man 2 statfs
|
|
||||||
|
|
||||||
Move cgroup2fs next to cgroupfs in the drive type list, since it is also
|
|
||||||
DriveType.Ram.
|
|
||||||
---
|
|
||||||
.../Unix/System.Native/Interop.MountPoints.FormatInfo.cs | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs b/src/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs
|
|
||||||
index af38a2285ba2..4240bd4853ab 100644
|
|
||||||
--- a/src/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs
|
|
||||||
+++ b/src/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs
|
|
||||||
@@ -47,6 +47,7 @@ internal enum UnixFileSystemTypes : long
|
|
||||||
btrfs = 0x9123683E,
|
|
||||||
ceph = 0x00C36400,
|
|
||||||
cgroupfs = 0x0027E0EB,
|
|
||||||
+ cgroup2fs = 0x63677270,
|
|
||||||
cifs = 0xFF534D42,
|
|
||||||
coda = 0x73757245,
|
|
||||||
coherent = 0x012FF7B7,
|
|
||||||
@@ -231,7 +232,6 @@ private static DriveType GetDriveType(string fileSystemName)
|
|
||||||
case "bpf_fs":
|
|
||||||
case "btrfs":
|
|
||||||
case "btrfs_test":
|
|
||||||
- case "cgroup2fs":
|
|
||||||
case "coh":
|
|
||||||
case "daxfs":
|
|
||||||
case "drvfs":
|
|
||||||
@@ -384,6 +384,7 @@ private static DriveType GetDriveType(string fileSystemName)
|
|
||||||
case "binfmt_misc":
|
|
||||||
case "cgroup":
|
|
||||||
case "cgroupfs":
|
|
||||||
+ case "cgroup2fs":
|
|
||||||
case "configfs":
|
|
||||||
case "cramfs":
|
|
||||||
case "cramfs-wend":
|
|
@ -1,391 +0,0 @@
|
|||||||
From 2b2273ea4ea1c28472fa0d6ad2ffeb6374500550 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Omair Majid <omajid@redhat.com>
|
|
||||||
Date: Wed, 23 Oct 2019 17:45:59 -0400
|
|
||||||
Subject: [PATCH 1/2] Add cgroup v2 support to Interop.cgroups
|
|
||||||
|
|
||||||
Fix up code to adjust cgroup v1 assumptions and check cgroup v2 paths,
|
|
||||||
locations and values.
|
|
||||||
|
|
||||||
Continue using the older cgroup v1 terminology for APIs.
|
|
||||||
---
|
|
||||||
.../Interop/Linux/cgroups/Interop.cgroups.cs | 116 ++++++++++++++----
|
|
||||||
src/Common/tests/Common.Tests.csproj | 4 +
|
|
||||||
.../tests/Tests/Interop/cgroupsTests.cs | 107 ++++++++++++++++
|
|
||||||
.../tests/DescriptionNameTests.cs | 2 +-
|
|
||||||
4 files changed, 206 insertions(+), 23 deletions(-)
|
|
||||||
create mode 100644 src/Common/tests/Tests/Interop/cgroupsTests.cs
|
|
||||||
|
|
||||||
diff --git a/src/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs b/src/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs
|
|
||||||
index 0ffd4d7b7c03..186fe0516c5b 100644
|
|
||||||
--- a/src/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs
|
|
||||||
+++ b/src/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs
|
|
||||||
@@ -9,17 +9,22 @@
|
|
||||||
|
|
||||||
internal static partial class Interop
|
|
||||||
{
|
|
||||||
+ /// <summary>Provides access to some cgroup (v1 and v2) features</summary>
|
|
||||||
internal static partial class cgroups
|
|
||||||
{
|
|
||||||
+ // For cgroup v1, see https://www.kernel.org/doc/Documentation/cgroup-v1/
|
|
||||||
+ // For cgroup v2, see https://www.kernel.org/doc/Documentation/cgroup-v2.txt
|
|
||||||
+
|
|
||||||
+ /// <summary>The version of cgroup that's being used </summary>
|
|
||||||
+ internal enum CGroupVersion { None, CGroup1, CGroup2 };
|
|
||||||
+
|
|
||||||
/// <summary>Path to mountinfo file in procfs for the current process.</summary>
|
|
||||||
private const string ProcMountInfoFilePath = "/proc/self/mountinfo";
|
|
||||||
/// <summary>Path to cgroup directory in procfs for the current process.</summary>
|
|
||||||
private const string ProcCGroupFilePath = "/proc/self/cgroup";
|
|
||||||
|
|
||||||
- /// <summary>Path to the found cgroup location, or null if it couldn't be found.</summary>
|
|
||||||
- internal static readonly string s_cgroupMemoryPath = FindCGroupPath("memory");
|
|
||||||
- /// <summary>Path to the found cgroup memory limit_in_bytes path, or null if it couldn't be found.</summary>
|
|
||||||
- private static readonly string s_cgroupMemoryLimitPath = s_cgroupMemoryPath != null ? s_cgroupMemoryPath + "/memory.limit_in_bytes" : null;
|
|
||||||
+ /// <summary>Path to the found cgroup memory limit path, or null if it couldn't be found.</summary>
|
|
||||||
+ internal static readonly string s_cgroupMemoryLimitPath = FindCGroupMemoryLimitPath();
|
|
||||||
|
|
||||||
/// <summary>Tries to read the memory limit from the cgroup memory location.</summary>
|
|
||||||
/// <param name="limit">The read limit, or 0 if it couldn't be read.</param>
|
|
||||||
@@ -42,7 +47,7 @@ public static bool TryGetMemoryLimit(out ulong limit)
|
|
||||||
/// <param name="path">The path to the file to parse.</param>
|
|
||||||
/// <param name="result">The parsed result, or 0 if it couldn't be parsed.</param>
|
|
||||||
/// <returns>true if the value was read successfully; otherwise, false.</returns>
|
|
||||||
- private static bool TryReadMemoryValueFromFile(string path, out ulong result)
|
|
||||||
+ internal static bool TryReadMemoryValueFromFile(string path, out ulong result)
|
|
||||||
{
|
|
||||||
if (File.Exists(path))
|
|
||||||
{
|
|
||||||
@@ -79,6 +84,11 @@ private static bool TryReadMemoryValueFromFile(string path, out ulong result)
|
|
||||||
result = checked(ulongValue * multiplier);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // 'max' is also a possible valid value
|
|
||||||
+ //
|
|
||||||
+ // Treat this as 'no memory limit' and let the caller
|
|
||||||
+ // fallback to reading the real limit via other means
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
@@ -90,12 +100,35 @@ private static bool TryReadMemoryValueFromFile(string path, out ulong result)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /// <summary>Find the cgroup memory limit path.</summary>
|
|
||||||
+ /// <returns>The limit path if found; otherwise, null.</returns>
|
|
||||||
+ private static string FindCGroupMemoryLimitPath()
|
|
||||||
+ {
|
|
||||||
+ string cgroupMemoryPath = FindCGroupPath("memory", out CGroupVersion version);
|
|
||||||
+ if (cgroupMemoryPath != null)
|
|
||||||
+ {
|
|
||||||
+ if (version == CGroupVersion.CGroup1)
|
|
||||||
+ {
|
|
||||||
+ return cgroupMemoryPath + "/memory.limit_in_bytes";
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (version == CGroupVersion.CGroup2)
|
|
||||||
+ {
|
|
||||||
+ // 'memory.high' is a soft limit; the process may get throttled
|
|
||||||
+ // 'memory.max' is where OOM killer kicks in
|
|
||||||
+ return cgroupMemoryPath + "/memory.max";
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return null;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/// <summary>Find the cgroup path for the specified subsystem.</summary>
|
|
||||||
/// <param name="subsystem">The subsystem, e.g. "memory".</param>
|
|
||||||
/// <returns>The cgroup path if found; otherwise, null.</returns>
|
|
||||||
- private static string FindCGroupPath(string subsystem)
|
|
||||||
+ private static string FindCGroupPath(string subsystem, out CGroupVersion version)
|
|
||||||
{
|
|
||||||
- if (TryFindHierarchyMount(subsystem, out string hierarchyRoot, out string hierarchyMount) &&
|
|
||||||
+ if (TryFindHierarchyMount(subsystem, out version, out string hierarchyRoot, out string hierarchyMount) &&
|
|
||||||
TryFindCGroupPathForSubsystem(subsystem, out string cgroupPathRelativeToMount))
|
|
||||||
{
|
|
||||||
// For a host cgroup, we need to append the relative path.
|
|
||||||
@@ -113,19 +146,24 @@ private static string FindCGroupPath(string subsystem)
|
|
||||||
/// <param name="root">The path of the directory in the filesystem which forms the root of this mount; null if not found.</param>
|
|
||||||
/// <param name="path">The path of the mount point relative to the process's root directory; null if not found.</param>
|
|
||||||
/// <returns>true if the mount was found; otherwise, null.</returns>
|
|
||||||
- private static bool TryFindHierarchyMount(string subsystem, out string root, out string path)
|
|
||||||
+ private static bool TryFindHierarchyMount(string subsystem, out CGroupVersion version, out string root, out string path)
|
|
||||||
{
|
|
||||||
- if (File.Exists(ProcMountInfoFilePath))
|
|
||||||
+ return TryFindHierarchyMount(ProcMountInfoFilePath, subsystem, out version, out root, out path);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ internal static bool TryFindHierarchyMount(string mountInfoFilePath, string subsystem, out CGroupVersion version, out string root, out string path)
|
|
||||||
+ {
|
|
||||||
+ if (File.Exists(mountInfoFilePath))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
- using (var reader = new StreamReader(ProcMountInfoFilePath))
|
|
||||||
+ using (var reader = new StreamReader(mountInfoFilePath))
|
|
||||||
{
|
|
||||||
string line;
|
|
||||||
while ((line = reader.ReadLine()) != null)
|
|
||||||
{
|
|
||||||
// Look for an entry that has cgroup as the "filesystem type"
|
|
||||||
- // and that has options containing the specified subsystem.
|
|
||||||
+ // and, for cgroup1, that has options containing the specified subsystem
|
|
||||||
// See man page for /proc/[pid]/mountinfo for details, e.g.:
|
|
||||||
// (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
|
|
||||||
// 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
|
|
||||||
@@ -148,17 +186,35 @@ private static bool TryFindHierarchyMount(string subsystem, out string root, out
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (postSeparatorlineParts[0] != "cgroup" ||
|
|
||||||
- Array.IndexOf(postSeparatorlineParts[2].Split(','), subsystem) < 0)
|
|
||||||
+ bool validCGroup1Entry = ((postSeparatorlineParts[0] == "cgroup") &&
|
|
||||||
+ (Array.IndexOf(postSeparatorlineParts[2].Split(','), subsystem) >= 0));
|
|
||||||
+ bool validCGroup2Entry = postSeparatorlineParts[0] == "cgroup2";
|
|
||||||
+
|
|
||||||
+ if (!validCGroup1Entry && !validCGroup2Entry)
|
|
||||||
{
|
|
||||||
// Not the relevant entry.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
- // Found the relevant entry. Extract the mount root and path.
|
|
||||||
+ // Found the relevant entry. Extract the cgroup version, mount root and path.
|
|
||||||
+ switch (postSeparatorlineParts[0])
|
|
||||||
+ {
|
|
||||||
+ case "cgroup":
|
|
||||||
+ version = CGroupVersion.CGroup1;
|
|
||||||
+ break;
|
|
||||||
+ case "cgroup2":
|
|
||||||
+ version = CGroupVersion.CGroup2;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ version = CGroupVersion.None;
|
|
||||||
+ Debug.Fail($"invalid value for CGroupVersion \"{postSeparatorlineParts[0]}\"");
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
string[] lineParts = line.Substring(0, endOfOptionalFields).Split(' ');
|
|
||||||
root = lineParts[3];
|
|
||||||
path = lineParts[4];
|
|
||||||
+
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -169,6 +225,7 @@ private static bool TryFindHierarchyMount(string subsystem, out string root, out
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ version = CGroupVersion.None;
|
|
||||||
root = null;
|
|
||||||
path = null;
|
|
||||||
return false;
|
|
||||||
@@ -180,27 +237,42 @@ private static bool TryFindHierarchyMount(string subsystem, out string root, out
|
|
||||||
/// <returns></returns>
|
|
||||||
private static bool TryFindCGroupPathForSubsystem(string subsystem, out string path)
|
|
||||||
{
|
|
||||||
- if (File.Exists(ProcCGroupFilePath))
|
|
||||||
+ return TryFindCGroupPathForSubsystem(ProcCGroupFilePath, subsystem, out path);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ internal static bool TryFindCGroupPathForSubsystem(string procCGroupFilePath, string subsystem, out string path)
|
|
||||||
+ {
|
|
||||||
+ if (File.Exists(procCGroupFilePath))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
- using (var reader = new StreamReader(ProcCGroupFilePath))
|
|
||||||
+ using (var reader = new StreamReader(procCGroupFilePath))
|
|
||||||
{
|
|
||||||
string line;
|
|
||||||
while ((line = reader.ReadLine()) != null)
|
|
||||||
{
|
|
||||||
- // Find the first entry that has the subsystem listed in its controller
|
|
||||||
- // list. See man page for cgroups for /proc/[pid]/cgroups format, e.g:
|
|
||||||
- // hierarchy-ID:controller-list:cgroup-path
|
|
||||||
- // 5:cpuacct,cpu,cpuset:/daemons
|
|
||||||
-
|
|
||||||
string[] lineParts = line.Split(':');
|
|
||||||
+
|
|
||||||
if (lineParts.Length != 3)
|
|
||||||
{
|
|
||||||
// Malformed line.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // cgroup v2: Find the first entry that matches the cgroup v2 hierarchy:
|
|
||||||
+ // 0::$PATH
|
|
||||||
+
|
|
||||||
+ if ((lineParts[0] == "0") && (string.Empty == lineParts[1]))
|
|
||||||
+ {
|
|
||||||
+ path = lineParts[2];
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // cgroup v1: Find the first entry that has the subsystem listed in its controller
|
|
||||||
+ // list. See man page for cgroups for /proc/[pid]/cgroups format, e.g:
|
|
||||||
+ // hierarchy-ID:controller-list:cgroup-path
|
|
||||||
+ // 5:cpuacct,cpu,cpuset:/daemons
|
|
||||||
+
|
|
||||||
if (Array.IndexOf(lineParts[1].Split(','), subsystem) < 0)
|
|
||||||
{
|
|
||||||
// Not the relevant entry.
|
|
||||||
@@ -214,7 +286,7 @@ private static bool TryFindCGroupPathForSubsystem(string subsystem, out string p
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
- Debug.Fail($"Failed to read or parse \"{ProcMountInfoFilePath}\": {e}");
|
|
||||||
+ Debug.Fail($"Failed to read or parse \"{procCGroupFilePath}\": {e}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/Common/tests/Common.Tests.csproj b/src/Common/tests/Common.Tests.csproj
|
|
||||||
index a189d856348b..979c8dd7fbe6 100644
|
|
||||||
--- a/src/Common/tests/Common.Tests.csproj
|
|
||||||
+++ b/src/Common/tests/Common.Tests.csproj
|
|
||||||
@@ -12,6 +12,9 @@
|
|
||||||
<Compile Include="$(CommonTestPath)\System\Security\Cryptography\ByteUtils.cs">
|
|
||||||
<Link>Common\System\Security\Cryptography\ByteUtils.cs</Link>
|
|
||||||
</Compile>
|
|
||||||
+ <Compile Include="$(CommonPath)\Interop\Linux\cgroups\Interop.cgroups.cs">
|
|
||||||
+ <Link>Common\Interop\Linux\cgroups\Interop.cgroups.cs</Link>
|
|
||||||
+ </Compile>
|
|
||||||
<Compile Include="$(CommonPath)\Interop\Linux\procfs\Interop.ProcFsStat.cs">
|
|
||||||
<Link>Common\Interop\Linux\procfs\Interop.ProcFsStat.cs</Link>
|
|
||||||
</Compile>
|
|
||||||
@@ -69,6 +72,7 @@
|
|
||||||
<Compile Include="$(CommonPath)\CoreLib\System\PasteArguments.cs">
|
|
||||||
<Link>Common\CoreLib\System\PasteArguments.cs</Link>
|
|
||||||
</Compile>
|
|
||||||
+ <Compile Include="Tests\Interop\cgroupsTests.cs" />
|
|
||||||
<Compile Include="Tests\Interop\procfsTests.cs" />
|
|
||||||
<Compile Include="Tests\System\CharArrayHelpersTests.cs" />
|
|
||||||
<Compile Include="Tests\System\IO\PathInternal.Tests.cs" />
|
|
||||||
diff --git a/src/Common/tests/Tests/Interop/cgroupsTests.cs b/src/Common/tests/Tests/Interop/cgroupsTests.cs
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000000..f16d9242879c
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/Common/tests/Tests/Interop/cgroupsTests.cs
|
|
||||||
@@ -0,0 +1,107 @@
|
|
||||||
+// Licensed to the .NET Foundation under one or more agreements.
|
|
||||||
+// The .NET Foundation licenses this file to you under the MIT license.
|
|
||||||
+// See the LICENSE file in the project root for more information.
|
|
||||||
+
|
|
||||||
+using System;
|
|
||||||
+using System.IO;
|
|
||||||
+using System.Text;
|
|
||||||
+using Xunit;
|
|
||||||
+
|
|
||||||
+namespace Common.Tests
|
|
||||||
+{
|
|
||||||
+ public class cgroupsTests
|
|
||||||
+ {
|
|
||||||
+ [Theory]
|
|
||||||
+ [InlineData(true, "0", 0)]
|
|
||||||
+ [InlineData(false, "max", 0)]
|
|
||||||
+ [InlineData(true, "1k", 1024)]
|
|
||||||
+ [InlineData(true, "1K", 1024)]
|
|
||||||
+ public static void ValidateTryReadMemoryValue(bool expectedResult, string valueText, ulong expectedValue)
|
|
||||||
+ {
|
|
||||||
+ string path = Path.GetTempFileName();
|
|
||||||
+ try
|
|
||||||
+ {
|
|
||||||
+ File.WriteAllText(path, valueText);
|
|
||||||
+
|
|
||||||
+ bool result = Interop.cgroups.TryReadMemoryValueFromFile(path, out ulong val);
|
|
||||||
+
|
|
||||||
+ Assert.Equal(expectedResult, result);
|
|
||||||
+ if (result)
|
|
||||||
+ {
|
|
||||||
+ Assert.Equal(expectedValue, val);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ finally
|
|
||||||
+ {
|
|
||||||
+ File.Delete(path);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ [Theory]
|
|
||||||
+ [InlineData(false, "0 0 0:0 / /foo ignore ignore - overlay overlay ignore", "ignore", 0, "/", "/")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo ignore ignore - cgroup2 cgroup2 ignore", "ignore", 2, "/", "/foo")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo ignore ignore - cgroup2 cgroup2 ignore", "memory", 2, "/", "/foo")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo ignore ignore - cgroup2 cgroup2 ignore", "cpu", 2, "/", "/foo")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo ignore - cgroup2 cgroup2 ignore", "cpu", 2, "/", "/foo")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo ignore ignore ignore - cgroup2 cgroup2 ignore", "cpu", 2, "/", "/foo")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo-with-dashes ignore ignore - cgroup2 cgroup2 ignore", "ignore", 2, "/", "/foo-with-dashes")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo ignore ignore - cgroup cgroup memory", "memory", 1, "/", "/foo")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo-with-dashes ignore ignore - cgroup cgroup memory", "memory", 1, "/", "/foo-with-dashes")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo ignore ignore - cgroup cgroup cpu,memory", "memory", 1, "/", "/foo")]
|
|
||||||
+ [InlineData(true, "0 0 0:0 / /foo ignore ignore - cgroup cgroup memory,cpu", "memory", 1, "/", "/foo")]
|
|
||||||
+ [InlineData(false, "0 0 0:0 / /foo ignore ignore - cgroup cgroup cpu", "memory", 0, "/", "/foo")]
|
|
||||||
+ public static void ParseValidateMountInfo(bool found, string procSelfMountInfoText, string subsystem, int expectedVersion, string expectedRoot, string expectedMount)
|
|
||||||
+ {
|
|
||||||
+ string path = Path.GetTempFileName();
|
|
||||||
+ try
|
|
||||||
+ {
|
|
||||||
+ File.WriteAllText(path, procSelfMountInfoText);
|
|
||||||
+
|
|
||||||
+ bool result = Interop.cgroups.TryFindHierarchyMount(path, subsystem, out Interop.cgroups.CGroupVersion version, out string root, out string mount);
|
|
||||||
+
|
|
||||||
+ Assert.Equal(found, result);
|
|
||||||
+ if (found)
|
|
||||||
+ {
|
|
||||||
+ Assert.Equal(expectedVersion, (int)version);
|
|
||||||
+ Assert.Equal(expectedRoot, root);
|
|
||||||
+ Assert.Equal(expectedMount, mount);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ finally
|
|
||||||
+ {
|
|
||||||
+ File.Delete(path);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ [Theory]
|
|
||||||
+ [InlineData(true, "0::/foo", "ignore", "/foo")]
|
|
||||||
+ [InlineData(true, "0::/bar", "ignore", "/bar")]
|
|
||||||
+ [InlineData(true, "0::frob", "ignore", "frob")]
|
|
||||||
+ [InlineData(false, "1::frob", "ignore", "ignore")]
|
|
||||||
+ [InlineData(true, "1:foo:bar", "foo", "bar")]
|
|
||||||
+ [InlineData(true, "2:foo:bar", "foo", "bar")]
|
|
||||||
+ [InlineData(false, "2:foo:bar", "bar", "ignore")]
|
|
||||||
+ [InlineData(true, "1:foo:bar\n2:eggs:spam", "foo", "bar")]
|
|
||||||
+ [InlineData(true, "1:foo:bar\n2:eggs:spam", "eggs", "spam")]
|
|
||||||
+ public static void ParseValidateProcCGroup(bool found, string procSelfCgroupText, string subsystem, string expectedMountPath)
|
|
||||||
+ {
|
|
||||||
+ string path = Path.GetTempFileName();
|
|
||||||
+ try
|
|
||||||
+ {
|
|
||||||
+ File.WriteAllText(path, procSelfCgroupText);
|
|
||||||
+
|
|
||||||
+ bool result = Interop.cgroups.TryFindCGroupPathForSubsystem(path, subsystem, out string mountPath);
|
|
||||||
+
|
|
||||||
+ Assert.Equal(found, result);
|
|
||||||
+ if (found)
|
|
||||||
+ {
|
|
||||||
+ Assert.Equal(expectedMountPath, mountPath);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ finally
|
|
||||||
+ {
|
|
||||||
+ File.Delete(path);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs b/src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs
|
|
||||||
index 910af2fd82b4..73f692898dbc 100644
|
|
||||||
--- a/src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs
|
|
||||||
+++ b/src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs
|
|
||||||
@@ -40,7 +40,7 @@ public void DumpRuntimeInformationToConsole()
|
|
||||||
|
|
||||||
Console.WriteLine($"### CURRENT DIRECTORY: {Environment.CurrentDirectory}");
|
|
||||||
|
|
||||||
- string cgroupsLocation = Interop.cgroups.s_cgroupMemoryPath;
|
|
||||||
+ string cgroupsLocation = Interop.cgroups.s_cgroupMemoryLimitPath;
|
|
||||||
if (cgroupsLocation != null)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"### CGROUPS MEMORY: {cgroupsLocation}");
|
|
||||||
|
|
@ -1,129 +0,0 @@
|
|||||||
From 9a8c5e4014ffca8aff70808cc0e50a403d38c292 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stephen Toub <stoub@microsoft.com>
|
|
||||||
Date: Wed, 23 Oct 2019 20:35:49 -0400
|
|
||||||
Subject: [PATCH 2/2] Clean up new tests
|
|
||||||
|
|
||||||
---
|
|
||||||
.../tests/Tests/Interop/cgroupsTests.cs | 79 ++++++-------------
|
|
||||||
1 file changed, 25 insertions(+), 54 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/Common/tests/Tests/Interop/cgroupsTests.cs b/src/Common/tests/Tests/Interop/cgroupsTests.cs
|
|
||||||
index f16d9242879c..fc6ab5c9753c 100644
|
|
||||||
--- a/src/Common/tests/Tests/Interop/cgroupsTests.cs
|
|
||||||
+++ b/src/Common/tests/Tests/Interop/cgroupsTests.cs
|
|
||||||
@@ -2,38 +2,27 @@
|
|
||||||
// The .NET Foundation licenses this file to you under the MIT license.
|
|
||||||
// See the LICENSE file in the project root for more information.
|
|
||||||
|
|
||||||
-using System;
|
|
||||||
using System.IO;
|
|
||||||
-using System.Text;
|
|
||||||
using Xunit;
|
|
||||||
|
|
||||||
namespace Common.Tests
|
|
||||||
{
|
|
||||||
- public class cgroupsTests
|
|
||||||
+ public class cgroupsTests : FileCleanupTestBase
|
|
||||||
{
|
|
||||||
[Theory]
|
|
||||||
- [InlineData(true, "0", 0)]
|
|
||||||
- [InlineData(false, "max", 0)]
|
|
||||||
- [InlineData(true, "1k", 1024)]
|
|
||||||
- [InlineData(true, "1K", 1024)]
|
|
||||||
- public static void ValidateTryReadMemoryValue(bool expectedResult, string valueText, ulong expectedValue)
|
|
||||||
+ [InlineData(true, "0", 0)]
|
|
||||||
+ [InlineData(false, "max", 0)]
|
|
||||||
+ [InlineData(true, "1k", 1024)]
|
|
||||||
+ [InlineData(true, "1K", 1024)]
|
|
||||||
+ public void ValidateTryReadMemoryValue(bool expectedResult, string valueText, ulong expectedValue)
|
|
||||||
{
|
|
||||||
- string path = Path.GetTempFileName();
|
|
||||||
- try
|
|
||||||
- {
|
|
||||||
- File.WriteAllText(path, valueText);
|
|
||||||
-
|
|
||||||
- bool result = Interop.cgroups.TryReadMemoryValueFromFile(path, out ulong val);
|
|
||||||
+ string path = GetTestFilePath();
|
|
||||||
+ File.WriteAllText(path, valueText);
|
|
||||||
|
|
||||||
- Assert.Equal(expectedResult, result);
|
|
||||||
- if (result)
|
|
||||||
- {
|
|
||||||
- Assert.Equal(expectedValue, val);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- finally
|
|
||||||
+ Assert.Equal(expectedResult, Interop.cgroups.TryReadMemoryValueFromFile(path, out ulong val));
|
|
||||||
+ if (expectedResult)
|
|
||||||
{
|
|
||||||
- File.Delete(path);
|
|
||||||
+ Assert.Equal(expectedValue, val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -50,26 +39,17 @@ public static void ValidateTryReadMemoryValue(bool expectedResult, string valueT
|
|
||||||
[InlineData(true, "0 0 0:0 / /foo ignore ignore - cgroup cgroup cpu,memory", "memory", 1, "/", "/foo")]
|
|
||||||
[InlineData(true, "0 0 0:0 / /foo ignore ignore - cgroup cgroup memory,cpu", "memory", 1, "/", "/foo")]
|
|
||||||
[InlineData(false, "0 0 0:0 / /foo ignore ignore - cgroup cgroup cpu", "memory", 0, "/", "/foo")]
|
|
||||||
- public static void ParseValidateMountInfo(bool found, string procSelfMountInfoText, string subsystem, int expectedVersion, string expectedRoot, string expectedMount)
|
|
||||||
+ public void ParseValidateMountInfo(bool expectedFound, string procSelfMountInfoText, string subsystem, int expectedVersion, string expectedRoot, string expectedMount)
|
|
||||||
{
|
|
||||||
- string path = Path.GetTempFileName();
|
|
||||||
- try
|
|
||||||
- {
|
|
||||||
- File.WriteAllText(path, procSelfMountInfoText);
|
|
||||||
-
|
|
||||||
- bool result = Interop.cgroups.TryFindHierarchyMount(path, subsystem, out Interop.cgroups.CGroupVersion version, out string root, out string mount);
|
|
||||||
+ string path = GetTestFilePath();
|
|
||||||
+ File.WriteAllText(path, procSelfMountInfoText);
|
|
||||||
|
|
||||||
- Assert.Equal(found, result);
|
|
||||||
- if (found)
|
|
||||||
- {
|
|
||||||
- Assert.Equal(expectedVersion, (int)version);
|
|
||||||
- Assert.Equal(expectedRoot, root);
|
|
||||||
- Assert.Equal(expectedMount, mount);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- finally
|
|
||||||
+ Assert.Equal(expectedFound, Interop.cgroups.TryFindHierarchyMount(path, subsystem, out Interop.cgroups.CGroupVersion version, out string root, out string mount));
|
|
||||||
+ if (expectedFound)
|
|
||||||
{
|
|
||||||
- File.Delete(path);
|
|
||||||
+ Assert.Equal(expectedVersion, (int)version);
|
|
||||||
+ Assert.Equal(expectedRoot, root);
|
|
||||||
+ Assert.Equal(expectedMount, mount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -83,24 +63,15 @@ public static void ParseValidateMountInfo(bool found, string procSelfMountInfoTe
|
|
||||||
[InlineData(false, "2:foo:bar", "bar", "ignore")]
|
|
||||||
[InlineData(true, "1:foo:bar\n2:eggs:spam", "foo", "bar")]
|
|
||||||
[InlineData(true, "1:foo:bar\n2:eggs:spam", "eggs", "spam")]
|
|
||||||
- public static void ParseValidateProcCGroup(bool found, string procSelfCgroupText, string subsystem, string expectedMountPath)
|
|
||||||
+ public void ParseValidateProcCGroup(bool expectedFound, string procSelfCgroupText, string subsystem, string expectedMountPath)
|
|
||||||
{
|
|
||||||
- string path = Path.GetTempFileName();
|
|
||||||
- try
|
|
||||||
- {
|
|
||||||
- File.WriteAllText(path, procSelfCgroupText);
|
|
||||||
+ string path = GetTestFilePath();
|
|
||||||
+ File.WriteAllText(path, procSelfCgroupText);
|
|
||||||
|
|
||||||
- bool result = Interop.cgroups.TryFindCGroupPathForSubsystem(path, subsystem, out string mountPath);
|
|
||||||
-
|
|
||||||
- Assert.Equal(found, result);
|
|
||||||
- if (found)
|
|
||||||
- {
|
|
||||||
- Assert.Equal(expectedMountPath, mountPath);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- finally
|
|
||||||
+ Assert.Equal(expectedFound, Interop.cgroups.TryFindCGroupPathForSubsystem(path, subsystem, out string mountPath));
|
|
||||||
+ if (expectedFound)
|
|
||||||
{
|
|
||||||
- File.Delete(path);
|
|
||||||
+ Assert.Equal(expectedMountPath, mountPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,124 +0,0 @@
|
|||||||
From 6cf4ff086875eaf29381cf406ea85846d9f66178 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Omair Majid <omajid@redhat.com>
|
|
||||||
Date: Mon, 24 Feb 2020 14:11:03 -0500
|
|
||||||
Subject: [PATCH] Add Fedora 33 runtime ids
|
|
||||||
|
|
||||||
Fedora 32 is gearing up for release[1], and in-development version of
|
|
||||||
Fedora has been offically labelled as being Fedora 33:
|
|
||||||
|
|
||||||
$ podman run -it fedora:33 cat /etc/os-release
|
|
||||||
NAME=Fedora
|
|
||||||
VERSION="33 (Container Image)"
|
|
||||||
ID=fedora
|
|
||||||
VERSION_ID=33
|
|
||||||
VERSION_CODENAME=""
|
|
||||||
PLATFORM_ID="platform:f33"
|
|
||||||
PRETTY_NAME="Fedora 33 (Container Image)"
|
|
||||||
ANSI_COLOR="0;34"
|
|
||||||
LOGO=fedora-logo-icon
|
|
||||||
CPE_NAME="cpe:/o:fedoraproject:fedora:33"
|
|
||||||
HOME_URL="https://fedoraproject.org/"
|
|
||||||
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/"
|
|
||||||
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
|
|
||||||
BUG_REPORT_URL="https://bugzilla.redhat.com/"
|
|
||||||
REDHAT_BUGZILLA_PRODUCT="Fedora"
|
|
||||||
REDHAT_BUGZILLA_PRODUCT_VERSION=rawhide
|
|
||||||
REDHAT_SUPPORT_PRODUCT="Fedora"
|
|
||||||
REDHAT_SUPPORT_PRODUCT_VERSION=rawhide
|
|
||||||
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
|
|
||||||
VARIANT="Container Image"
|
|
||||||
VARIANT_ID=container
|
|
||||||
|
|
||||||
[1] https://fedorapeople.org/groups/schedule/f-32/f-32-key-tasks.html
|
|
||||||
---
|
|
||||||
eng/Packaging.props | 2 +-
|
|
||||||
.../runtime.compatibility.json | 32 +++++++++++++++++++
|
|
||||||
pkg/Microsoft.NETCore.Platforms/runtime.json | 17 ++++++++++
|
|
||||||
.../runtimeGroups.props | 2 +-
|
|
||||||
src/packages.builds | 3 ++
|
|
||||||
5 files changed, 54 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json b/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json
|
|
||||||
index 1e5c380a7a6a..c20e35394d6b 100644
|
|
||||||
--- a/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json
|
|
||||||
+++ b/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json
|
|
||||||
@@ -953,6 +953,38 @@
|
|
||||||
"any",
|
|
||||||
"base"
|
|
||||||
],
|
|
||||||
+ "fedora.33": [
|
|
||||||
+ "fedora.33",
|
|
||||||
+ "fedora",
|
|
||||||
+ "linux",
|
|
||||||
+ "unix",
|
|
||||||
+ "any",
|
|
||||||
+ "base"
|
|
||||||
+ ],
|
|
||||||
+ "fedora.33-arm64": [
|
|
||||||
+ "fedora.33-arm64",
|
|
||||||
+ "fedora.33",
|
|
||||||
+ "fedora-arm64",
|
|
||||||
+ "fedora",
|
|
||||||
+ "linux-arm64",
|
|
||||||
+ "linux",
|
|
||||||
+ "unix-arm64",
|
|
||||||
+ "unix",
|
|
||||||
+ "any",
|
|
||||||
+ "base"
|
|
||||||
+ ],
|
|
||||||
+ "fedora.33-x64": [
|
|
||||||
+ "fedora.33-x64",
|
|
||||||
+ "fedora.33",
|
|
||||||
+ "fedora-x64",
|
|
||||||
+ "fedora",
|
|
||||||
+ "linux-x64",
|
|
||||||
+ "linux",
|
|
||||||
+ "unix-x64",
|
|
||||||
+ "unix",
|
|
||||||
+ "any",
|
|
||||||
+ "base"
|
|
||||||
+ ],
|
|
||||||
"freebsd": [
|
|
||||||
"freebsd",
|
|
||||||
"unix",
|
|
||||||
diff --git a/pkg/Microsoft.NETCore.Platforms/runtime.json b/pkg/Microsoft.NETCore.Platforms/runtime.json
|
|
||||||
index b2f286ea2479..b3380ecbbef3 100644
|
|
||||||
--- a/pkg/Microsoft.NETCore.Platforms/runtime.json
|
|
||||||
+++ b/pkg/Microsoft.NETCore.Platforms/runtime.json
|
|
||||||
@@ -488,6 +488,23 @@
|
|
||||||
"fedora-x64"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
+ "fedora.33": {
|
|
||||||
+ "#import": [
|
|
||||||
+ "fedora"
|
|
||||||
+ ]
|
|
||||||
+ },
|
|
||||||
+ "fedora.33-arm64": {
|
|
||||||
+ "#import": [
|
|
||||||
+ "fedora.33",
|
|
||||||
+ "fedora-arm64"
|
|
||||||
+ ]
|
|
||||||
+ },
|
|
||||||
+ "fedora.33-x64": {
|
|
||||||
+ "#import": [
|
|
||||||
+ "fedora.33",
|
|
||||||
+ "fedora-x64"
|
|
||||||
+ ]
|
|
||||||
+ },
|
|
||||||
"freebsd": {
|
|
||||||
"#import": [
|
|
||||||
"unix"
|
|
||||||
diff --git a/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props b/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props
|
|
||||||
index eeb8130b54fb..da48e5f9d09f 100644
|
|
||||||
--- a/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props
|
|
||||||
+++ b/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props
|
|
||||||
@@ -43,7 +43,7 @@
|
|
||||||
<RuntimeGroup Include="fedora">
|
|
||||||
<Parent>linux</Parent>
|
|
||||||
<Architectures>x64;arm64</Architectures>
|
|
||||||
- <Versions>23;24;25;26;27;28;29;30;31;32</Versions>
|
|
||||||
+ <Versions>23;24;25;26;27;28;29;30;31;32;33</Versions>
|
|
||||||
<TreatVersionsAsCompatible>false</TreatVersionsAsCompatible>
|
|
||||||
</RuntimeGroup>
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
|||||||
From 58d6cd09bd2d5b1085c6572c1d97b8533cf8294b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Omair Majid <omajid@redhat.com>
|
|
||||||
Date: Fri, 3 Apr 2020 13:53:09 -0400
|
|
||||||
Subject: [PATCH] Fix corefx to build on clang 10
|
|
||||||
|
|
||||||
Clang 10 adds/enables new warnings, some of which is affecting
|
|
||||||
the corefx code.
|
|
||||||
|
|
||||||
Clang 10 has added -Walloca to warn about uses of alloca. This commit
|
|
||||||
replaces the only non-compliant use of that with a single fixed
|
|
||||||
stack-allocated buffer.
|
|
||||||
|
|
||||||
Clang 10 has also added -Wimplicit-int-float-conversion. This commit
|
|
||||||
uses explicit casts to double to avoid the warnings.
|
|
||||||
|
|
||||||
This is a backport of dotnet/runtime#33734 to corefx.
|
|
||||||
|
|
||||||
After this commit, I can build all of corefx with Clang 10.
|
|
||||||
---
|
|
||||||
src/Native/Unix/System.Native/pal_io.c | 20 +++++++++++---------
|
|
||||||
src/Native/Unix/System.Native/pal_time.c | 2 +-
|
|
||||||
2 files changed, 12 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/Native/Unix/System.Native/pal_io.c b/src/Native/Unix/System.Native/pal_io.c
|
|
||||||
index 2d51edacf5ee..c7c42eb3e72b 100644
|
|
||||||
--- a/src/Native/Unix/System.Native/pal_io.c
|
|
||||||
+++ b/src/Native/Unix/System.Native/pal_io.c
|
|
||||||
@@ -906,18 +906,20 @@ int32_t SystemNative_Poll(PollEvent* pollEvents, uint32_t eventCount, int32_t mi
|
|
||||||
return Error_EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
- size_t bufferSize;
|
|
||||||
- if (!multiply_s(sizeof(struct pollfd), (size_t)eventCount, &bufferSize))
|
|
||||||
+ struct pollfd stackBuffer[(uint32_t)(2048/sizeof(struct pollfd))];
|
|
||||||
+ int useStackBuffer = eventCount <= (sizeof(stackBuffer)/sizeof(stackBuffer[0]));
|
|
||||||
+ struct pollfd* pollfds = NULL;
|
|
||||||
+ if (useStackBuffer)
|
|
||||||
{
|
|
||||||
- return SystemNative_ConvertErrorPlatformToPal(EOVERFLOW);
|
|
||||||
+ pollfds = (struct pollfd*)&stackBuffer[0];
|
|
||||||
}
|
|
||||||
-
|
|
||||||
-
|
|
||||||
- int useStackBuffer = bufferSize <= 2048;
|
|
||||||
- struct pollfd* pollfds = (struct pollfd*)(useStackBuffer ? alloca(bufferSize) : malloc(bufferSize));
|
|
||||||
- if (pollfds == NULL)
|
|
||||||
+ else
|
|
||||||
{
|
|
||||||
- return Error_ENOMEM;
|
|
||||||
+ pollfds = (struct pollfd*)calloc(eventCount, sizeof(*pollfds));
|
|
||||||
+ if (pollfds == NULL)
|
|
||||||
+ {
|
|
||||||
+ return Error_ENOMEM;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < eventCount; i++)
|
|
||||||
diff --git a/src/Native/Unix/System.Native/pal_time.c b/src/Native/Unix/System.Native/pal_time.c
|
|
||||||
index 1a7c862749d1..54ebde60a83b 100644
|
|
||||||
--- a/src/Native/Unix/System.Native/pal_time.c
|
|
||||||
+++ b/src/Native/Unix/System.Native/pal_time.c
|
|
||||||
@@ -169,7 +169,7 @@ int32_t SystemNative_GetCpuUtilization(ProcessCpuInformation* previousCpuInfo)
|
|
||||||
uint64_t resolution = SystemNative_GetTimestampResolution();
|
|
||||||
uint64_t timestamp = SystemNative_GetTimestamp();
|
|
||||||
|
|
||||||
- uint64_t currentTime = (uint64_t)(timestamp * ((double)SecondsToNanoSeconds / resolution));
|
|
||||||
+ uint64_t currentTime = (uint64_t)((double)timestamp * ((double)SecondsToNanoSeconds / (double)resolution));
|
|
||||||
|
|
||||||
uint64_t lastRecordedCurrentTime = previousCpuInfo->lastRecordedCurrentTime;
|
|
||||||
uint64_t lastRecordedKernelTime = previousCpuInfo->lastRecordedKernelTime;
|
|
@ -1,40 +0,0 @@
|
|||||||
diff --git a/src/Native/Unix/CMakeLists.txt b/src/Native/Unix/CMakeLists.txt
|
|
||||||
index 7d804a1e54..717c2718d7 100644
|
|
||||||
--- a/src/Native/Unix/CMakeLists.txt
|
|
||||||
+++ b/src/Native/Unix/CMakeLists.txt
|
|
||||||
@@ -25,7 +25,7 @@ add_compile_options(-fPIC)
|
|
||||||
add_compile_options(-Wthread-safety)
|
|
||||||
add_compile_options(-Wno-thread-safety-analysis)
|
|
||||||
+ add_compile_options(-Wno-alloca)
|
|
||||||
endif()
|
|
||||||
-add_compile_options(-Werror)
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL Emscripten)
|
|
||||||
set(CLR_CMAKE_PLATFORM_WASM 1)
|
|
||||||
diff --git a/src/Native/Unix/configure.cmake b/src/Native/Unix/configure.cmake
|
|
||||||
index f4a30ad6cb..f2db68402a 100644
|
|
||||||
--- a/src/Native/Unix/configure.cmake
|
|
||||||
+++ b/src/Native/Unix/configure.cmake
|
|
||||||
@@ -27,6 +27,12 @@ else ()
|
|
||||||
message(FATAL_ERROR "Unknown platform. Cannot define PAL_UNIX_NAME, used by RuntimeInformation.")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
+
|
|
||||||
+set (PREVIOUS_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
|
||||||
+set (CMAKE_CXX_FLAGS "-D_GNU_SOURCE")
|
|
||||||
+set (PREVIOUS_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
|
||||||
+set (CMAKE_C_FLAGS "-D_GNU_SOURCE")
|
|
||||||
+
|
|
||||||
# We compile with -Werror, so we need to make sure these code fragments compile without warnings.
|
|
||||||
# Older CMake versions (3.8) do not assign the result of their tests, causing unused-value errors
|
|
||||||
# which are not distinguished from the test failing. So no error for that one.
|
|
||||||
@@ -698,6 +704,9 @@ endif()
|
|
||||||
|
|
||||||
set (CMAKE_REQUIRED_LIBRARIES)
|
|
||||||
|
|
||||||
+set (CMAKE_CXX_FLAGS "${PREVIOUS_CMAKE_CXX_FLAGS}")
|
|
||||||
+set (CMAKE_C_FLAGS "${PREVIOUS_CMAKE_C_FLAGS}")
|
|
||||||
+
|
|
||||||
check_c_source_compiles(
|
|
||||||
"
|
|
||||||
#include <sys/inotify.h>
|
|
@ -1,4 +1,4 @@
|
|||||||
%bcond_with bootstrap
|
%bcond_without bootstrap
|
||||||
|
|
||||||
# Avoid provides/requires from private libraries
|
# Avoid provides/requires from private libraries
|
||||||
%global privlibs libhostfxr
|
%global privlibs libhostfxr
|
||||||
@ -20,18 +20,20 @@
|
|||||||
%global dotnet_cflags %(echo %optflags | sed -e 's/-fstack-clash-protection//' | sed -re 's/-specs=[^ ]*//g')
|
%global dotnet_cflags %(echo %optflags | sed -e 's/-fstack-clash-protection//' | sed -re 's/-specs=[^ ]*//g')
|
||||||
%global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g')
|
%global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g')
|
||||||
|
|
||||||
%global host_version 3.1.3
|
%global host_version 5.0.0-preview.4.20251.6
|
||||||
%global runtime_version 3.1.3
|
%global runtime_version 5.0.0-preview.4.20251.6
|
||||||
%global aspnetcore_runtime_version %{runtime_version}
|
%global aspnetcore_runtime_version 5.0.0-preview.4.20257.10
|
||||||
%global sdk_version 3.1.103
|
%global sdk_version 5.0.100-preview.4.20161.13
|
||||||
# upstream respun this release, so the tag doesn't exactly match
|
%global templates_version 5.0.0-preview.4.20161.13
|
||||||
%global src_version %{sdk_version}.2
|
#%%global templates_version %%(echo %%{runtime_version} | awk 'BEGIN { FS="."; OFS="." } {print $1, $2, $3+1 }')
|
||||||
%global templates_version %(echo %{runtime_version} | awk 'BEGIN { FS="."; OFS="." } {print $1, $2, $3+1 }')
|
|
||||||
|
|
||||||
%global host_rpm_version %{host_version}
|
%global host_rpm_version 5.0.0
|
||||||
%global aspnetcore_runtime_rpm_version %{aspnetcore_runtime_version}
|
%global aspnetcore_runtime_rpm_version 5.0.0
|
||||||
%global runtime_rpm_version %{runtime_version}
|
%global runtime_rpm_version 5.0.0
|
||||||
%global sdk_rpm_version %{sdk_version}
|
%global sdk_rpm_version 5.0.100
|
||||||
|
|
||||||
|
# upstream can update releases without revving the SDK version so these don't always match
|
||||||
|
%global src_version %{sdk_rpm_version}
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} < 8
|
%if 0%{?fedora} || 0%{?rhel} < 8
|
||||||
%global use_bundled_libunwind 0
|
%global use_bundled_libunwind 0
|
||||||
@ -39,6 +41,10 @@
|
|||||||
%global use_bundled_libunwind 1
|
%global use_bundled_libunwind 1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%ifarch aarch64
|
||||||
|
%global use_bundled_libunwind 1
|
||||||
|
%endif
|
||||||
|
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
%global runtime_arch x64
|
%global runtime_arch x64
|
||||||
%endif
|
%endif
|
||||||
@ -56,42 +62,34 @@
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: dotnet3.1
|
Name: dotnet5.0
|
||||||
Version: %{sdk_rpm_version}
|
Version: %{sdk_rpm_version}
|
||||||
Release: 1%{?dist}
|
Release: 0.2.preview4%{?dist}
|
||||||
Summary: .NET Core Runtime and SDK
|
Summary: .NET Core Runtime and SDK
|
||||||
License: MIT and ASL 2.0 and BSD and LGPLv2+ and CC-BY and CC0 and MS-PL and EPL-1.0 and GPL+ and GPLv2 and ISC and OFL and zlib
|
License: MIT and ASL 2.0 and BSD and LGPLv2+ and CC-BY and CC0 and MS-PL and EPL-1.0 and GPL+ and GPLv2 and ISC and OFL and zlib
|
||||||
URL: https://github.com/dotnet/
|
URL: https://github.com/dotnet/
|
||||||
|
|
||||||
# The source is generated on a Fedora box via:
|
# The source is generated on a Fedora box via:
|
||||||
# ./build-dotnet-tarball v%%{src_version}-SDK
|
# ./build-dotnet-tarball v%%{src_version}-SDK
|
||||||
Source0: dotnet-v%{src_version}-SDK.tar.gz
|
Source0: dotnet-v%{src_version}-preview4-SDK.tar.gz
|
||||||
Source1: check-debug-symbols.py
|
Source1: check-debug-symbols.py
|
||||||
Source2: dotnet.sh.in
|
Source2: dotnet.sh.in
|
||||||
|
|
||||||
|
# dotnet/runtime PR 39044
|
||||||
|
Patch100: runtime-39044-cmake-downgrade.patch
|
||||||
|
|
||||||
|
# TODO: upstream this patch
|
||||||
|
# Do not strip debuginfo from (native/unmanaged) binaries
|
||||||
|
Patch101: runtime-dont-strip.patch
|
||||||
|
|
||||||
|
# TODO: upstream this patch
|
||||||
# Fix building with our additional CFLAGS/CXXFLAGS/LDFLAGS
|
# Fix building with our additional CFLAGS/CXXFLAGS/LDFLAGS
|
||||||
Patch100: corefx-optflags-support.patch
|
Patch102: runtime-flags-support.patch
|
||||||
|
|
||||||
# Add some support for cgroupv2 in corefx
|
|
||||||
# All these patches are upstreamed for 5.0
|
|
||||||
Patch101: corefx-39686-cgroupv2-01.patch
|
|
||||||
Patch102: corefx-39686-cgroupv2-02.patch
|
|
||||||
Patch103: corefx-39633-cgroupv2-mountpoints.patch
|
|
||||||
|
|
||||||
# Add Fedora 33 RID to corefx
|
|
||||||
Patch104: corefx-42871-fedora-33-rid.patch
|
|
||||||
|
|
||||||
# Build with with hardening flags, including -pie
|
|
||||||
Patch200: coreclr-hardening-flags.patch
|
|
||||||
# Fix build with clang 10; Already applied at tarball-build time
|
|
||||||
# Patch201: coreclr-clang10.patch
|
|
||||||
|
|
||||||
# Build with with hardening flags, including -pie
|
|
||||||
Patch300: core-setup-hardening-flags.patch
|
|
||||||
|
|
||||||
# Disable telemetry by default; make it opt-in
|
# Disable telemetry by default; make it opt-in
|
||||||
Patch500: cli-telemetry-optout.patch
|
Patch500: sdk-telemetry-optout.patch
|
||||||
|
|
||||||
|
# ExclusiveArch: aarch64 x86_64
|
||||||
ExclusiveArch: x86_64
|
ExclusiveArch: x86_64
|
||||||
|
|
||||||
BuildRequires: clang
|
BuildRequires: clang
|
||||||
@ -99,8 +97,8 @@ BuildRequires: cmake
|
|||||||
BuildRequires: coreutils
|
BuildRequires: coreutils
|
||||||
%if %{without bootstrap}
|
%if %{without bootstrap}
|
||||||
BuildRequires: dotnet-build-reference-packages
|
BuildRequires: dotnet-build-reference-packages
|
||||||
BuildRequires: dotnet-sdk-3.1
|
BuildRequires: dotnet-sdk-5.0
|
||||||
BuildRequires: dotnet-sdk-3.1-source-built-artifacts
|
BuildRequires: dotnet-sdk-5.0-source-built-artifacts
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: findutils
|
BuildRequires: findutils
|
||||||
BuildRequires: git
|
BuildRequires: git
|
||||||
@ -141,7 +139,7 @@ application to drive everything.
|
|||||||
Version: %{sdk_rpm_version}
|
Version: %{sdk_rpm_version}
|
||||||
Summary: .NET Core CLI tools and runtime
|
Summary: .NET Core CLI tools and runtime
|
||||||
|
|
||||||
Requires: dotnet-sdk-3.1%{?_isa} >= %{sdk_rpm_version}-%{release}
|
Requires: dotnet-sdk-5.0%{?_isa} >= %{sdk_rpm_version}-%{release}
|
||||||
|
|
||||||
%description -n dotnet
|
%description -n dotnet
|
||||||
.NET Core is a fast, lightweight and modular platform for creating
|
.NET Core is a fast, lightweight and modular platform for creating
|
||||||
@ -171,7 +169,7 @@ It particularly focuses on creating console applications, web
|
|||||||
applications and micro-services.
|
applications and micro-services.
|
||||||
|
|
||||||
|
|
||||||
%package -n dotnet-hostfxr-3.1
|
%package -n dotnet-hostfxr-5.0
|
||||||
|
|
||||||
Version: %{host_rpm_version}
|
Version: %{host_rpm_version}
|
||||||
Summary: .NET Core command line host resolver
|
Summary: .NET Core command line host resolver
|
||||||
@ -180,7 +178,7 @@ Summary: .NET Core command line host resolver
|
|||||||
# provided by this package, or from a newer version of .NET Core
|
# provided by this package, or from a newer version of .NET Core
|
||||||
Requires: dotnet-host%{?_isa} >= %{host_rpm_version}-%{release}
|
Requires: dotnet-host%{?_isa} >= %{host_rpm_version}-%{release}
|
||||||
|
|
||||||
%description -n dotnet-hostfxr-3.1
|
%description -n dotnet-hostfxr-5.0
|
||||||
The .NET Core host resolver contains the logic to resolve and select
|
The .NET Core host resolver contains the logic to resolve and select
|
||||||
the right version of the .NET Core SDK or runtime to use.
|
the right version of the .NET Core SDK or runtime to use.
|
||||||
|
|
||||||
@ -191,12 +189,12 @@ It particularly focuses on creating console applications, web
|
|||||||
applications and micro-services.
|
applications and micro-services.
|
||||||
|
|
||||||
|
|
||||||
%package -n dotnet-runtime-3.1
|
%package -n dotnet-runtime-5.0
|
||||||
|
|
||||||
Version: %{runtime_rpm_version}
|
Version: %{runtime_rpm_version}
|
||||||
Summary: NET Core 3.1 runtime
|
Summary: NET Core 5.0 runtime
|
||||||
|
|
||||||
Requires: dotnet-hostfxr-3.1%{?_isa} >= %{host_rpm_version}-%{release}
|
Requires: dotnet-hostfxr-5.0%{?_isa} >= %{host_rpm_version}-%{release}
|
||||||
|
|
||||||
# libicu is dlopen()ed
|
# libicu is dlopen()ed
|
||||||
Requires: libicu%{?_isa}
|
Requires: libicu%{?_isa}
|
||||||
@ -205,7 +203,7 @@ Requires: libicu%{?_isa}
|
|||||||
Provides: bundled(libunwind) = 1.3
|
Provides: bundled(libunwind) = 1.3
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%description -n dotnet-runtime-3.1
|
%description -n dotnet-runtime-5.0
|
||||||
The .NET Core runtime contains everything needed to run .NET Core applications.
|
The .NET Core runtime contains everything needed to run .NET Core applications.
|
||||||
It includes a high performance Virtual Machine as well as the framework
|
It includes a high performance Virtual Machine as well as the framework
|
||||||
libraries used by .NET Core applications.
|
libraries used by .NET Core applications.
|
||||||
@ -217,14 +215,14 @@ It particularly focuses on creating console applications, web
|
|||||||
applications and micro-services.
|
applications and micro-services.
|
||||||
|
|
||||||
|
|
||||||
%package -n aspnetcore-runtime-3.1
|
%package -n aspnetcore-runtime-5.0
|
||||||
|
|
||||||
Version: %{aspnetcore_runtime_rpm_version}
|
Version: %{aspnetcore_runtime_rpm_version}
|
||||||
Summary: ASP.NET Core 3.1 runtime
|
Summary: ASP.NET Core 5.0 runtime
|
||||||
|
|
||||||
Requires: dotnet-runtime-3.1%{?_isa} >= %{runtime_rpm_version}-%{release}
|
Requires: dotnet-runtime-5.0%{?_isa} >= %{runtime_rpm_version}-%{release}
|
||||||
|
|
||||||
%description -n aspnetcore-runtime-3.1
|
%description -n aspnetcore-runtime-5.0
|
||||||
The ASP.NET Core runtime contains everything needed to run .NET Core
|
The ASP.NET Core runtime contains everything needed to run .NET Core
|
||||||
web applications. It includes a high performance Virtual Machine as
|
web applications. It includes a high performance Virtual Machine as
|
||||||
well as the framework libraries used by .NET Core applications.
|
well as the framework libraries used by .NET Core applications.
|
||||||
@ -236,16 +234,16 @@ It particularly focuses on creating console applications, web
|
|||||||
applications and micro-services.
|
applications and micro-services.
|
||||||
|
|
||||||
|
|
||||||
%package -n dotnet-templates-3.1
|
%package -n dotnet-templates-5.0
|
||||||
|
|
||||||
Version: %{sdk_rpm_version}
|
Version: %{sdk_rpm_version}
|
||||||
Summary: .NET Core 3.1 templates
|
Summary: .NET Core 5.0 templates
|
||||||
|
|
||||||
# Theoretically any version of the host should work. But lets aim for the one
|
# 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 Core
|
# provided by this package, or from a newer version of .NET Core
|
||||||
Requires: dotnet-host%{?_isa} >= %{host_rpm_version}-%{release}
|
Requires: dotnet-host%{?_isa} >= %{host_rpm_version}-%{release}
|
||||||
|
|
||||||
%description -n dotnet-templates-3.1
|
%description -n dotnet-templates-5.0
|
||||||
This package contains templates used by the .NET Core SDK.
|
This package contains templates used by the .NET Core SDK.
|
||||||
|
|
||||||
ASP.NET Core is a fast, lightweight and modular platform for creating
|
ASP.NET Core is a fast, lightweight and modular platform for creating
|
||||||
@ -255,25 +253,25 @@ It particularly focuses on creating console applications, web
|
|||||||
applications and micro-services.
|
applications and micro-services.
|
||||||
|
|
||||||
|
|
||||||
%package -n dotnet-sdk-3.1
|
%package -n dotnet-sdk-5.0
|
||||||
|
|
||||||
Version: %{sdk_rpm_version}
|
Version: %{sdk_rpm_version}
|
||||||
Summary: .NET Core 3.1 Software Development Kit
|
Summary: .NET Core 5.0 Software Development Kit
|
||||||
|
|
||||||
Provides: bundled(js-jquery)
|
Provides: bundled(js-jquery)
|
||||||
Provides: bundled(npm)
|
Provides: bundled(npm)
|
||||||
|
|
||||||
Requires: dotnet-runtime-3.1%{?_isa} >= %{runtime_rpm_version}-%{release}
|
Requires: dotnet-runtime-5.0%{?_isa} >= %{runtime_rpm_version}-%{release}
|
||||||
Requires: aspnetcore-runtime-3.1%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release}
|
Requires: aspnetcore-runtime-5.0%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release}
|
||||||
|
|
||||||
Requires: dotnet-apphost-pack-3.1%{?_isa} >= %{runtime_rpm_version}-%{release}
|
Requires: dotnet-apphost-pack-5.0%{?_isa} >= %{runtime_rpm_version}-%{release}
|
||||||
Requires: dotnet-targeting-pack-3.1%{?_isa} >= %{runtime_rpm_version}-%{release}
|
Requires: dotnet-targeting-pack-5.0%{?_isa} >= %{runtime_rpm_version}-%{release}
|
||||||
Requires: aspnetcore-targeting-pack-3.1%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release}
|
Requires: aspnetcore-targeting-pack-5.0%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release}
|
||||||
Requires: netstandard-targeting-pack-2.1%{?_isa} >= %{sdk_rpm_version}-%{release}
|
Requires: netstandard-targeting-pack-2.1%{?_isa} >= %{sdk_rpm_version}-%{release}
|
||||||
|
|
||||||
Requires: dotnet-templates-3.1%{?_isa} >= %{sdk_rpm_version}-%{release}
|
Requires: dotnet-templates-5.0%{?_isa} >= %{sdk_rpm_version}-%{release}
|
||||||
|
|
||||||
%description -n dotnet-sdk-3.1
|
%description -n dotnet-sdk-5.0
|
||||||
The .NET Core SDK is a collection of command line applications to
|
The .NET Core SDK is a collection of command line applications to
|
||||||
create, build, publish and run .NET Core applications.
|
create, build, publish and run .NET Core applications.
|
||||||
|
|
||||||
@ -302,18 +300,18 @@ applications using the .NET Core SDK.
|
|||||||
%{_libdir}/dotnet/packs/%{5}
|
%{_libdir}/dotnet/packs/%{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
%dotnet_targeting_pack dotnet-apphost-pack-3.1 %{runtime_rpm_version} Microsoft.NETCore.App 3.1 Microsoft.NETCore.App.Host.%{runtime_id}
|
%dotnet_targeting_pack dotnet-apphost-pack-5.0 %{runtime_rpm_version} Microsoft.NETCore.App 5.0 Microsoft.NETCore.App.Host.%{runtime_id}
|
||||||
%dotnet_targeting_pack dotnet-targeting-pack-3.1 %{runtime_rpm_version} Microsoft.NETCore.App 3.1 Microsoft.NETCore.App.Ref
|
%dotnet_targeting_pack dotnet-targeting-pack-5.0 %{runtime_rpm_version} Microsoft.NETCore.App 5.0 Microsoft.NETCore.App.Ref
|
||||||
%dotnet_targeting_pack aspnetcore-targeting-pack-3.1 %{aspnetcore_runtime_rpm_version} Microsoft.AspNetCore.App 3.1 Microsoft.AspNetCore.App.Ref
|
%dotnet_targeting_pack aspnetcore-targeting-pack-5.0 %{aspnetcore_runtime_rpm_version} Microsoft.AspNetCore.App 5.0 Microsoft.AspNetCore.App.Ref
|
||||||
%dotnet_targeting_pack netstandard-targeting-pack-2.1 %{sdk_rpm_version} NETStandard.Library 2.1 NETStandard.Library.Ref
|
%dotnet_targeting_pack netstandard-targeting-pack-2.1 %{sdk_rpm_version} NETStandard.Library 2.1 NETStandard.Library.Ref
|
||||||
|
|
||||||
|
|
||||||
%package -n dotnet-sdk-3.1-source-built-artifacts
|
%package -n dotnet-sdk-5.0-source-built-artifacts
|
||||||
|
|
||||||
Version: %{sdk_rpm_version}
|
Version: %{sdk_rpm_version}
|
||||||
Summary: Internal package for building .NET Core 3.1 Software Development Kit
|
Summary: Internal package for building .NET Core 5.0 Software Development Kit
|
||||||
|
|
||||||
%description -n dotnet-sdk-3.1-source-built-artifacts
|
%description -n dotnet-sdk-5.0-source-built-artifacts
|
||||||
The .NET Core source-built archive is a collection of packages needed
|
The .NET Core source-built archive is a collection of packages needed
|
||||||
to build the .NET Core SDK itself.
|
to build the .NET Core SDK itself.
|
||||||
|
|
||||||
@ -321,7 +319,7 @@ These are not meant for general use.
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n dotnet-v%{src_version}-SDK
|
%setup -q -n dotnet-v%{src_version}-preview4-SDK
|
||||||
|
|
||||||
%if %{without bootstrap}
|
%if %{without bootstrap}
|
||||||
# Remove all prebuilts
|
# Remove all prebuilts
|
||||||
@ -331,49 +329,43 @@ find -iname '*.tar.gz' -type f -delete
|
|||||||
find -iname '*.nupkg' -type f -delete
|
find -iname '*.nupkg' -type f -delete
|
||||||
find -iname '*.zip' -type f -delete
|
find -iname '*.zip' -type f -delete
|
||||||
rm -rf .dotnet/
|
rm -rf .dotnet/
|
||||||
rm -r packages/source-built
|
rm -rf packages/source-built
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{without bootstrap}
|
%if %{without bootstrap}
|
||||||
sed -i -e 's|3.1.100-preview1-014459|3.1.102|' global.json
|
sed -i -e 's|5.0.100-preview1-014459|5.0.103|' global.json
|
||||||
mkdir -p packages/archive
|
mkdir -p packages/archive
|
||||||
ln -s %{_libdir}/dotnet/source-built-artifacts/*.tar.gz packages/archive/
|
ln -s %{_libdir}/dotnet/source-built-artifacts/*.tar.gz packages/archive/
|
||||||
ln -s %{_libdir}/dotnet/reference-packages/Private.SourceBuild.ReferencePackages*.tar.gz packages/archive
|
ln -s %{_libdir}/dotnet/reference-packages/Private.SourceBuild.ReferencePackages*.tar.gz packages/archive
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Fix bad hardcoded path in build
|
# Fix bad hardcoded path in build
|
||||||
sed -i 's|/usr/share/dotnet|%{_libdir}/dotnet|' src/core-setup.*/src/corehost/common/pal.unix.cpp
|
sed -i 's|/usr/share/dotnet|%{_libdir}/dotnet|' src/runtime.*/src/installer/corehost/cli/hostmisc/pal.unix.cpp
|
||||||
|
|
||||||
# Disable warnings
|
# Disable warnings
|
||||||
sed -i 's|skiptests|skiptests ignorewarnings|' repos/coreclr.proj
|
sed -i 's|skiptests|skiptests ignorewarnings|' repos/runtime.common.props
|
||||||
|
|
||||||
pushd src/corefx.*
|
pushd src/runtime.*
|
||||||
%patch100 -p1
|
%patch100 -p1
|
||||||
%patch101 -p1
|
%patch101 -p1
|
||||||
%patch102 -p1
|
%patch102 -p1
|
||||||
%patch103 -p1
|
|
||||||
%patch104 -p1
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd src/coreclr.*
|
pushd src/sdk.*
|
||||||
%patch200 -p1
|
|
||||||
#%%patch201 -p1
|
|
||||||
popd
|
|
||||||
|
|
||||||
pushd src/core-setup.*
|
|
||||||
%patch300 -p1
|
|
||||||
popd
|
|
||||||
|
|
||||||
pushd src/cli.*
|
|
||||||
%patch500 -p1
|
%patch500 -p1
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# If CLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE is misisng, add it back
|
# If CLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE is misisng, add it back
|
||||||
grep CLR_CMAKE_USE_SYSTEM_LIBUNWIND repos/coreclr.proj || \
|
grep CLR_CMAKE_USE_SYSTEM_LIBUNWIND repos/runtime.common.props || \
|
||||||
sed -i 's|\$(BuildArguments) </BuildArguments>|$(BuildArguments) cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE</BuildArguments>|' repos/coreclr.proj
|
sed -i 's|\$(BuildArguments) </BuildArguments>|$(BuildArguments) cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE</BuildArguments>|' repos/runtime.common.props
|
||||||
|
|
||||||
%if %{use_bundled_libunwind}
|
%if %{use_bundled_libunwind}
|
||||||
sed -i 's|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=FALSE|' repos/coreclr.proj
|
sed -i 's|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=FALSE|' repos/runtime.common.props
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%ifnarch x86_64
|
||||||
|
mkdir -p artifacts/obj/%{runtime_arch}/Release
|
||||||
|
cp artifacts/obj/x64/Release/PackageVersions.props artifacts/obj/%{runtime_arch}/Release/PackageVersions.props
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
cat source-build-info.txt
|
cat source-build-info.txt
|
||||||
@ -389,9 +381,9 @@ cat /etc/os-release
|
|||||||
cp -a %{_libdir}/dotnet previously-built-dotnet
|
cp -a %{_libdir}/dotnet previously-built-dotnet
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
export CFLAGS="%{dotnet_cflags}"
|
export EXTRA_CFLAGS="%{dotnet_cflags}"
|
||||||
export CXXFLAGS="%{dotnet_cflags}"
|
export EXTRA_CXXFLAGS="%{dotnet_cflags}"
|
||||||
export LDFLAGS="%{dotnet_ldflags}"
|
export EXTRA_LDFLAGS="%%{dotnet_ldflags}"
|
||||||
|
|
||||||
#%%if %%{without bootstrap}
|
#%%if %%{without bootstrap}
|
||||||
# --with-ref-packages %%{_libdir}/dotnet/reference-packages/ \
|
# --with-ref-packages %%{_libdir}/dotnet/reference-packages/ \
|
||||||
@ -416,11 +408,11 @@ sed -e 's|[@]LIBDIR[@]|%{_libdir}|g' %{SOURCE2} > dotnet.sh
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
install -dm 0755 %{buildroot}%{_libdir}/dotnet
|
install -dm 0755 %{buildroot}%{_libdir}/dotnet
|
||||||
ls bin/%{runtime_arch}/Release
|
ls artifacts/%{runtime_arch}/Release
|
||||||
tar xf bin/%{runtime_arch}/Release/dotnet-sdk-%{sdk_version}-%{runtime_id}.tar.gz -C %{buildroot}%{_libdir}/dotnet/
|
tar xf artifacts/%{runtime_arch}/Release/dotnet-sdk-%{sdk_rpm_version}-preview.4.20161.13-%{runtime_id}.tar.gz -C %{buildroot}%{_libdir}/dotnet/
|
||||||
|
|
||||||
# Install managed symbols
|
# Install managed symbols
|
||||||
tar xf bin/%{runtime_arch}/Release/runtime/dotnet-runtime-symbols-%{runtime_version}-%{runtime_id}.tar.gz \
|
tar xf artifacts/%{runtime_arch}/Release/runtime/dotnet-runtime-symbols-%{runtime_version}-%{runtime_id}.tar.gz \
|
||||||
-C %{buildroot}/%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version}/
|
-C %{buildroot}/%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version}/
|
||||||
|
|
||||||
# Fix executable permissions on files
|
# Fix executable permissions on files
|
||||||
@ -439,7 +431,7 @@ install dotnet.sh %{buildroot}%{_sysconfdir}/profile.d/
|
|||||||
|
|
||||||
install -dm 0755 %{buildroot}/%{_datadir}/bash-completion/completions
|
install -dm 0755 %{buildroot}/%{_datadir}/bash-completion/completions
|
||||||
# dynamic completion needs the file to be named the same as the base command
|
# dynamic completion needs the file to be named the same as the base command
|
||||||
install src/cli.*/scripts/register-completions.bash %{buildroot}/%{_datadir}/bash-completion/completions/dotnet
|
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
|
# TODO: the zsh completion script needs to be ported to use #compdef
|
||||||
#install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions
|
#install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions
|
||||||
@ -455,8 +447,8 @@ echo "%{_libdir}/dotnet" >> install_location
|
|||||||
install -dm 0755 %{buildroot}%{_sysconfdir}/dotnet
|
install -dm 0755 %{buildroot}%{_sysconfdir}/dotnet
|
||||||
install install_location %{buildroot}%{_sysconfdir}/dotnet/
|
install install_location %{buildroot}%{_sysconfdir}/dotnet/
|
||||||
|
|
||||||
install -dm 0755 %{buildroot}%{_libdir}/dotnet/source-built-artifacts
|
#install -dm 0755 %%{buildroot}%%{_libdir}/dotnet/source-built-artifacts
|
||||||
install bin/%{runtime_arch}/Release/Private.SourceBuilt.Artifacts.*.tar.gz %{buildroot}/%{_libdir}/dotnet/source-built-artifacts/
|
#install artifacts/%%{runtime_arch}/Release/Private.SourceBuilt.Artifacts.*.tar.gz %%{buildroot}/%%{_libdir}/dotnet/source-built-artifacts/
|
||||||
|
|
||||||
# Check debug symbols in all elf objects. This is not in %%check
|
# Check debug symbols in all elf objects. This is not in %%check
|
||||||
# because native binaries are stripped by rpm-build after %%install.
|
# because native binaries are stripped by rpm-build after %%install.
|
||||||
@ -487,35 +479,60 @@ echo "Testing build results for debug symbols..."
|
|||||||
%dir %{_datadir}/bash-completion/completions
|
%dir %{_datadir}/bash-completion/completions
|
||||||
%{_datadir}/bash-completion/completions/dotnet
|
%{_datadir}/bash-completion/completions/dotnet
|
||||||
|
|
||||||
%files -n dotnet-hostfxr-3.1
|
%files -n dotnet-hostfxr-5.0
|
||||||
%dir %{_libdir}/dotnet/host/fxr
|
%dir %{_libdir}/dotnet/host/fxr
|
||||||
%{_libdir}/dotnet/host/fxr/%{host_version}
|
%{_libdir}/dotnet/host/fxr/%{host_version}
|
||||||
|
|
||||||
%files -n dotnet-runtime-3.1
|
%files -n dotnet-runtime-5.0
|
||||||
%dir %{_libdir}/dotnet/shared
|
%dir %{_libdir}/dotnet/shared
|
||||||
%dir %{_libdir}/dotnet/shared/Microsoft.NETCore.App
|
%dir %{_libdir}/dotnet/shared/Microsoft.NETCore.App
|
||||||
%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version}
|
%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version}
|
||||||
|
|
||||||
%files -n aspnetcore-runtime-3.1
|
%files -n aspnetcore-runtime-5.0
|
||||||
%dir %{_libdir}/dotnet/shared
|
%dir %{_libdir}/dotnet/shared
|
||||||
%dir %{_libdir}/dotnet/shared/Microsoft.AspNetCore.App
|
%dir %{_libdir}/dotnet/shared/Microsoft.AspNetCore.App
|
||||||
%{_libdir}/dotnet/shared/Microsoft.AspNetCore.App/%{aspnetcore_runtime_version}
|
%{_libdir}/dotnet/shared/Microsoft.AspNetCore.App/%{aspnetcore_runtime_version}
|
||||||
|
|
||||||
%files -n dotnet-templates-3.1
|
%files -n dotnet-templates-5.0
|
||||||
%dir %{_libdir}/dotnet/templates
|
%dir %{_libdir}/dotnet/templates
|
||||||
%{_libdir}/dotnet/templates/%{templates_version}
|
%{_libdir}/dotnet/templates/%{templates_version}
|
||||||
|
|
||||||
%files -n dotnet-sdk-3.1
|
%files -n dotnet-sdk-5.0
|
||||||
%dir %{_libdir}/dotnet/sdk
|
%dir %{_libdir}/dotnet/sdk
|
||||||
%{_libdir}/dotnet/sdk/%{sdk_version}
|
%{_libdir}/dotnet/sdk/%{sdk_version}
|
||||||
%dir %{_libdir}/dotnet/packs
|
%dir %{_libdir}/dotnet/packs
|
||||||
|
|
||||||
%files -n dotnet-sdk-3.1-source-built-artifacts
|
#%%files -n dotnet-sdk-5.0-source-built-artifacts
|
||||||
%dir %{_libdir}/dotnet
|
#%%dir %%{_libdir}/dotnet
|
||||||
%{_libdir}/dotnet/source-built-artifacts
|
#%%{_libdir}/dotnet/source-built-artifacts
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jul 10 2020 Omair Majid <omajid@redhat.com> - 5.0.100-0.2.preview4
|
||||||
|
- Fix building with custom CFLAGS/CXXFLAGS/LDFLAGS
|
||||||
|
- Clean up patches
|
||||||
|
|
||||||
|
* Mon Jul 06 2020 Omair Majid <omajid@redhat.com> - 5.0.100-0.1.preview4
|
||||||
|
- Initial build
|
||||||
|
|
||||||
|
* Sat Jun 27 2020 Omair Majid <omajid@redhat.com> - 3.1.105-4
|
||||||
|
- Disable bootstrap
|
||||||
|
|
||||||
|
* Fri Jun 26 2020 Omair Majid <omajid@redhat.com> - 3.1.105-3
|
||||||
|
- Re-bootstrap aarch64
|
||||||
|
|
||||||
|
* Fri Jun 19 2020 Omair Majid <omajid@redhat.com> - 3.1.105-3
|
||||||
|
- Disable bootstrap
|
||||||
|
|
||||||
|
* Thu Jun 18 2020 Omair Majid <omajid@redhat.com> - 3.1.105-1
|
||||||
|
- Bootstrap aarch64
|
||||||
|
|
||||||
|
* Tue Jun 16 2020 Chris Rummel <crummel@microsoft.com> - 3.1.105-1
|
||||||
|
- Update to .NET Core Runtime 3.1.5 and SDK 3.1.105
|
||||||
|
|
||||||
|
* Fri Jun 05 2020 Chris Rummel <crummel@microsoft.com> - 3.1.104-1
|
||||||
|
- Update to .NET Core Runtime 3.1.4 and SDK 3.1.104
|
||||||
|
|
||||||
* Thu Apr 09 2020 Chris Rummel <crummel@microsoft.com> - 3.1.103-1
|
* Thu Apr 09 2020 Chris Rummel <crummel@microsoft.com> - 3.1.103-1
|
||||||
- Update to .NET Core Runtime 3.1.3 and SDK 3.1.103
|
- Update to .NET Core Runtime 3.1.3 and SDK 3.1.103
|
||||||
|
|
||||||
@ -716,4 +733,3 @@ echo "Testing build results for debug symbols..."
|
|||||||
- SPEC file cleanup
|
- SPEC file cleanup
|
||||||
* Wed Jan 11 2017 Nemanja Milosevic <nmilosev@fedoraproject.org> - 1.1.0-0
|
* Wed Jan 11 2017 Nemanja Milosevic <nmilosev@fedoraproject.org> - 1.1.0-0
|
||||||
- Initial RPM for Fedora 25/26.
|
- Initial RPM for Fedora 25/26.
|
||||||
|
|
1158
runtime-39044-cmake-downgrade.patch
Normal file
1158
runtime-39044-cmake-downgrade.patch
Normal file
File diff suppressed because it is too large
Load Diff
47
runtime-dont-strip.patch
Normal file
47
runtime-dont-strip.patch
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
Do not strip native/unmanaged symbols from binaries
|
||||||
|
|
||||||
|
This is a hack. It rips out the calls to strip directly.
|
||||||
|
|
||||||
|
The correct/upstreamable fix is to add a configure/build option to
|
||||||
|
keep symbols for some builds, such as those needed by upstream.
|
||||||
|
|
||||||
|
diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake
|
||||||
|
index 8b73581ed14..7697908425e 100644
|
||||||
|
--- a/eng/native/functions.cmake
|
||||||
|
+++ b/eng/native/functions.cmake
|
||||||
|
@@ -282,7 +282,7 @@ function(target_precompile_header)
|
||||||
|
endif(MSVC)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
-function(strip_symbols targetName outputFilename)
|
||||||
|
+function(strip_symbols_renamed targetName outputFilename)
|
||||||
|
if (CLR_CMAKE_HOST_UNIX)
|
||||||
|
set(strip_source_file $<TARGET_FILE:${targetName}>)
|
||||||
|
|
||||||
|
@@ -336,8 +336,8 @@ function(strip_symbols targetName outputFilename)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(install_with_stripped_symbols targetName kind destination)
|
||||||
|
- strip_symbols(${targetName} symbol_file)
|
||||||
|
- install_symbols(${symbol_file} ${destination})
|
||||||
|
+ # strip_symbols_renamed(${targetName} symbol_file)
|
||||||
|
+ # install_symbols(${symbol_file} ${destination})
|
||||||
|
if ("${kind}" STREQUAL "TARGETS")
|
||||||
|
set(install_source ${targetName})
|
||||||
|
elseif("${kind}" STREQUAL "PROGRAMS")
|
||||||
|
@@ -375,13 +375,13 @@ function(install_clr)
|
||||||
|
foreach(targetName ${INSTALL_CLR_TARGETS})
|
||||||
|
list(FIND CLR_CROSS_COMPONENTS_LIST ${targetName} INDEX)
|
||||||
|
if (NOT DEFINED CLR_CROSS_COMPONENTS_LIST OR NOT ${INDEX} EQUAL -1)
|
||||||
|
- strip_symbols(${targetName} symbol_file)
|
||||||
|
+ # strip_symbols_renamed(${targetName} symbol_file)
|
||||||
|
|
||||||
|
foreach(destination ${destinations})
|
||||||
|
# We don't need to install the export libraries for our DLLs
|
||||||
|
# since they won't be directly linked against.
|
||||||
|
install(PROGRAMS $<TARGET_FILE:${targetName}> DESTINATION ${destination})
|
||||||
|
- install_symbols(${symbol_file} ${destination})
|
||||||
|
+ # install_symbols(${symbol_file} ${destination})
|
||||||
|
|
||||||
|
if(CLR_CMAKE_PGO_INSTRUMENT)
|
||||||
|
if(WIN32)
|
30
runtime-flags-support.patch
Normal file
30
runtime-flags-support.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh
|
||||||
|
index b976f5fdc6c..853580b1c7a 100755
|
||||||
|
--- a/eng/native/build-commons.sh
|
||||||
|
+++ b/eng/native/build-commons.sh
|
||||||
|
@@ -163,6 +163,14 @@ EOF
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
+ SAVED_CFLAGS="${CFLAGS}"
|
||||||
|
+ SAVED_CXXFLAGS="${CXXFLAGS}"
|
||||||
|
+ SAVED_LDFLAGS="${LDFLAGS}"
|
||||||
|
+
|
||||||
|
+ export CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
|
||||||
|
+ export CXXFLAGS="${CXXFLAGS} ${EXTRA_CXXFLAGS}"
|
||||||
|
+ export LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}"
|
||||||
|
+
|
||||||
|
if [[ "$__StaticAnalyzer" == 1 ]]; then
|
||||||
|
pushd "$intermediatesDir"
|
||||||
|
|
||||||
|
@@ -181,6 +189,10 @@ EOF
|
||||||
|
$cmake_command --build "$intermediatesDir" --target install -- -j "$__NumProc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
+ CFLAGS="${SAVED_CFLAGS}"
|
||||||
|
+ CXXFLAGS="${SAVED_CXXFLAGS}"
|
||||||
|
+ LDFLAGS="${SAVED_LDFLAGS}"
|
||||||
|
+
|
||||||
|
local exit_code="$?"
|
||||||
|
if [[ "$exit_code" != 0 ]]; then
|
||||||
|
echo "${__ErrMsgPrefix}Failed to build \"$message\"."
|
@ -1,7 +1,7 @@
|
|||||||
diff --git a/src/dotnet/Program.cs b/src/dotnet/Program.cs
|
diff --git a/src/Cli/dotnet/Program.cs b/src/Cli/dotnet/Program.cs
|
||||||
index de1ebb9e6..6bbf479de 100644
|
index de1ebb9e6..6bbf479de 100644
|
||||||
--- a/src/dotnet/Program.cs
|
--- a/src/Cli/dotnet/Program.cs
|
||||||
+++ b/src/dotnet/Program.cs
|
+++ b/src/Cli/dotnet/Program.cs
|
||||||
@@ -28,6 +28,13 @@ public class Program
|
@@ -28,6 +28,13 @@ public class Program
|
||||||
|
|
||||||
public static int Main(string[] args)
|
public static int Main(string[] args)
|
1
sources
1
sources
@ -1 +0,0 @@
|
|||||||
SHA512 (dotnet-v3.1.103.2-SDK.tar.gz) = 6c4de4914f6d107e59300efb43fae24fffdbb983a5ffeb36fbe26c8071a87e76162ebde0f0aa270ab7cbb666b4ee0ab65cfab98f1dbba2ea9d48809372417ec2
|
|
@ -7,20 +7,18 @@
|
|||||||
- container
|
- container
|
||||||
- atomic
|
- atomic
|
||||||
repositories:
|
repositories:
|
||||||
- repo: "https://github.com/redhat-developer/dotnet-bunny.git"
|
|
||||||
dest: "dotnet-bunny"
|
|
||||||
- repo: "https://github.com/redhat-developer/dotnet-regular-tests.git"
|
- repo: "https://github.com/redhat-developer/dotnet-regular-tests.git"
|
||||||
dest: "dotnet-regular-tests"
|
dest: "dotnet-regular-tests"
|
||||||
tests:
|
tests:
|
||||||
- build_test_suite:
|
- download_test_runner:
|
||||||
dir: dotnet-bunny
|
dir: ./
|
||||||
run: make
|
run: wget --no-verbose https://github.com/redhat-developer/dotnet-bunny/releases/latest/download/turkey-$(uname -m) -O turkey && chmod +x ./turkey
|
||||||
- print_test_suite_version:
|
- print_test_runner_version:
|
||||||
dir: dotnet-bunny
|
dir: ./
|
||||||
run: bin/turkey --version
|
run: ./turkey --version
|
||||||
- run_regular_tests:
|
- regular:
|
||||||
dir: dotnet-regular-tests
|
dir: ./
|
||||||
run: ../dotnet-bunny/bin/turkey -l={{ remote_artifacts }}
|
run: ./turkey -l={{ remote_artifacts }} -s=$(pwd)/nuget-prerelease dotnet-regular-tests
|
||||||
required_packages:
|
required_packages:
|
||||||
- babeltrace
|
- babeltrace
|
||||||
- bash-completion
|
- bash-completion
|
||||||
|
@ -26,7 +26,7 @@ while [[ "$#" -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
spec_file=dotnet3.1.spec
|
spec_file=dotnet5.0.spec
|
||||||
|
|
||||||
sdk_version=${positional_args[0]:-}
|
sdk_version=${positional_args[0]:-}
|
||||||
if [[ -z ${sdk_version} ]]; then
|
if [[ -z ${sdk_version} ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user