Skip to content

Reduce MinGit's size a little #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 2, 2021
Merged

Conversation

dscho
Copy link
Member

@dscho dscho commented Jun 30, 2021

Together with git-for-windows/MINGW-packages#52, this addresses a couple of concerns raised in git-for-windows/git#1439 (comment) (and subsequent comments on that ticket).

In msys2/MSYS2-packages@325eedfc14 (a rather
monster-type of a huge change), the build-time dependency `tcl` was
upgraded to a full-scale runtime dependency of all SQLite packages,
including `libsqlite`.

This is most likely a bug (which was easy to miss, given the amount of
changes accumulated in that big patch), as `tcl` is still marked as a
runtime dependency of the `tcl-sqlite` package (which is still correct).

But `tcl` is not required to use `libsqlite`, which `openssh` does, and
therefore we now have this useless baggage we have to shlep around.

Let's exclude it manually.

Noticed in
git-for-windows/git#1439 (comment)

Signed-off-by: Johannes Schindelin <[email protected]>
@ur4t
Copy link

ur4t commented Jul 1, 2021

There are three parts in package diffutils: binaries, locales and docs. While locales and docs are stripped out, we can exclude the package diffutils directly instead of excluding its binaries one by one.

@dscho
Copy link
Member Author

dscho commented Jul 1, 2021

There are three parts in package diffutils: binaries, locales and docs. While locales and docs are stripped out, we can exclude the package diffutils directly instead of excluding its binaries one by one.

Good point!

dscho added 4 commits July 1, 2021 11:52
The BusyBox-variant of MinGit ships with `cmp` and `diff` by virtue of
being BusyBox applets.

Besides, `cmp.exe` and friends were not working anyway because of
missing msys-iconv-2.dll and msys-intl-8.dll.

Signed-off-by: Johannes Schindelin <[email protected]>
This requires git-for-windows/MINGW-packages#52
to work, and reduces the `.zip` file by about one megabyte
(`git-remote-http.exe` weighs two megabytes that compress by about 50%
in a `.zip` file).

Signed-off-by: Johannes Schindelin <[email protected]>
Some programs, such as OpenSSH, require the environment variable `SHELL`
to contain an absolute path to an executable. No extra arguments
allowed.

However, BusyBox' `ash` would need to be called like this:

	<mingit>\mingw64\bin\busybox.exe sh [...]

If the `sh` is omitted, only mayhem will ensue.

To allow for setting `SHELL` in such a manner, we taught the good ole'
Git wrapper to stand in. That is, if the Git wrapper detects that it is
run with the base name `ash.exe` (or `sh.exe`), it will try to spawn
BusyBox' `ash` with the same argument, wait for the command to conclude,
and then exit with the same exit code.

Let's use this version of the Git wrapper, if we have it.

This requires git-for-windows/MINGW-packages#52
to work, and allows e.g. using a `ProxyCommand` with OpenSSH, after
setting `SHELL` to point to the `ash.exe` file.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho force-pushed the reduce-mingits-size branch from 7c22364 to 798fe1c Compare July 1, 2021 09:53
@dscho dscho merged commit 046ce2b into git-for-windows:main Jul 2, 2021
@dscho dscho deleted the reduce-mingits-size branch July 2, 2021 13:13
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.

2 participants