From 53a8a104776f86b4a725b048a238a748daed9b29 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Fri, 8 Sep 2023 18:16:41 -0400 Subject: [PATCH] Replace hardlinked files with full copies Related: RHEL-2958 --- dotnet8.0.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dotnet8.0.spec b/dotnet8.0.spec index d463a79..f02db0f 100644 --- a/dotnet8.0.spec +++ b/dotnet8.0.spec @@ -522,7 +522,14 @@ sed -e 's|[@]LIBDIR[@]|%{_libdir}|g' %{SOURCE21} > 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/ +mkdir -p built-sdk +tar xf artifacts/%{runtime_arch}/Release/dotnet-sdk-%{sdk_version}-%{runtime_id}.tar.gz -C built-sdk/ + +# Convert hardlinks to actual copies. This takes up quite a bit of +# extra disk space, but works around RHEL issues in post-rpmbuild tools +# when they encounter hardlinks. +cp -r --preserve=mode,ownership,timestamps built-sdk/* %{buildroot}%{_libdir}/dotnet/ +ls %{buildroot}%{_libdir}/dotnet # See https://github.com/dotnet/source-build/issues/2579 find %{buildroot}%{_libdir}/dotnet/ -type f -name 'testhost.x86' -delete @@ -544,7 +551,7 @@ fi # Install managed symbols 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}/ + -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 {} \;