Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Oracle Linux support #99728

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/common/native/init-distro-rid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ getNonPortableDistroRid()
# shellcheck disable=SC1091
if [ -e "${rootfsDir}/etc/os-release" ]; then
. "${rootfsDir}/etc/os-release"
if [ "${ID}" = "rhel" ] || [ "${ID}" = "rocky" ] || [ "${ID}" = "alpine" ]; then
if [ "${ID}" = "rhel" ] || [ "${ID}" = "rocky" ] || [ "${ID}" = "alpine" ] || [ "${ID}" = "ol" ]; then
VERSION_ID="${VERSION_ID%.*}" # Remove the last version digit for these distros
fi

Expand Down
5 changes: 5 additions & 0 deletions src/native/corehost/hostmisc/pal.unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,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."));
pal::string_t olPrefix(_X("ol."));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richlander @elinor-fung now that we've frozen the RID graph, we shouldn't need these changes, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Host should not care about distro-specific RIDs. This implementation is for legacy .NET versions.

size_t lastVersionSeparatorIndex = std::string::npos;

if (rid.compare(0, rhelPrefix.length(), rhelPrefix) == 0)
Expand All @@ -785,6 +786,10 @@ pal::string_t normalize_linux_rid(pal::string_t rid)
{
lastVersionSeparatorIndex = rid.find(_X("."), rockyPrefix.length());
}
else if (rid.compare(0, olPrefix.length(), olPrefix) == 0)
{
lastVersionSeparatorIndex = rid.find(_X("."), olPrefix.length());
}

if (lastVersionSeparatorIndex != std::string::npos)
{
Expand Down
Loading