Skip to content
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

Use newer 7z #527

Merged
merged 2 commits into from
Sep 11, 2023
Merged

Use newer 7z #527

merged 2 commits into from
Sep 11, 2023

Conversation

dscho
Copy link
Member

@dscho dscho commented Aug 25, 2023

Instead of using an aging p7zip, we can now use 7-Zip directly!

This needs to wait for #526 to be merged, because it is based on that PR to avoid merge conflicts.

dscho added 2 commits August 25, 2023 17:00
This commit not only updates the SFX component, but adds another one,
too. The reason is that `7zSD.sfx`, the component we used to use all the
time, is supposed to be linking to Microsoft's C runtime dynamically
(the "D" stands for "DLL" or "dynamic").

And it used to be the case, right until we fixed that bug that was
reported in git-for-windows/git#1127, where
the runtime we linked against was `vcruntime140.dll`, which is
unfortunately not ubiquituous.

We then fixed that via the commit at
git-for-windows/7-Zip@3ba0e05a95b5 that was
unfortunately incorrect: all it did was change the `7zSD.sfx` from
linking dynamically to the C runtime to linking statically. But that'
exactly the only difference between `7zSD.sfx` and `7zS.sfx`.

Undoing that mistake, I used the opportunity of the sync with 7-Zip
v23.01 to build `7zSD.sfx` so it links dynamically again. Since we need
the statically-linked version, I also built `7zS.sfx` and copied it into
`build-extra`, and then updated all the locations where we used
`7zSD.sfx` by mistake.

These artifacts come straight from
https://github.com/git-for-windows/7-Zip/actions/runs/5977124234#artifacts,
built from the commit c77d78f7 (Merge branch 'readme', 2023-08-25) in
the `v32.01-VS2022-sfx` branch of
https://github.com/git-for-windows/7-Zip.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Back in the days, 7-Zip was only a Windows GUI program, and p7zip was
started as a fork to provide a CLI program that could also be compiled
and used on Linux. Since it was easier to port p7zip than 7-Zip to
MSYS2, we used the former to build the PortableGit, and even to squeeze
out more compression for the MinGit `.zip`.

Sadly, p7zip is languishing. The latest version of that project is from
2016: https://sourceforge.net/projects/p7zip/files/.

Happily, 7-Zip was modified in the meantime to allow building CLI
programs on Linux, and based on that support, I was able to port it to
MSYS2: msys2/MINGW-packages#13894.

Yesterday, I updated it to match 7-Zip v23.01:
msys2/MINGW-packages#18254, and this is as fine
an opportunity as any to start moving away from a stale p7zip.

This should also be a bit quicker, as we're moving from an MSYS2
`7za.exe` to a MINGW `7z.exe`.

Also, 7-Zip v23.01 improved the compression. Not by a whole lot
(PortableGit shrank by about 200kB, which is not much given that the
entire file is around 57MB to begin with), but hey, it's something.

Note: The change to `portable/release.sh` is a bit more complicated
because 1) the command-line got too long (MSYS2 side-steps the 32-kB
length limit by playing games with shared memory), and 2) the absolute
path needs to be provided as a _Windows_ path now, not as a pseudo-Unix
path.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Aug 25, 2023
@dscho dscho marked this pull request as ready for review September 10, 2023 08:38
@dscho dscho merged commit ed84486 into git-for-windows:main Sep 11, 2023
@dscho dscho deleted the use-newer-7z branch September 11, 2023 07:03
rimrul added a commit to rimrul/git that referenced this pull request Oct 11, 2023
We've switched from p7zip to regular 7-Zip recently[1][2][3].
With that we don't need to monitor p7zip for updates anymore, but
we want to stay informed about 7-Zip updates now. Change the feed
accordingly. Since the new feed contains 15 different files as
separate items for the latest 7-Zip update, aggregate them into a
single issue.

[1] git-for-windows/build-extra#526
[2] git-for-windows/build-extra#527
[3] git-for-windows/build-extra#530

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
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