Skip to content

Fix UPX and pacman-conf warnings in Microsoft Git's release build (and make the UI tests more robust) - #781

Merged
dscho merged 4 commits into
mainfrom
fix-release-sdk-dependencies
Nov 28, 2026
Merged

dscho merged 4 commits into
mainfrom
fix-release-sdk-dependencies

Conversation

@dscho

@dscho dscho commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Microsoft Git's release build uses bundled MinGit, whose PATH lacks DLLs required by upx.exe (which is now used to unpack the large DLLs). Unlike the Git for Windows SDKs' ci-artifacts run, which uses a full Git for Windows shell (where these dependencies are in the PATH anyway), this caused upx.exe to fail loading its runtime dependencies.

The release setup now discovers those DLL dependencies and extracts them next to upx.exe, without hard-coding their names.

While at it, this PR also adds pacman-conf.exe to the sparse list to avoid pactree's startup warning (pactree source).

The separate SDK repositories' .sparse/makepkg-git lists are unchanged. Changing those lists is not urgent and I will hopefully get to it later.

Since this PR (in addition to this run and that run) failed the UI tests, it's also quite obvious that I need to make them more robust; Let's do that to get the PR build green (and to get the other runs green, too).

@dscho
dscho marked this pull request as draft November 27, 2026 20:07
@dscho dscho changed the title Fix UPX and pacman-conf warnings in Microsoft Git's release build Fix UPX and pacman-conf warnings in Microsoft Git's release build (and make the UI tests more robust) Nov 27, 2026
dscho added a commit that referenced this pull request Nov 27, 2026
In #781, the
installer UI Git Bash Start-menu test failed with the AutoHotkey 2.0.31
release zip but passed with 2.0.19 on both x64 and ARM64. Other inputs
may have changed, so this does not establish a root cause.

This temporary run checks whether the failure recurs with the
MSYS2-packaged 2.0.31 instead. Use preinstalled Git to avoid the
expensive SDK and installer jobs, and try 30 Start-menu and Enter
launches per architecture, closing each created mintty.

On ARM64, run the x64 UCRT64 package under emulation: the MSYS2 index
lists no CLANGARM64 AutoHotkey package:
https://packages.msys2.org/search?t=binpkg&q=autohotkey

Assisted-by: GPT-6 Sol
Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Nov 27, 2026
The 2.0.19 release zip passed the installer UI tests, while the
MSYS2-packaged 2.0.31 left SearchHost in the foreground on preinstalled
Git x64 after two Enter attempts. Other inputs differed, so those results
cannot establish that the interpreter version caused the failure.

This temporary experiment for
#781 compares
release zips across versions with the same preinstalled Git. Preserve
each version's result and screenshot even when other jobs fail, so
the results can be compared manually.

Assisted-by: GPT-6 Sol
Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Nov 27, 2026
The x64 job in
https://github.com/git-for-windows/build-extra/actions/runs/46073553672
left SearchHost in the foreground after two Enter attempts and did not
open mintty within 20 seconds. An earlier passing run changed other
inputs as well as the AutoHotkey version, so it does not establish a
version regression.

Replace the temporary version matrix with a focused AutoHotkey 2.0.32
run. If the launch fails after 30 attempts, use Copilot CLI on that
same runner to investigate and upload a diagnosis without archiving
its session or tokens.

This is temporary diagnostic work for
#781.

Assisted-by: GPT-6 Sol
Signed-off-by: Johannes Schindelin <[email protected]>
Since e29591b (create-sdk-artifact: check out large DLLs unpacked),
the new worktree's clean/smudge filter runs the SDK's own `upx.exe`.
That executable is not self-contained, though. The x86_64 one needs
libstdc++-6.dll and libgcc_s_seh-1.dll, which in turn need
libwinpthread-1.dll. The arm64 one needs libc++.dll. All of these live
in the very directory that the filter is checking out, so `upx.exe`
can only load them if the caller already has them on its PATH.

Under a full Git for Windows, it does. MinGit leaves out
libgcc_s_seh-1.dll and libc++.dll on purpose, so under MinGit it does
not. microsoft/git's release build runs `please.sh create-sdk-artifact`
from the MinGit that comes bundled with the Azure Pipelines agent. In
that build, the smudge filter exited with status 127, which is how an
MSYS shell reports a Windows program that failed to load a DLL, and the
checkout aborted:

	fatal: ucrt64/bin/libLLVM-23.dll: smudge filter upx failed

To fix this, copy the DLLs that `upx.exe` needs next to it in the
worktree's private gitdir. Windows looks for DLLs in the executable's
own directory first, so the filter no longer depends on the caller's
PATH. A hard-coded list would differ between the two SDKs and would
silently break whenever those dependencies change. Instead, discover
the DLLs from the SDK commit itself: look inside the binaries for DLL
names that also exist in the SDK's bin/ directory (which skips system
DLLs), and repeat this for every newly found DLL. The search uses
`git grep` because MinGit ships neither `strings` nor `objdump`.

Signed-off-by: Johannes Schindelin <[email protected]>
Every `build-installers` run printed dozens of bogus errors like this:

	/bin/sh: line 1: pacman-conf: command not found

They are harmless in that the file list still came out right, but they
are misleading: they were the first thing that looked suspicious while
investigating an unrelated failure in a release build.

To compute the file list of an SDK artifact, `build-installers` runs
`make-file-list.sh` in a small checkout of the SDK. That script calls
`pactree` once per package, and at startup `pactree` always asks
`pacman-conf` for the database path (see
https://gitlab.archlinux.org/pacman/pacman-contrib/-/blob/master/src/pactree.c#L619),
but that program was not part of the small checkout. `pactree` then
silently falls back to its compiled-in default path, which happens to be
correct.

Including `pacman-conf.exe` in the checkout makes the errors go away and
pulls in nothing else: the program needs only the MSYS2 runtime and
`/etc/pacman.conf`, both of which are already checked out. As a bonus,
`pactree` now uses the configured database path, so it no longer depends
on the default being correct.

Signed-off-by: Johannes Schindelin <[email protected]>
The UI test that tries to launch Git Bash via the Start Menu seems to
fail semi-randomly with "Git Bash window did not appear after Start Menu
launch". One screenshot shows Git Bash selected while Windows search
remains foreground, but does not establish why Enter was ineffective:
https://github.com/git-for-windows/build-extra/actions/runs/46055406181/job/140696635913

In a controlled experiment where I investigated whether the used
AutoHotKey version could have been the problem, this bug happened 3 out
of 14 times. That's too flaky for a robust test.

Significantly, it is always the first time it fails, all subsequent
attempts to launch Git Bash via the Start Menu succeed: The problem
seems to be the search index being cold. So let's simulate pressing the
Enter key up to 10 times, waiting for the Start Menu window to disappear
up to 5 seconds each time.

While at it, also switch from using `SendEvent` to `SendInput` for
Enter, matching query delivery. AutoHotkey documents the latter as
generally more reliable: https://www.autohotkey.com/docs/v2/lib/Send.htm

Assisted-by: GPT-6.1 Sol
Signed-off-by: Johannes Schindelin <[email protected]>
Just because there's an update means I have to update, right? :-D

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
dscho force-pushed the fix-release-sdk-dependencies branch from 6373a54 to c2362f4 Compare November 28, 2026 08:14
@dscho
dscho marked this pull request as ready for review November 28, 2026 08:26
@dscho
dscho merged commit 3372d40 into main Nov 28, 2026
18 checks passed
@dscho
dscho deleted the fix-release-sdk-dependencies branch November 28, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant