From 69ae1e467feafce0c59d20e3e5ab2cd6ba687e4e Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Sun, 14 Jan 2024 06:46:58 +0200 Subject: [PATCH 1/5] Identify riscv64 as valid arch --- .../Microsoft.NET.Build.Containers/Registry/Registry.cs | 1 + src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs | 1 + .../Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs | 3 +++ .../Microsoft.NET.RuntimeIdentifierInference.targets | 6 ++++++ .../targets/Microsoft.NET.Sdk.props | 3 +++ 5 files changed, 14 insertions(+) diff --git a/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs b/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs index d9d0e4f70ba4..cd24b4342ec0 100644 --- a/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs +++ b/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs @@ -233,6 +233,7 @@ private static IReadOnlyDictionary GetManifest "arm64" => "arm64", "ppc64le" => "ppc64le", "s390x" => "s390x", + "riscv64" => "riscv4", _ => null }; diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs index 83d69d24c374..b7ec5e3519c1 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs @@ -41,6 +41,7 @@ protected override void ExecuteCore() RuntimeIdentifier.EndsWith("-x86") || RuntimeIdentifier.Contains("-x86-") ? Architecture.X86 : RuntimeIdentifier.EndsWith("-arm64") || RuntimeIdentifier.Contains("-arm64-") ? Architecture.Arm64 : RuntimeIdentifier.EndsWith("-arm") || RuntimeIdentifier.Contains("-arm-") ? Architecture.Arm : + RuntimeIdentifier.EndsWith("-riscv64") || RuntimeIdentifier.Contains("-riscv64-") ? Architecture.RiscV64 : throw new ArgumentException(nameof(RuntimeIdentifier)); BundleOptions options = BundleOptions.None; diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs index e7b3be111228..e849172e6517 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs @@ -257,6 +257,9 @@ private static bool ExtractTargetPlatformAndArchitecture(string runtimeIdentifie case "arm64": architecture = Architecture.Arm64; break; + case "riscv64": + architecture = Architecture.RiscV64; + break; case "x64": architecture = Architecture.X64; break; diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index 363f9f2f6987..254909f9acb5 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -149,6 +149,12 @@ Copyright (c) .NET Foundation. All rights reserved. + + + riscv64 + + + AnyCPU diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props index 5f4c342792c9..d59ec966f5ed 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props @@ -82,6 +82,9 @@ Copyright (c) .NET Foundation. All rights reserved. arm64 + + riscv64 + From ee94aeed7df1cf3cc3c275ad9a1d9fde0ef085dc Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Sun, 14 Jan 2024 07:14:53 +0200 Subject: [PATCH 2/5] Exclude from netfx --- src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs | 2 ++ .../Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs index b7ec5e3519c1..9166759f6b0c 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs @@ -41,7 +41,9 @@ protected override void ExecuteCore() RuntimeIdentifier.EndsWith("-x86") || RuntimeIdentifier.Contains("-x86-") ? Architecture.X86 : RuntimeIdentifier.EndsWith("-arm64") || RuntimeIdentifier.Contains("-arm64-") ? Architecture.Arm64 : RuntimeIdentifier.EndsWith("-arm") || RuntimeIdentifier.Contains("-arm-") ? Architecture.Arm : +#if !NETFRAMEWORK RuntimeIdentifier.EndsWith("-riscv64") || RuntimeIdentifier.Contains("-riscv64-") ? Architecture.RiscV64 : +#endif throw new ArgumentException(nameof(RuntimeIdentifier)); BundleOptions options = BundleOptions.None; diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs index e849172e6517..705184b1e263 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs @@ -257,9 +257,11 @@ private static bool ExtractTargetPlatformAndArchitecture(string runtimeIdentifie case "arm64": architecture = Architecture.Arm64; break; +#if !NETFRAMEWORK case "riscv64": architecture = Architecture.RiscV64; break; +#endif case "x64": architecture = Architecture.X64; break; From c4258b27084e47080a30741eba0ff0bd836e35a4 Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:22:04 +0200 Subject: [PATCH 3/5] Update src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Köplinger --- .../Microsoft.NET.Build.Containers/Registry/Registry.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs b/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs index cd24b4342ec0..79656b92e83e 100644 --- a/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs +++ b/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs @@ -233,7 +233,7 @@ private static IReadOnlyDictionary GetManifest "arm64" => "arm64", "ppc64le" => "ppc64le", "s390x" => "s390x", - "riscv64" => "riscv4", + "riscv64" => "riscv64", _ => null }; From b691d234b30d1b45bc4b43e1faf63a624072bec2 Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:27:32 +0200 Subject: [PATCH 4/5] Update Microsoft.NET.RuntimeIdentifierInference.targets --- .../Microsoft.NET.RuntimeIdentifierInference.targets | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index 254909f9acb5..363f9f2f6987 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -149,12 +149,6 @@ Copyright (c) .NET Foundation. All rights reserved. - - - riscv64 - - - AnyCPU From ea82bc9484113385364d2f598857b46a78dc6801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 19 Jan 2024 13:55:27 +0100 Subject: [PATCH 5/5] Remove PlatformTarget --- .../Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props index d59ec966f5ed..5f4c342792c9 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props @@ -82,9 +82,6 @@ Copyright (c) .NET Foundation. All rights reserved. arm64 - - riscv64 -