diff --git a/scripts/dotnet.py b/scripts/dotnet.py index 211ac85a497..d66ec3925c4 100755 --- a/scripts/dotnet.py +++ b/scripts/dotnet.py @@ -92,6 +92,8 @@ def get_target_framework_moniker(framework: str) -> str: return 'net8.0' if framework == 'nativeaot9.0': return 'net9.0' + if framework == 'nativeaot10.0': + return 'net10.0' else: return framework @@ -119,7 +121,7 @@ class VersionsAction(Action): def __call__(self, parser, namespace, values, option_string=None): if values: for version in values: - if not search(r'^\d\.\d+\.\d+', version): + if not search(r'^\d+\.\d+\.\d+', version): raise ArgumentTypeError( 'Version "{}" is in the wrong format'.format(version)) setattr(namespace, self.dest, values) @@ -528,7 +530,7 @@ def run(self, FrameworkVersion = NamedTuple('FrameworkVersion', major=int, minor=int) @tracer.start_as_current_span("dotnet_get_framework_version") # type: ignore def get_framework_version(framework: str) -> FrameworkVersion: - groups = search(r".*(\d)\.(\d)$", framework) + groups = search(r".*?(\d+)\.(\d+)$", framework) if not groups: raise ValueError("Unknown target framework: {}".format(framework)) @@ -594,12 +596,16 @@ def get_dotnet_version_from_path( # Attempt 2: Increase the minor version by 1 and retry. sdk = next((f for f in sdks if f.startswith( "{}.{}".format(version.major, version.minor + 1))), None) + if not sdk: + if version.major == 9: + sdk = next((f for f in sdks if f.startswith("10.0")), None) if not sdk: sdk = next((f for f in sdks if f.startswith( "{}.{}".format('6', '0'))), None) if not sdk: raise RuntimeError( - "Unable to determine the .NET SDK used for {}".format(framework) + f"Unable to determine the .NET SDK used for {framework}. " + f"SDKs found in {sdk_path}: {sdks}. Major version: {version.major}" ) return sdk diff --git a/src/tools/ResultsComparer/Data.cs b/src/tools/ResultsComparer/Data.cs index d6976408a6b..b1934d856db 100644 --- a/src/tools/ResultsComparer/Data.cs +++ b/src/tools/ResultsComparer/Data.cs @@ -158,6 +158,10 @@ private static string GetMoniker(string key) return "nativeaot9.0-preview" + key[key.IndexOf("nativeaot9.0-preview") + "nativeaot9.0-preview".Length]; if (key.Contains("net9.0")) return "net9.0"; + if (key.StartsWith("net10.0")) + return "net10.0"; + if (key.StartsWith("nativeaot10.0")) + return key; return null; }