From 9e0e3c52b771d5328fe319e3293e5a8d343e034c Mon Sep 17 00:00:00 2001 From: Livy Ge Date: Thu, 3 Mar 2022 15:03:29 +0800 Subject: [PATCH] runtime: add RIDs for anolis distro instead of patching dotnet everytime after it got updated we plan to add runtime ID for anolis 7/anolis 8/anolis 9. Signed-off-by: Livy Ge --- eng/native/init-distro-rid.sh | 2 +- .../src/runtimeGroups.props | 15 +++++++++++++++ src/native/corehost/hostmisc/pal.unix.cpp | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh index e44524e8e30e64..a2cb2a770bc783 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" || "${ID}" == "alpine" ]]; then + if [[ "${ID}" == "rhel" || "${ID}" == "rocky" || "${ID}" == "alpine" || "${ID}" == "anolis" ]]; then # remove the last version digit VERSION_ID="${VERSION_ID%.*}" fi diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props index 1a04ed929e85d6..4911db56678c09 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props +++ b/src/libraries/Microsoft.NETCore.Platforms/src/runtimeGroups.props @@ -30,6 +30,21 @@ 21;22;23;24;25;26;27;28;29;30;31;32 + + rhel + x64 + 7 + true + false + + + 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 a71af30832f470..865daa96f30670 100644 --- a/src/native/corehost/hostmisc/pal.unix.cpp +++ b/src/native/corehost/hostmisc/pal.unix.cpp @@ -718,6 +718,7 @@ static pal::string_t normalize_linux_rid(pal::string_t rid) { pal::string_t rhelPrefix(_X("rhel.")); + pal::string_t anolisPrefix(_X("anolis.")); pal::string_t alpinePrefix(_X("alpine.")); pal::string_t rockyPrefix(_X("rocky.")); size_t lastVersionSeparatorIndex = std::string::npos; @@ -738,6 +739,10 @@ pal::string_t normalize_linux_rid(pal::string_t rid) { lastVersionSeparatorIndex = rid.find(_X("."), rockyPrefix.length()); } + else if (rid.compare(0, anolisPrefix.length(), anolisPrefix) == 0) + { + lastVersionSeparatorIndex = rid.find(_X("."), anolisPrefix.length()); + } if (lastVersionSeparatorIndex != std::string::npos) {