Conversation
|
I just tried applying this to a copy of NSIS 3.11 I have and it seems to have several major conflicts, especially in the Contrib/zip2exe changes. One example is that the compression selector logic is more generic as of 0b7a3fe |
|
Any update for this? |
| Only in zstd-1.5.6/lib/: BUCK | ||
| diff -ru zstd-1.5.6/lib/common/mem.h zstd/common/mem.h | ||
| --- zstd-1.5.6/lib/common/mem.h 2024-03-21 23:05:51.000000000 +0100 | ||
| +++ zstd/common/mem.h 2025-01-28 22:46:51.545505900 +0100 |
There was a problem hiding this comment.
To document source changes from the zstd release - so they can be rebased when updating the zstd version. The existing 7z implementation also has a diff: https://github.com/NSIS-Dev/nsis/blob/master/Source/7zip/sdk.diff
There was a problem hiding this comment.
This is... impractical. I'd rather leave versioning stuff to the VCS. Can't there be a commit importing external library and then showing what's changed there by means of subsequent commits?
There was a problem hiding this comment.
Ideally zstd should be a git submodule, so rebasing to newer versions of zstd would be straightforward.
However the actual development still happens on sourceforge, and they use svn.
I'm not involved with the project, you have to raise it with the maintainers on sourceforge, this is just a mirror.
|
It appears there are a lot of new files not relevant to zstd itself - mostly in mathlib? Some diff files that I wouldn't expect to see in such PR, asm inlines, commented out new lines for scons, it seems zstd is compiled in multiple times (for tests and for the main executable), reserved identifiers are abused... Some of these might make sense, but certainly requires good inspection. |
|
Oh, I know... Everything "as far as I remember", things may have changed since I implemented this patch over 5 years ago. The problem is that nsis still targets Windows 95. Which means either getting MSVC6.SP5 (released 2001) to compile the ZSTD source code OR getting the output of a modern MSVC to run on Windows 95. I've taken the second approach. Fundamentally, exehead is compiled without dependency on a C runtime (MS CRT, /nodefaultlib) (and modern CRT wouldn't run on Win95 anyway), so any 'reserved identifiers' must be reimplemented if they are used. The biggest headache is the Math plugin which makes heavy use of the C runtime - so if you want to preserve that, you need to add a whole mathlib into the codebase. My recommendation is to drop Win95 support, at least for the Math plugin. As you say, it feels wrong to add 50k LOC of near unreadable floating point math, just to maintain compatibility with a 30 year old OS. I don't have time for it these days - if you do want to take this on, you need to have a conversation with the maintainers over on sourceforge: https://sourceforge.net/p/nsis/patches/317/ |
|
That clears things up a bit, thanks. I'd love to see zstd support added, but why keep win95 support? I can see the thrill of getting something working on such obsolete system, but to burden the vast majority of users on fairly modern systems with over 30 years of baggage in a quite widely used software? Is there any justification provided or is it just the bragging rights? Is there a plan to sunset support for those systems? I don't see much movement in this repo, is it still alive? PRs not getting for over 5 years (#16) is not a good sign either. Just some things I'd like to have cleared up before trying to work on this. |
|
For our use case (LegacyUpdate), dropping Windows 95 support would be bad if it also drops support for Windows NT 4.0. We provide a program that allows the retro computing community as well as industrial systems to be able to reconnect to Windows Update currently on Windows 2000 and later, but eventually including NT 4.0. @kirb can chime in some more here as well regarding our use case |
|
Isn't the current nsis 3.11 enough for that? I don't suggest invalidating past versions. Even if zstd became available, would it actually affect you, would you realistically recreate all your redistributables with that? I've also checked https://legacyupdate.net/stats and there is not one entry for windows 95, 98, ME nor nt 4.0. LegacyUpdate does not provide new software, the catalogue of available updates to win9x is closed. No new software comes out supporting those systems and it's getting harder to target windows 7, just yesterday I learned that after switching a project to VS2026 we can no longer support anything pre-win10. We still maintain a fork targeting windows 5.1, because having this code upstream is not something we want to burden our users and other developers with. |
|
@janisozaur My concern would be how the codebase will change should early OSes be dropped. We build our project with modern mingw-w64 13/gcc 15.2 on Linux, including our own build of NSIS (Debian’s exehead crashes on 486/Pentium since it defaults to I’m also aware of other semi-active projects using NSIS to target Win9x, such as dotnet9x, though we probably rely a lot more heavily on NSIS than them. With that said, a compromise to release a primary build on a newer toolchain, while still maintaining a special build still using the Server 2003 PSDK without zstd support, could be fine. My suggestion would be a Windows 7 or 8.1-era DDK, which I believe should target Windows 2000 RTM and later. Visual Studio is problematic because it would want to dynamically or statically link a versioned build of msvcrt, when the user may not yet have it installed. |
|
So do I read your comment right:
? Let's assume this is the case and we all agree to that and decide to move forward. But I don't see any |
|
Also - what is exehead? I see it in the repo, but it lacks any readme or other explanation |
|
It’s not a decision I can make - just a potential suggestion if anyone wants to bring it up on SourceForge to help this get merged (this repo is a mirror of the SVN repo over there), since it seems like a safe/tidy compromise. I haven’t yet tested whether linking msvcrt.dll is sufficient to make libzstd work though. exehead is the binary that gets output containing the NSIS runtime, which has the compiled script and installation files merged into it. |
Picking up on #16
The first two commits integrate zstd compression into NSIS
exeheadis extended to decompressing multiple files in parallel#ifndef EXEHEADto strip unused features and reduce code size of the stubsSetCompressionLevelscript command to control compression level for zstd (and zlib)The newest 5 commits make everything Windows 95 compatible. Getting zstd to compile on VC6 would be a lot of work, and those changes would make updating zstd impractical - on the other hand, getting a EXE compiled by modern MSVC to run on Win95 is relatively easy:
libmandxprintf