Skip to content

git-extra.install.in: fix failures when run outside Pacman#717

Merged
dscho merged 4 commits into
mainfrom
fix-git-extra-install
Jun 19, 2026
Merged

git-extra.install.in: fix failures when run outside Pacman#717
dscho merged 4 commits into
mainfrom
fix-git-extra-install

Conversation

@dscho

@dscho dscho commented Jun 17, 2026

Copy link
Copy Markdown
Member

When please.sh sources the install script and calls post_install directly (as it does during MinGit and installer builds), neither Pacman's $arch variable nor builtins.txt-listed files are guaranteed to exist. This causes two distinct failures that surfaced when testing UCRT64 git-artifacts builds:

The first commit guards the builtin-replacement rm with test ! -f so that the loop does not fail when installing git-extra into a fresh prefix where no prior Git installation exists. Without the guard, every builtin listed in builtins.txt produces a "No such file or directory" error that cascades into please.sh's die "Could not install packages".

The second commit replaces the three remaining $arch shell variable references (a bintray URL migration, the pacman sync database rename loop, and the i686 libunistring workaround) with the @@MSYSTEM_CARCH@@ build-time template variable. These were missed in 50464f3 ("git-extra: hard-code which Pacman repositories to add at build-time"). The most visible symptom was a test: syntax error: '-e' unexpected crash at line 270 of the installed script, because the unquoted test i686 = $arch expanded to test i686 = -a -e ... when $arch was empty.

dscho added 2 commits June 17, 2026 17:45
When git-extra is installed into a fresh prefix (as happens during
the MinGit build), the builtins listed in `builtins.txt` do not
exist yet under `libexec/git-core/` because Git has not been
installed at that prefix before. The unconditional `rm` fails for
every single builtin, producing a wall of "No such file or
directory" errors.

Guard the `rm` with `test ! -f ... ||` so the loop only removes
files that actually exist, and the `ln` always runs to create the
hardlink regardless.

Assisted-by: Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Commit 50464f3 ("git-extra: hard-code which Pacman repositories to
add at build-time") converted most runtime `$arch` references to the
build-time template variable `@@MSYSTEM_CARCH@@`, but three were
missed: the bintray-to-wingit URL migration (line 88), the pacman
sync database rename loop (lines 99/101), and the i686 libunistring
workaround (line 270).

The `$arch` variable is not set when `please.sh` sources the install
script and calls `post_install` directly (as it does during
MinGit/installer builds), which makes the unquoted `test i686 =
$arch` on line 270 expand to `test i686 = -a -e ...` and causes a
syntax error. The other two references silently produced wrong paths.

Replace all three with the `@@MSYSTEM_CARCH@@` template variable,
which is expanded at package build time to the correct value.

Assisted-by: Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho

dscho commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

/updpkgsums

The workflow run was started.

dscho added 2 commits June 17, 2026 15:56
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Assisted-by: Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho

This comment was marked as resolved.

@dscho

dscho commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

/deploy git-extra

The i686/x86_64 and the arm64 workflow runs were started.

@dscho dscho merged commit 015df0e into main Jun 19, 2026
10 checks passed
@dscho dscho deleted the fix-git-extra-install branch June 19, 2026 12:40
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