TheTechsTech/node-7z-archive

Two unawailable 7-Zip executables break windows-latest tests

Closed this issue · 8 comments

Hello,

When trying to fix the issue with failing windows-latest tests, I accidentally found out that two slightly outdated 7-Zip executables specified in installer.mjs are no longer available on the official 7-Zip website (see below).

https://d.7-zip.org/a/7z1701.exe
404 Not Found

https://d.7-zip.org/a/7z1701-extra.7z
404 Not Found

I suspected that the windows-latest tests might be failing for that reason, so I temporarily replaced the filenames 7z1701.exe and 7z1701-extra.7z in installer.mjs with 7z1900.exe and 7z1900-extra.7z, respectively, and reinstalled the dependencies by running the npm ci command. After that, all of the previously failing tests on my Windows machine succeeded (though the TypeScript compiler still complained as before, but that was expected).

7-Zip 17.01 is no longer mentioned on the Download page of the official 7-Zip website. The only versions available for downloading there are 22.01, 21.07, 19.00, 16.04, and 9.20. As for any other versions, the page says that they are available on SourceForge.

Please fix the broken links to the outdated 7-Zip executables in installer.mjs, otherwise some of the windows-latest tests will most surely continue to fail.

Regards,
Rashid

I haven't been keeping up, do a separate PR on that.

Do you mean I should fix the broken links in installer.mjs? Sure, I can replace them with direct links like these:

https://downloads.sourceforge.net/project/sevenzip/7-Zip/17.01/7z1701.exe?ts=gAAAAABjvjOY2dG84FOnec9Ahu3iH_1pehTAwKW_2S326RTD7PvuQ6nKDxxhUqEpp7-Gz5nqER-eIJRuxIorXMdK23LVFSzn3A%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fsevenzip%2Ffiles%2F7-Zip%2F17.01%2F7z1701.exe%2Fdownload

https://downloads.sourceforge.net/project/sevenzip/7-Zip/17.01/7z1701-extra.7z?ts=gAAAAABjvjOvWqhQgrAJ7VfxYCH6VSjDg2AoVqPpYzLt1nT4Mn5_vI5Ht0jrx-Tu4lb0qrjoNtR1Gd4hhuhkpWThVgVBs4B-cw%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fsevenzip%2Ffiles%2F7-Zip%2F17.01%2F7z1701-extra.7z%2Fdownload

However, I suspect that such links may expire soon enough. Perhaps it might be better to add the currently unavailable 7-Zip executables to the repo (though adding binaries to a repo seems to be bad practice), or to keep them somewhere else for easy downloading, making sure that direct links never expire. But that's not up to me to decide.

P.S. By the way, the Download page of the official 7-Zip website says that 7-Zip is available for Linux and MacOS. The latest version available for Linux is 22.01 (2022-07-15). The latest version available for MacOS is 21.07 (2021-12-26).

I temporarily changed the parameters url, filename, and extraName of the windowsOtherPlatform object in installer.mjs to https://downloads.sourceforge.net/project/sevenzip/7-Zip/17.01/, 7z1701.exe?ts=gAAAAABjvjOY2dG84FOnec9Ahu3iH_1pehTAwKW_2S326RTD7PvuQ6nKDxxhUqEpp7-Gz5nqER-eIJRuxIorXMdK23LVFSzn3A%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fsevenzip%2Ffiles%2F7-Zip%2F17.01%2F7z1701.exe%2Fdownload, and 7z1701-extra.7z?ts=gAAAAABjvjOvWqhQgrAJ7VfxYCH6VSjDg2AoVqPpYzLt1nT4Mn5_vI5Ht0jrx-Tu4lb0qrjoNtR1Gd4hhuhkpWThVgVBs4B-cw%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fsevenzip%2Ffiles%2F7-Zip%2F17.01%2F7z1701-extra.7z%2Fdownload, respectively. After I reinstalled the dependencies, all of the tests succeeded on my machine. I'm not sure about the longevity of the SourceForge download links, though.

The whole process should be automated that's the reason for this repo from original fork, everything is done at install time. No separate steps. And I was focusing on self extracting feature on different platforms.

Try replacing with 1604 version. And sourceforge direct links needs to be figured out they don't make it easy, but it's doable.

Try replacing with 1604 version. And sourceforge direct links needs to be figured out they don't make it easy, but it's doable.

Using the links https://www.7-zip.org/a/7z1604.exe and https://www.7-zip.org/a/7z1604-extra.7z fixed the issue with failing tests. I'll make a commit soon.

P.S. Done.

This should be in a separate PR. Typescript support was recently added by another contributor, didn't notice any issues then.

But i really didn't look at logs if the build didn't fail, So not sure those issues now showing in GitHub Actions logs was already there.

I've created a new PR for all the changes, including both broken link fixes and minor changes (mostly code refactoring).

All good, a new npm package has been published.