Skip to content

Commit aea2bba

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

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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)