-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add the mingw-w64-7zip
package
#13894
Conversation
clang builds fail with |
MSYS2 does offer the `p7zip` package. But it is an MSYS package (and therefore the executable is slower than it needs to be), and besides, the p7zip project seems to be abandoned since 2016. In the meantime, the 7-Zip project itself added support for building the command-line tool on Linux, and we can use that very same setup to build a MINGW version, too. So let's do that. Signed-off-by: Johannes Schindelin <[email protected]>
awesome. msys2-installer uses a 7z sfx, is it possible to build that here rather than downloading a binary from elsewhere? |
Suggested-by: Jeremy Drake <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
I guess it is possible to build that, too ;-) |
@jeremyd2019 please do note, though, that this seems not to include |
might be a worthwhile tradeoff to be able to use an sfx built here. |
I switched it to zstd for faster decompression/installation: msys2/msys2-installer#37 But if the external download is a concern, I'm fine with reverting that. |
For future reference, arm64 failed with:
I'm going to disable it for now. |
doesn't build, see #13894 (comment)
Strange. I specifically fixed the ARM64 build yesterday, by disabling some overzealous errors... |
Now that we have a working definition, we could add the patch to add zstd support... |
From a quick look the fork only added it to the MSVC build scripts, so that would need some extra work. Upstream seems to be working on zstd support though, so we could also just wait for that: mcmilk/7-Zip-zstd#271 |
@lazka that's probably the safest. I did have a quick look at the diff between 7-Zip and 7-Zip-zstd and it looks quite large, in particular because it also brings brotli, fast-lzma2, lizard and updated icons (see for yourself: git-for-windows/7-Zip@f8a8f0d). Also, I am not quite sure about licensing, it looks as if zstd is under the GPL but 7-Zip-zstd seems to ignore that and treat it as LGPL. But IANAL nor I do I want to be. So the best would most likely be to keep using the current binary download of |
Hmm, I just googled it and it looked like clang was supposed to support that construct. @mstorsjo do you know a reason it wouldn't on windows/mingw? Or do we need to patch it to use a different way to enable crc instructions for clang there? EDIT: clang was supposed to support that construct in |
It looks like this exact format of the attribute does work in latest git of clang, but not in the current 15.0 release. Using I've bisected down the interesting changes between 15.0 and the current git main branch; it's primarily llvm/llvm-project@781b491 which affects this, while llvm/llvm-project@30b67c6 also has a bit of an effect here:
and
|
So maybe patching it to use |
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 <[email protected]>
MSYS2 does offer the
p7zip
package. But it is an MSYS package (and therefore the executable is slower than it needs to be), and besides, the p7zip project seems to be abandoned since 2016.In the meantime, the 7-Zip project itself added support for building the command-line tool on Linux, and we can use that very same setup to build a MINGW version, too. So let's do that.
Note that there is only a
7z.exe
, no7za.exe
. That's because the 7-Zip project never bothered with a shared library ;-)