Skip to content

Commit f307019

Browse files
Copilotrolfbjarne
andcommitted
Improve RuntimeIdentifier parsing to handle versioned RIDs
Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
1 parent bb62425 commit f307019

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeInstructionSet.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@ public override bool Execute ()
340340
string? ComputeMacInstructionSet (ApplePlatform platform, Version targetVersion)
341341
{
342342
// For macOS and Mac Catalyst, we need to determine the instruction set based on RuntimeIdentifier
343-
// RuntimeIdentifier format: <os>-<arch> (e.g., "osx-x64", "osx-arm64", "maccatalyst-x64", "maccatalyst-arm64")
343+
// RuntimeIdentifier format: <os>-<arch> or <os>.<version>-<arch>
344+
// Examples: "osx-x64", "osx-arm64", "osx.13.0-arm64", "maccatalyst-x64", "maccatalyst-arm64"
344345

345346
if (string.IsNullOrEmpty (RuntimeIdentifier)) {
346347
Log.LogMessage (MessageImportance.Low, $"RuntimeIdentifier is not set, cannot determine instruction set for {platform}");
@@ -353,7 +354,8 @@ public override bool Execute ()
353354
return null;
354355
}
355356

356-
var arch = parts [1];
357+
// The architecture is always the last segment after the last hyphen
358+
var arch = parts [parts.Length - 1];
357359

358360
// Determine instruction set based on architecture
359361
if (arch == "x64") {

0 commit comments

Comments
 (0)