From 08c7692eef887185f6818951528f4dc9a03b985c Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Wed, 4 Nov 2026 11:52:22 -0500
Subject: [PATCH v15a 2/5] ci: Make msys2 install smaller

We only needed git and diffutils installed via pacman because the already
installed tools were hidden by the login script resetting PATH. "Fix" that
instead by telling msys to leave the old PATH around.

Also don't install libbacktrace, it is not needed at the moment.

Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/a2ejn7lfqolutzz7kozalbhy3bixdrujb4buc3pgbtlk4am2ba@wbv6v7riia33
Discussion: https://postgr.es/m/CAN55FZ1BcWBsWgCCk2GQkYN6tzDxCw2hVK2m3qeiwaNXUnjLVg@mail.gmail.com
Backpatch-through: 19
---
 .github/workflows/pg-ci.yml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/pg-ci.yml b/.github/workflows/pg-ci.yml
index bf32729c703..9d62db95188 100644
--- a/.github/workflows/pg-ci.yml
+++ b/.github/workflows/pg-ci.yml
@@ -1065,6 +1065,11 @@ jobs:
       CCACHE_SLOPPINESS: pch_defines,time_macros
       CCACHE_DEPEND: 1
 
+      # We don't want using an msys bash to "hide" all the other already
+      # installed tools, that would require us to install tools into msys that
+      # are already available otherwise.
+      MSYS2_PATH_TYPE: inherit
+
     defaults:
       run:
         shell: 'D:\msys64\usr\bin\bash.exe --login -eo pipefail "{0}"'
@@ -1095,11 +1100,10 @@ jobs:
           # MSYS2. It dynamically expands to the correct prefix for the active
           # shell environment.
           pacman -S --noconfirm --needed  --asdeps \
-            git bison flex diffutils \
+            bison flex \
             ${MINGW_PACKAGE_PREFIX}-ccache \
             ${MINGW_PACKAGE_PREFIX}-gcc \
             ${MINGW_PACKAGE_PREFIX}-icu \
-            ${MINGW_PACKAGE_PREFIX}-libbacktrace \
             ${MINGW_PACKAGE_PREFIX}-libxml2 \
             ${MINGW_PACKAGE_PREFIX}-libxslt \
             ${MINGW_PACKAGE_PREFIX}-lz4 \
-- 
2.56.0.307.g50fe5cc63f

