From 4ff81b5c3940ec93e16dcd7e0eb33cbdee729d63 Mon Sep 17 00:00:00 2001
From: Marc Paine <marcpop@microsoft.com>
Date: Wed, 24 May 2023 09:45:19 -0700
Subject: [PATCH] Remove win-arm support in net8 Clean up the logic to
 correctly have a version of rids per release

A side effect of this is that net6.0 included a bunch of bionic RIDs that were added for 7.0. Those have now been removed
---
 .../targets/GenerateBundledVersions.targets   | 48 ++++++++++++++-----
 1 file changed, 35 insertions(+), 13 deletions(-)

diff --git a/src/redist/targets/GenerateBundledVersions.targets b/src/redist/targets/GenerateBundledVersions.targets
index 6f9d010ef..137d00cc1 100644
--- a/src/redist/targets/GenerateBundledVersions.targets
+++ b/src/redist/targets/GenerateBundledVersions.targets
@@ -193,10 +193,14 @@
           @(Net70AppHostRids);
           " />
 
+      <NetCoreAppHostRids Remove="win-arm" />
+
       <NetCoreRuntimePackRids Include="
           @(Net70RuntimePackRids);
           " />
 
+      <NetCoreRuntimePackRids Remove="win-arm" />
+
       <!--
         In source-build, we build the current RID from source, which may be
         non-portable and/or not an official RID. However, we can only use the
@@ -211,8 +215,8 @@
         Condition="'$(DotNetBuildFromSource)' == 'true'"
         Include="$(ProductMonikerRid)" />
 
-      <MonoRuntimePackRids Include="
-          @(NetCoreRuntimePackRids);
+      <Net60MonoRuntimePackRids Include="
+          @(Net70RuntimePackRids);
           browser-wasm;
           ios-arm64;
           ios-arm;
@@ -229,7 +233,17 @@
           " />
 
       <!-- Mono doesn't support these RIDs -->
-      <MonoRuntimePackRids Remove="tizen.4.0.0-armel;tizen.5.0.0-armel" />
+      <Net60MonoRuntimePackRids Remove="tizen.4.0.0-armel;tizen.5.0.0-armel" />
+
+      <Net70MonoRuntimePackRids Include="
+      @(Net60MonoRuntimePackRids);
+      " />
+
+      <MonoRuntimePackRids Include="
+      @(Net70MonoRuntimePackRids);
+      " />
+
+      <MonoRuntimePackRids Remove="win-arm" />
 
       <AspNetCore30RuntimePackRids Include="
         win-x64;
@@ -258,10 +272,18 @@
           win-x86;
           " />
 
-      <Crossgen2SupportedRids Include="@(Net60Crossgen2SupportedRids)" />
+      <Net70Crossgen2SupportedRids Include="@(Net60Crossgen2SupportedRids)" />
+
+      <Crossgen2SupportedRids Include="@(Net70Crossgen2SupportedRids)" />
+
+      <Crossgen2SupportedRids Remove="win-arm" />
 
       <!-- Match the Crossgen2 RIDs although some are currently not supported in NativeAOT. Its better for the SDK not to block on the RIDs and let NativeAOT manage the experience -->
-      <ILCompilerSupportedRids Include="@(Net60Crossgen2SupportedRids)" />
+      <Net70ILCompilerSupportedRids Include="@(Net60Crossgen2SupportedRids)" />
+
+      <ILCompilerSupportedRids Include="@(Net70ILCompilerSupportedRids)" />
+
+      <ILCompilerSupportedRids Remove="win-arm" />
 
       <NativeAOTRuntimePackRids Include="
           ios-arm64;
@@ -539,14 +561,14 @@ Copyright (c) .NET Foundation. All rights reserved.
                               TargetingPackName="Microsoft.NETCore.App.Ref"
                               TargetingPackVersion="$(_NET70TargetingPackVersion)"
                               RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.**RID**"
-                              RuntimePackRuntimeIdentifiers="@(NetCoreRuntimePackRids, '%3B')"
+                              RuntimePackRuntimeIdentifiers="@(Net70RuntimePackRids, '%3B')"
                               />
 
     <KnownAppHostPack Include="Microsoft.NETCore.App"
                       TargetFramework="net7.0"
                       AppHostPackNamePattern="Microsoft.NETCore.App.Host.**RID**"
                       AppHostPackVersion="$(_NET70RuntimePackVersion)"
-                      AppHostRuntimeIdentifiers="@(NetCoreAppHostRids, '%3B')"
+                      AppHostRuntimeIdentifiers="@(Net70AppHostRids, '%3B')"
                       ExcludedRuntimeIdentifiers="android"
                       />
 
@@ -554,14 +576,14 @@ Copyright (c) .NET Foundation. All rights reserved.
                         TargetFramework="net7.0"
                         Crossgen2PackNamePattern="Microsoft.NETCore.App.Crossgen2.**RID**"
                         Crossgen2PackVersion="$(_NET70RuntimePackVersion)"
-                        Crossgen2RuntimeIdentifiers="@(Crossgen2SupportedRids, '%3B')"
+                        Crossgen2RuntimeIdentifiers="@(Net70Crossgen2SupportedRids, '%3B')"
                         />
 
     <KnownILCompilerPack Include="Microsoft.DotNet.ILCompiler"
                          TargetFramework="net7.0"
                          ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler"
                          ILCompilerPackVersion="$(_NET70RuntimePackVersion)"
-                         ILCompilerRuntimeIdentifiers="@(ILCompilerSupportedRids, '%3B')"
+                         ILCompilerRuntimeIdentifiers="@(Net70ILCompilerSupportedRids, '%3B')"
                          />
 
     <KnownILLinkPack Include="Microsoft.NET.ILLink.Tasks"
@@ -577,7 +599,7 @@ Copyright (c) .NET Foundation. All rights reserved.
                       RuntimeFrameworkName="Microsoft.NETCore.App"
                       LatestRuntimeFrameworkVersion="$(_NET70RuntimePackVersion)"
                       RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.Mono.**RID**"
-                      RuntimePackRuntimeIdentifiers="@(MonoRuntimePackRids, '%3B')"
+                      RuntimePackRuntimeIdentifiers="@(Net70MonoRuntimePackRids, '%3B')"
                       RuntimePackLabels="Mono"
                       />
 
@@ -679,7 +701,7 @@ Copyright (c) .NET Foundation. All rights reserved.
                               TargetingPackName="Microsoft.NETCore.App.Ref"
                               TargetingPackVersion="$(_NET60TargetingPackVersion)"
                               RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.**RID**"
-                              RuntimePackRuntimeIdentifiers="@(NetCoreRuntimePackRids, '%3B')"
+                              RuntimePackRuntimeIdentifiers="@(Net60RuntimePackRids, '%3B')"
                               />
 
     <KnownAppHostPack Include="Microsoft.NETCore.App"
@@ -694,7 +716,7 @@ Copyright (c) .NET Foundation. All rights reserved.
                         TargetFramework="net6.0"
                         Crossgen2PackNamePattern="Microsoft.NETCore.App.Crossgen2.**RID**"
                         Crossgen2PackVersion="$(_NET60RuntimePackVersion)"
-                        Crossgen2RuntimeIdentifiers="@(Crossgen2SupportedRids, '%3B')"
+                        Crossgen2RuntimeIdentifiers="@(Net60Crossgen2SupportedRids, '%3B')"
                         />
 
     <KnownILLinkPack Include="Microsoft.NET.ILLink.Tasks"
@@ -710,7 +732,7 @@ Copyright (c) .NET Foundation. All rights reserved.
                       RuntimeFrameworkName="Microsoft.NETCore.App"
                       LatestRuntimeFrameworkVersion="$(_NET60RuntimePackVersion)"
                       RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.Mono.**RID**"
-                      RuntimePackRuntimeIdentifiers="@(MonoRuntimePackRids, '%3B')"
+                      RuntimePackRuntimeIdentifiers="@(Net60MonoRuntimePackRids, '%3B')"
                       RuntimePackLabels="Mono"
                       />