From ce4d891ca96097faf9e4e0f0773afd2debcaf6d2 Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Mon, 11 Dec 2023 14:50:20 -0700
Subject: [PATCH 01/11] Clean vcpkg downloads and buildtrees after building
 each package.

---
 .github/actions/build-with-host/action.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index 75f5a149..f7a94f55 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -43,7 +43,7 @@ runs:
 
   - name: Install vcpkg dependencies with Github Actions Cache
     if: ${{ inputs.vcpkg-binarycache == 'true' }}
-    run: vcpkg install --binarysource="clear;x-gha,readwrite"
+    run: vcpkg install --binarysource="clear;x-gha,readwrite" --clean-buildtrees-after-build --clean-downloads-after-build
     shell: pwsh
 
   - name: CMake Configure

From 495b544fb89060bffbdccb5094f576cebd5773de Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Mon, 11 Dec 2023 15:36:59 -0700
Subject: [PATCH 02/11] Try a full clean.

---
 .github/actions/build-with-host/action.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index f7a94f55..c4f22a72 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -43,7 +43,7 @@ runs:
 
   - name: Install vcpkg dependencies with Github Actions Cache
     if: ${{ inputs.vcpkg-binarycache == 'true' }}
-    run: vcpkg install --binarysource="clear;x-gha,readwrite" --clean-buildtrees-after-build --clean-downloads-after-build
+    run: vcpkg install --binarysource="clear;x-gha,readwrite" --clean-after-build
     shell: pwsh
 
   - name: CMake Configure

From 7bf7c46c50ff02de07b305b8f998e3a66c2a2622 Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Tue, 12 Dec 2023 09:58:02 -0700
Subject: [PATCH 03/11] Try moving vcpkg default binary cache to larger C
 drive.

---
 .github/actions/build-with-host/action.yml | 5 ++++-
 CMakePresets.json                          | 8 ++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index c4f22a72..12a26b7d 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -40,10 +40,13 @@ runs:
       script: |
         core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
         core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
+        core.exportVariable('VCPKG_DEFAULT_BINARY_CACHE ', 'C:/vcpkg/archives');
 
   - name: Install vcpkg dependencies with Github Actions Cache
     if: ${{ inputs.vcpkg-binarycache == 'true' }}
-    run: vcpkg install --binarysource="clear;x-gha,readwrite" --clean-after-build
+    run: |
+      New-Item -Path ${env:VCPKG_DEFAULT_BINARY_CACHE} -ItemType Directory -Force
+      vcpkg install --binarysource="clear;files,x-gha,readwrite"
     shell: pwsh
 
   - name: CMake Configure
diff --git a/CMakePresets.json b/CMakePresets.json
index 8c0a8b0c..a55937d4 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -93,6 +93,14 @@
                 "dev"
             ]
         },
+        {
+            "name": "dev-windows-arm64",
+            "displayName": "Development (ARM64)",
+            "inherits": [
+                "dev-windows"
+            ],
+            "architecture": "arm64"
+        },
         {
             "name": "release-base",
             "hidden": true,

From 1329d54fa83287b1a36dc8be3229dd79dd56b5b8 Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Tue, 12 Dec 2023 10:21:12 -0700
Subject: [PATCH 04/11] Set env var correctly.

---
 .github/actions/build-with-host/action.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index 12a26b7d..d479b7a7 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -30,6 +30,7 @@ inputs:
     required: false
     default: 'true'
     description: 'Use the vcpkg binary cache'
+
 runs:
   using: 'composite'
   steps:
@@ -40,11 +41,12 @@ runs:
       script: |
         core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
         core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
-        core.exportVariable('VCPKG_DEFAULT_BINARY_CACHE ', 'C:/vcpkg/archives');
+        core.exportVariable('VCPKG_DEFAULT_BINARY_CACHE', 'VCPKG_DEFAULT_BINARY_CACHE');
 
   - name: Install vcpkg dependencies with Github Actions Cache
     if: ${{ inputs.vcpkg-binarycache == 'true' }}
     run: |
+      echo "VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_DEFAULT_BINARY_CACHE}" >> "${GITHUB_ENV}"
       New-Item -Path ${env:VCPKG_DEFAULT_BINARY_CACHE} -ItemType Directory -Force
       vcpkg install --binarysource="clear;files,x-gha,readwrite"
     shell: pwsh

From 127586880ac9a01cfc74c3e7036b670d3149a787 Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Tue, 12 Dec 2023 10:23:50 -0700
Subject: [PATCH 05/11] Fix variable value.

---
 .github/actions/build-with-host/action.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index d479b7a7..fd791b79 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -41,7 +41,7 @@ runs:
       script: |
         core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
         core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
-        core.exportVariable('VCPKG_DEFAULT_BINARY_CACHE', 'VCPKG_DEFAULT_BINARY_CACHE');
+        core.exportVariable('VCPKG_DEFAULT_BINARY_CACHE', 'C:/vcpkg/archive');
 
   - name: Install vcpkg dependencies with Github Actions Cache
     if: ${{ inputs.vcpkg-binarycache == 'true' }}

From 276d635af14d18def625ad7be7ffd4c7b939e015 Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Tue, 12 Dec 2023 10:27:12 -0700
Subject: [PATCH 06/11] Actually use the variable in the vcpkg install command.

---
 .github/actions/build-with-host/action.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index fd791b79..46561359 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -48,7 +48,7 @@ runs:
     run: |
       echo "VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_DEFAULT_BINARY_CACHE}" >> "${GITHUB_ENV}"
       New-Item -Path ${env:VCPKG_DEFAULT_BINARY_CACHE} -ItemType Directory -Force
-      vcpkg install --binarysource="clear;files,x-gha,readwrite"
+      vcpkg install --binarysource="clear;files,${VCPKG_DEFAULT_BINARY_CACHE},x-gha,readwrite"
     shell: pwsh
 
   - name: CMake Configure

From d0f8b52b1393bc649a8960665cd1bb5331ed9d51 Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Tue, 12 Dec 2023 10:30:47 -0700
Subject: [PATCH 07/11] Add default vcpkg binary caching provder.

---
 .github/actions/build-with-host/action.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index 46561359..e59d5f4d 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -48,7 +48,7 @@ runs:
     run: |
       echo "VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_DEFAULT_BINARY_CACHE}" >> "${GITHUB_ENV}"
       New-Item -Path ${env:VCPKG_DEFAULT_BINARY_CACHE} -ItemType Directory -Force
-      vcpkg install --binarysource="clear;files,${VCPKG_DEFAULT_BINARY_CACHE},x-gha,readwrite"
+      vcpkg install --binarysource="clear;default,x-gha,readwrite"
     shell: pwsh
 
   - name: CMake Configure

From f87a7421a8c68480fcaeeeb75a4ab5cd0b26521f Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Tue, 12 Dec 2023 10:34:46 -0700
Subject: [PATCH 08/11] Fix syntax.

---
 .github/actions/build-with-host/action.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index e59d5f4d..e2084341 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -48,7 +48,7 @@ runs:
     run: |
       echo "VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_DEFAULT_BINARY_CACHE}" >> "${GITHUB_ENV}"
       New-Item -Path ${env:VCPKG_DEFAULT_BINARY_CACHE} -ItemType Directory -Force
-      vcpkg install --binarysource="clear;default,x-gha,readwrite"
+      vcpkg install --binarysource="clear;default;x-gha,readwrite"
     shell: pwsh
 
   - name: CMake Configure

From abba12a3bc68f3225bf9a11bdc7f9cc56a5328fd Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Tue, 12 Dec 2023 11:27:37 -0700
Subject: [PATCH 09/11] Use GHA vcpkg binary cache source exclusively for
 build.

---
 .github/actions/build-with-host/action.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index e2084341..28e1ecfc 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -49,6 +49,7 @@ runs:
       echo "VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_DEFAULT_BINARY_CACHE}" >> "${GITHUB_ENV}"
       New-Item -Path ${env:VCPKG_DEFAULT_BINARY_CACHE} -ItemType Directory -Force
       vcpkg install --binarysource="clear;default;x-gha,readwrite"
+      echo "VCPKG_BINARY_SOURCES=clear;x-gha" >> "${GITHUB_ENV}"
     shell: pwsh
 
   - name: CMake Configure

From 978637535b444e9b24dbd198e7dd2ec9198ba56a Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Tue, 12 Dec 2023 11:56:51 -0700
Subject: [PATCH 10/11] Try GHA only binary cache.

---
 .github/actions/build-with-host/action.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/actions/build-with-host/action.yml b/.github/actions/build-with-host/action.yml
index 28e1ecfc..4a4a306f 100644
--- a/.github/actions/build-with-host/action.yml
+++ b/.github/actions/build-with-host/action.yml
@@ -42,14 +42,14 @@ runs:
         core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
         core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
         core.exportVariable('VCPKG_DEFAULT_BINARY_CACHE', 'C:/vcpkg/archive');
+        core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite');
 
   - name: Install vcpkg dependencies with Github Actions Cache
     if: ${{ inputs.vcpkg-binarycache == 'true' }}
     run: |
       echo "VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_DEFAULT_BINARY_CACHE}" >> "${GITHUB_ENV}"
+      echo "VCPKG_BINARY_SOURCES=${VCPKG_BINARY_SOURCES}" >> "${GITHUB_ENV}"
       New-Item -Path ${env:VCPKG_DEFAULT_BINARY_CACHE} -ItemType Directory -Force
-      vcpkg install --binarysource="clear;default;x-gha,readwrite"
-      echo "VCPKG_BINARY_SOURCES=clear;x-gha" >> "${GITHUB_ENV}"
     shell: pwsh
 
   - name: CMake Configure

From 9b6f3b4f8b17f8e68fc5fa59fca3acee3327a7bf Mon Sep 17 00:00:00 2001
From: Andrew Beltrano <abeltrano@gmail.com>
Date: Tue, 12 Dec 2023 12:44:40 -0700
Subject: [PATCH 11/11] Undo arm preset change.

---
 CMakePresets.json | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/CMakePresets.json b/CMakePresets.json
index a55937d4..8c0a8b0c 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -93,14 +93,6 @@
                 "dev"
             ]
         },
-        {
-            "name": "dev-windows-arm64",
-            "displayName": "Development (ARM64)",
-            "inherits": [
-                "dev-windows"
-            ],
-            "architecture": "arm64"
-        },
         {
             "name": "release-base",
             "hidden": true,