Repository: microsoft/terminal (language: cpp)

Issue:
Ship Microsoft.Terminal.Wpf for ARM64
When we first shipped PTC, we started with x86. It would have been easier -- from a build pipeline standpoint, and from an ease-of-shipping standpoint -- to just do all of our architectures at the same time.


Discussion / hints:

Fix patch:
diff --git a/OpenConsole.sln b/OpenConsole.sln
index 45613781537..f6644269257 100644
--- a/OpenConsole.sln
+++ b/OpenConsole.sln
@@ -2115,6 +2115,7 @@ Global
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|Any CPU.ActiveCfg = Debug|Win32
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|ARM.ActiveCfg = Debug|Win32
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|ARM64.ActiveCfg = Debug|ARM64
+		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|ARM64.Build.0 = Debug|ARM64
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|DotNet_x64Test.ActiveCfg = Debug|x64
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|DotNet_x64Test.Build.0 = Debug|x64
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Debug|DotNet_x86Test.ActiveCfg = Debug|Win32
@@ -2133,6 +2134,7 @@ Global
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|Any CPU.ActiveCfg = Release|Win32
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|ARM.ActiveCfg = Release|Win32
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|ARM64.ActiveCfg = Release|ARM64
+		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|ARM64.Build.0 = Release|ARM64
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|DotNet_x64Test.ActiveCfg = Release|x64
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|DotNet_x64Test.Build.0 = Release|x64
 		{84848BFA-931D-42CE-9ADF-01EE54DE7890}.Release|DotNet_x86Test.ActiveCfg = Release|Win32
diff --git a/build/pipelines/release.yml b/build/pipelines/release.yml
index bbe1d0570b7..79294c56cb7 100644
--- a/build/pipelines/release.yml
+++ b/build/pipelines/release.yml
@@ -208,7 +208,6 @@ jobs:
   - ${{ if eq(parameters.buildWPF, true) }}:
     - task: VSBuild@1
       displayName: Build solution **\OpenConsole.sln for PublicTerminalCore
-      condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64'))
       inputs:
         solution: '**\OpenConsole.sln'
         vsVersion: 16.0
@@ -262,7 +261,6 @@ jobs:
   - ${{ if eq(parameters.buildWPF, true) }}:
     - task: CopyFiles@2
       displayName: Copy PublicTerminalCore.dll to Artifacts
-      condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64'))
       inputs:
         Contents: >-
           **/PublicTerminalCore.dll
@@ -273,7 +271,6 @@ jobs:
         flattenFolders: true
     - task: PublishBuildArtifacts@1
       displayName: Publish Artifact (PublicTerminalCore)
-      condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64'))
       inputs:
         PathtoPublish: $(Build.ArtifactStagingDirectory)/wpf
         ArtifactName: wpf-dll-$(BuildPlatform)-$(BuildConfiguration)-$(TerminalTargetWindowsVersion)
@@ -381,31 +378,26 @@ jobs:
       displayName: Package ES - Setup Build
       inputs:
         disableOutputRedirect: true
-    - task: DownloadBuildArtifacts@0
-      displayName: Download x86 PublicTerminalCore
-      inputs:
-        artifactName: wpf-dll-x86-$(BuildConfiguration)-Win10
-        itemPattern: '**/*.dll'
-        downloadPath: bin\Win32\$(BuildConfiguration)\
-        extractTars: false
-    - task: DownloadBuildArtifacts@0
-      displayName: Download x64 PublicTerminalCore
-      inputs:
-        artifactName: wpf-dll-x64-$(BuildConfiguration)-Win10
-        itemPattern: '**/*.dll'
-        downloadPath: bin\x64\$(BuildConfiguration)\
-        extractTars: false
+    - ${{ each platform in parameters.buildPlatforms }}:
+      - task: DownloadBuildArtifacts@0
+        displayName: Download ${{ platform }} PublicTerminalCore
+        inputs:
+          artifactName: wpf-dll-${{ platform }}-$(BuildConfiguration)-Win10
+          itemPattern: '**/*.dll'
+          downloadPath: bin\${{ platform }}\$(BuildConfiguration)\
+          extractTars: false
     - task: PowerShell@2
-      displayName: Move downloaded artifacts up a level
+      displayName: Move downloaded artifacts around
       inputs:
         targetType: inline
         # Find all artifact files and move them up a directory. Ugh.
-        script: >-
+        script: |-
           Get-ChildItem bin -Recurse -Directory -Filter wpf-dll-* | % {
             $_ | Get-ChildItem -Recurse -File | % {
               Move-Item -Verbose $_.FullName $_.Directory.Parent.FullName
             }
           }
+          Move-Item bin\x86 bin\Win32
     - task: NuGetToolInstaller@1
       displayName: Use NuGet 5.10.0
       inputs:
diff --git a/src/cascadia/WpfTerminalControl/WpfTerminalControl.csproj b/src/cascadia/WpfTerminalControl/WpfTerminalControl.csproj
index 7b074d86889..e47e5224865 100644
--- a/src/cascadia/WpfTerminalControl/WpfTerminalControl.csproj
+++ b/src/cascadia/WpfTerminalControl/WpfTerminalControl.csproj
@@ -50,6 +50,14 @@
         <Pack>true</Pack>
         <PackagePath>runtimes\win-x64\native\</PackagePath>
       </None>
+      <None Include="$(RepoBinPath)\ARM64\$(Configuration)\PublicTerminalCore.dll">
+        <Pack>true</Pack>
+        <PackagePath>runtimes\win-arm64\native\</PackagePath>
+      </None>
+      <None Include="$(RepoBinPath)\ARM64\$(Configuration)\api-ms-win-core-synch-l1-2-0.dll">
+        <Pack>true</Pack>
+        <PackagePath>runtimes\win-arm64\native\</PackagePath>
+      </None>
     </ItemGroup>
   </Target>
 


Test patch: