Skip to content
Merged
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/native/init-distro-rid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems both single or double square brackets are allowed to evaluate expressions. I mention it because the main version only had single square brackets.

Source: http://mywiki.wooledge.org/BashFAQ/031

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest, I didn't even notice that single brackets where used on main, I only wished to add rocky as a valid alternative to the existing test. It doesn't have any functional impact here, as double brackets only give access to the extended Bash test syntax.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems double brackets are more correct. https://stackoverflow.com/a/2188369/8816314

If we have to do any corrections, we would have to add them to main, not here. But I think single brackets work too, if I'm understanding those two sources correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Single brackets are compatible with /bin/sh (e.g. standard POSIX tests), whereas double brackets are a bash extension. I assume it has since been decided to not use bash extensions on main, but I would leave it as it is on servicing.

# remove the last version digit
VERSION_ID="${VERSION_ID%.*}"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
57 changes: 57 additions & 0 deletions src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@
<Versions>9</Versions>
</RuntimeGroup>

<RuntimeGroup Include="rocky">
<Parent>rhel</Parent>
<Architectures>x64;arm64</Architectures>
<Versions>8;9</Versions>
<ApplyVersionsToParent>true</ApplyVersionsToParent>
<TreatVersionsAsCompatible>false</TreatVersionsAsCompatible>
</RuntimeGroup>

<RuntimeGroup Include="sles">
<Parent>linux</Parent>
<Architectures>x64</Architectures>
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 @@ -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)
Expand All @@ -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)
{
Expand Down