git-extra.install.in: fix failures when run outside Pacman#717
Merged
Conversation
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>
Member
Author
|
/updpkgsums The workflow run was started. |
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Assisted-by: Opus 4.6 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
/deploy git-extra The i686/x86_64 and the arm64 workflow runs were started. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
please.shsources the install script and callspost_installdirectly (as it does during MinGit and installer builds), neither Pacman's$archvariable norbuiltins.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
rmwithtest ! -fso that the loop does not fail when installinggit-extrainto a fresh prefix where no prior Git installation exists. Without the guard, every builtin listed inbuiltins.txtproduces a "No such file or directory" error that cascades intoplease.sh'sdie "Could not install packages".The second commit replaces the three remaining
$archshell 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 atest: syntax error: '-e' unexpectedcrash at line 270 of the installed script, because the unquotedtest i686 = $archexpanded totest i686 = -a -e ...when$archwas empty.