diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh
index a0a4f5bc4054f4..24d548993268ed 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}" == "alpine" ]]; then
+ if [[ "${ID}" == "rhel" || "${ID}" == "rocky" || "${ID}" == "alpine" ]]; 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 dce6a7f5346586..09df206a8ca0c8 100644
--- a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json
+++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.compatibility.json
@@ -6052,6 +6052,122 @@
"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.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",
diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
index a7867d81727d89..fc08ee78a84dd4 100644
--- a/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
+++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
@@ -2425,6 +2425,63 @@
"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.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"
diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props
index ce8cc1d22b77e4..8534909568ab98 100644
--- a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props
+++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props
@@ -215,6 +215,14 @@
9
+
+ rhel
+ x64;arm64
+ 8;9
+ true
+ false
+
+
linux
x64
diff --git a/src/native/corehost/hostmisc/pal.unix.cpp b/src/native/corehost/hostmisc/pal.unix.cpp
index 3524cc6256ad7c..2e10470c988d64 100644
--- a/src/native/corehost/hostmisc/pal.unix.cpp
+++ b/src/native/corehost/hostmisc/pal.unix.cpp
@@ -684,6 +684,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)
@@ -698,6 +699,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)
{