From 560b606fa2c23eb8639ecb5bae17f974dab59f1f Mon Sep 17 00:00:00 2001 From: Richard Alloway Date: Thu, 26 Aug 2021 16:15:06 +0000 Subject: [PATCH 1/2] Rocky Linux support --- eng/native/init-distro-rid.sh | 2 +- .../src/runtime.compatibility.json | 155 +++++++++++++++++- .../src/runtime.json | 76 ++++++++- .../src/runtimeGroups.props | 8 + src/native/corehost/hostmisc/pal.unix.cpp | 5 + 5 files changed, 243 insertions(+), 3 deletions(-) diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh index f71aa8640b160..4d4fa1db75ef7 100644 --- a/eng/native/init-distro-rid.sh +++ b/eng/native/init-distro-rid.sh @@ -41,7 +41,7 @@ initNonPortableDistroRid() # We have forced __PortableBuild=0. This is because -portablebuld # has been passed as false. if (( isPortable == 0 )); then - if [ "${ID}" = "rhel" ]; then + if [ "${ID}" == "rhel" ] || [ "${ID}" == "rocky" ]; then # remove the last version digit VERSION_ID="${VERSION_ID%.*}" fi diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json index 9966d06dc38ea..8c957e87cbc48 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json +++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json @@ -5686,6 +5686,159 @@ "any", "base" ], + "rocky": [ + "rocky", + "rhel", + "linux", + "unix", + "any", + "base" + ], + "rocky-arm64": [ + "rocky-arm64", + "rocky", + "rhel-arm64", + "rhel", + "linux-arm64", + "linux", + "unix-arm64", + "unix", + "any", + "base" + ], + "rocky-x64": [ + "rocky-x64", + "rocky", + "rhel-x64", + "rhel", + "linux-x64", + "linux", + "unix-x64", + "unix", + "any", + "base" + ], + "rocky.8": [ + "rocky.8", + "rocky", + "rhel.8", + "rhel", + "linux", + "unix", + "any", + "base" + ], + "rocky.8-arm64": [ + "rocky.8-arm64", + "rocky.8", + "rocky-arm64", + "rhel.8-arm64", + "rocky", + "rhel.8", + "rhel-arm64", + "rhel", + "linux-arm64", + "linux", + "unix-arm64", + "unix", + "any", + "base" + ], + "rocky.8-x64": [ + "rocky.8-x64", + "rocky.8", + "rocky-x64", + "rhel.8-x64", + "rocky", + "rhel.8", + "rhel-x64", + "rhel", + "linux-x64", + "linux", + "unix-x64", + "unix", + "any", + "base" + ], + "rocky.8.4": [ + "rocky.8.4", + "rocky", + "rhel", + "linux", + "unix", + "any", + "base" + ], + "rocky.8.4-arm64": [ + "rocky.8.4-arm64", + "rocky.8.4", + "rocky-arm64", + "rocky", + "rhel-arm64", + "rhel", + "linux-arm64", + "linux", + "unix-arm64", + "unix", + "any", + "base" + ], + "rocky.8.4-x64": [ + "rocky.8.4-x64", + "rocky.8.4", + "rocky-x64", + "rocky", + "rhel-x64", + "rhel", + "linux-x64", + "linux", + "unix-x64", + "unix", + "any", + "base" + ], + "rocky.9": [ + "rocky.9", + "rocky", + "rhel.9", + "rhel", + "linux", + "unix", + "any", + "base" + ], + "rocky.9-arm64": [ + "rocky.9-arm64", + "rocky.9", + "rocky-arm64", + "rhel.9-arm64", + "rocky", + "rhel.9", + "rhel-arm64", + "rhel", + "linux-arm64", + "linux", + "unix-arm64", + "unix", + "any", + "base" + ], + "rocky.9-x64": [ + "rocky.9-x64", + "rocky.9", + "rocky-x64", + "rhel.9-x64", + "rocky", + "rhel.9", + "rhel-x64", + "rhel", + "linux-x64", + "linux", + "unix-x64", + "unix", + "any", + "base" + ], "sles": [ "sles", "linux", @@ -8522,4 +8675,4 @@ "any", "base" ] -} \ No newline at end of file +} diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json index d40191ceaae15..dfa40e271b991 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json +++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json @@ -2328,6 +2328,80 @@ "rhel-x64" ] }, + "rocky": { + "#import": [ + "rhel" + ] + }, + "rocky-arm64": { + "#import": [ + "rocky", + "rhel-arm64" + ] + }, + "rocky-x64": { + "#import": [ + "rocky", + "rhel-x64" + ] + }, + "rocky.8": { + "#import": [ + "rocky", + "rhel.8" + ] + }, + "rocky.8-arm64": { + "#import": [ + "rocky.8", + "rocky-arm64", + "rhel.8-arm64" + ] + }, + "rocky.8-x64": { + "#import": [ + "rocky.8", + "rocky-x64", + "rhel.8-x64" + ] + }, + "rocky.8.4": { + "#import": [ + "rocky" + ] + }, + "rocky.8.4-arm64": { + "#import": [ + "rocky.8.4", + "rocky-arm64" + ] + }, + "rocky.8.4-x64": { + "#import": [ + "rocky.8.4", + "rocky-x64" + ] + }, + "rocky.9": { + "#import": [ + "rocky", + "rhel.9" + ] + }, + "rocky.9-arm64": { + "#import": [ + "rocky.9", + "rocky-arm64", + "rhel.9-arm64" + ] + }, + "rocky.9-x64": { + "#import": [ + "rocky.9", + "rocky-x64", + "rhel.9-x64" + ] + }, "sles": { "#import": [ "linux" @@ -3657,4 +3731,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props index 58b93131016b2..7773e649c0be6 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props +++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props @@ -216,6 +216,14 @@ 9 + + rhel + x64;arm64 + 8;8.4;9 + true + false + + linux x64 diff --git a/src/native/corehost/hostmisc/pal.unix.cpp b/src/native/corehost/hostmisc/pal.unix.cpp index ef644bdf0d7a3..fdb7675e1e341 100644 --- a/src/native/corehost/hostmisc/pal.unix.cpp +++ b/src/native/corehost/hostmisc/pal.unix.cpp @@ -685,6 +685,7 @@ pal::string_t normalize_linux_rid(pal::string_t rid) { pal::string_t rhelPrefix(_X("rhel.")); pal::string_t alpinePrefix(_X("alpine.")); + pal::string_t rockyPrefix(_X("rocky.")); size_t lastVersionSeparatorIndex = std::string::npos; if (rid.compare(0, rhelPrefix.length(), rhelPrefix) == 0) @@ -699,6 +700,10 @@ pal::string_t normalize_linux_rid(pal::string_t rid) lastVersionSeparatorIndex = rid.find(_X("."), secondVersionSeparatorIndex + 1); } } + else if (rid.compare(0, rockyPrefix.length(), rockyPrefix) == 0) + { + lastVersionSeparatorIndex = rid.find(_X("."), rockyPrefix.length()); + } if (lastVersionSeparatorIndex != std::string::npos) { From 5380921131b426e745dc8c354ae9234be4c4cf5f Mon Sep 17 00:00:00 2001 From: Richard Alloway Date: Thu, 30 Sep 2021 23:13:42 +0000 Subject: [PATCH 2/2] Remove references to Rocky Linux minor version 8.4 --- eng/native/init-distro-rid.sh | 2 +- .../src/runtime.compatibility.json | 37 ------------------- .../src/runtime.json | 17 --------- .../src/runtimeGroups.props | 2 +- 4 files changed, 2 insertions(+), 56 deletions(-) diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh index 4d4fa1db75ef7..eea8eca2d26d1 100644 --- a/eng/native/init-distro-rid.sh +++ b/eng/native/init-distro-rid.sh @@ -41,7 +41,7 @@ initNonPortableDistroRid() # We have forced __PortableBuild=0. This is because -portablebuld # has been passed as false. if (( isPortable == 0 )); then - if [ "${ID}" == "rhel" ] || [ "${ID}" == "rocky" ]; then + if [ "${ID}" = "rhel" || "${ID}" = "rocky" ]; then # remove the last version digit VERSION_ID="${VERSION_ID%.*}" fi diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json index 8c957e87cbc48..15b31d1952170 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json +++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json @@ -5760,43 +5760,6 @@ "any", "base" ], - "rocky.8.4": [ - "rocky.8.4", - "rocky", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rocky.8.4-arm64": [ - "rocky.8.4-arm64", - "rocky.8.4", - "rocky-arm64", - "rocky", - "rhel-arm64", - "rhel", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "rocky.8.4-x64": [ - "rocky.8.4-x64", - "rocky.8.4", - "rocky-x64", - "rocky", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], "rocky.9": [ "rocky.9", "rocky", diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json index dfa40e271b991..3f2444c487d66 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json +++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json @@ -2365,23 +2365,6 @@ "rhel.8-x64" ] }, - "rocky.8.4": { - "#import": [ - "rocky" - ] - }, - "rocky.8.4-arm64": { - "#import": [ - "rocky.8.4", - "rocky-arm64" - ] - }, - "rocky.8.4-x64": { - "#import": [ - "rocky.8.4", - "rocky-x64" - ] - }, "rocky.9": { "#import": [ "rocky", diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props index 7773e649c0be6..da8d3fa1c7f2d 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props +++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props @@ -219,7 +219,7 @@ rhel x64;arm64 - 8;8.4;9 + 8;9 true false