Skip to content

Commit 44ab0e6

Browse files
committed
ResolveReadyToRunCompilers: map non-portable rids when targetOS is determined.
1 parent f720423 commit 44ab0e6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

eng/restore-toolset.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ function InitializeCustomSDKToolset {
2121

2222
InitializeDotNetCli true
2323

24-
if [[ "$DISTRO" != "ubuntu" || "$MAJOR_VERSION" -le 16 ]]; then
25-
InstallDotNetSharedFramework "1.0.5"
26-
InstallDotNetSharedFramework "1.1.2"
27-
fi
24+
# if [[ "$DISTRO" != "ubuntu" || "$MAJOR_VERSION" -le 16 ]]; then
25+
# InstallDotNetSharedFramework "1.0.5"
26+
# InstallDotNetSharedFramework "1.1.2"
27+
# fi
2828
InstallDotNetSharedFramework "2.1.0"
2929
InstallDotNetSharedFramework "2.2.8"
3030
InstallDotNetSharedFramework "3.1.0"

src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,15 @@ private bool ValidateCrossgen2Support()
143143

144144
bool version5 = crossgen2PackVersion.Major < 6;
145145
bool isSupportedTarget = ExtractTargetPlatformAndArchitecture(_targetRuntimeIdentifier, out _targetPlatform, out _targetArchitecture);
146-
string targetOS = _targetPlatform switch
146+
147+
var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath);
148+
string portablePlatform = NuGetUtils.GetBestMatchingRid(
149+
runtimeGraph,
150+
_targetPlatform,
151+
new[] { "linux", "linux-musl", "osx", "win" },
152+
out _);
153+
154+
string targetOS = portablePlatform switch
147155
{
148156
"linux" => "linux",
149157
"linux-musl" => "linux",

0 commit comments

Comments
 (0)