-
Notifications
You must be signed in to change notification settings - Fork 76
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
Windows builds do not handle 2+ GB .cab files properly #103
Comments
Thanks for discovering this! The Windows build is a pain with all these build systems and if I make unshield build with one of them, it seems another one breaks. But I digress. It should be pretty easy to make a PR for this I hope. |
I can try to refactor the CMake buildscripts, they look bit messy and non standard conformant. There are many helpful features that would make configuration and build cleaner and portable. |
@kpyrkosz I'd really appreciate it! The CMake stuff is contributed to replace my own autofoo scripts, and then slightly improved and somewhat broken... :/ And the AppVeyor build is broken: https://ci.appveyor.com/project/twogood/unshield
|
zlib is the big pain on Windows. I'm open to include its source code with unshield to make the build self-contained. |
The branch https://github.com/kpyrkosz/unshield/tree/wip/updating-cmake contains minimal modifications which make windows build the program and not break linux build. Tested with msvc 2019, clang 12 and mingw gcc 6.3. The current build does not handle the big cabfiles yet, first I'd like to achieve portability and write sensible CI scripts (I have never used appveyor nor travis but always wanted to learn them, so that my chance to kill two birds with one stone :) ), then do the fixing. I am not issuing pull request yet, I'd like to have the CI up and running first. |
@kpyrkosz Please disable Mac OS X builds in .travis.yml on your branch, I'm working on updating that in another PR |
The problem with windows CI is the fact that zlib is not preinstalled on the travis machines and the built-in package manager... does not support the zlib. |
@kpyrkosz I guess that's why the AppVeyor configuration uses scoop to install zlib and not chocolatey like Travis. But if you can use vcpkg om both Travis and AppVeyor it would be nice! Or we only use Travis and not AppVeyor. I like how you think about the combinations of builds. |
But for Windows, maybe the most important thing is to be able to provide an unshield.exe to people who do not happen to have a dev environment setup :) |
@kpyrkosz I probably caused a merge conflict with your .travis.yml now but I can sort that out later |
I spent literally entire day pushing with appveyor and i got nowhere lol. |
@kpyrkosz Sorry to hear that! Maybe we should try to get zlib into Travis Windows environment? |
I've written appveyor script for windows builds but vcpkg has temporary issue with some zlib dependency... |
Hey it's both fast and green :) On Linux tests are enabled and passing in all configurations, on windows all 3 compilers are building 4 variants variants each but i wasn't running the test suite in the CI yet. I'm using git bash on my win machine, the test suite is runnable after tiny patches but for some reason |
Great job!!!!!! The CVE-2015-1386 directory traversal test will fail if not executed on GNU libc, I don't have a good solution for other libc's yet. The star is actually mentioned in the man page:
So I guess that |
Wow, the number of warnings from clang on Windows... |
That's clang's According to |
Oh Yes, the correct would be to use
|
How do we merge your xcode and my linux builds in travis? |
I think you can probably look at my xcode changes and incorporate them easily in .travis.yml in your branch, otherwise I can look at it in a few days |
The branch has a merge conflict in CMakeLists.txt ... does fixing this issue require altering the build system? Does not compile on linux. I guess something like this could solve the issue: #ifdef _WIN32
#define ftell _ftelli64
#define fseek _fseeki64
long long unshield_fsize(FILE* file);
#else
long unshield_fsize(FILE* file);
#endif |
OpenSSL is a huge lib, there is no reason to use it if only md5 is required, the internal md5.c is more than enough. OpenSSL only makes sense if using advanced encryption stuff, if the bundled md5.c works as expected, all references to openssl should be removed. There are simple libs compatible with zlib that would be easy to integrate into the project, so that all deps are compiled statically, and cmake/windows stuff is simplified. |
The appveyor Windows build config must be somewhere else, running a test in my repo, it complains that the config is missing or something, so I had to disable appveyor to keep the green check. So far I managed to make all Travis UNIX builds work... FreeBSD, macOS and 4 linux arch's including s390x (big endian) |
Appveyor failed builds do not appear as failed in GitHub. Must be something with the build script I guess? |
I guess the appVeyor config is outside the repo, I think it needs the Travis Windows builds mingw GCC 8 MSVC (Visual Studio 2017) throws many warnings with -Wall GCC and Clang provide proper C support, MSVC is a C++ compiler that only supported C89 for a long time, with Visual Studio 2017, it still doesn't properly support C99, probably comparable to gcc in 2001. |
I agree that that the minimum CMake support must be bumped to 3.x, the main CMakeLists.txt has this line: but lib/CMakeLists.txt has this... so yeah that is the true minimum version ... cmake 3.6... Debian Stretch has cmake 3.7.2 (2017) It's quite obvious that only recent cmake versions can do what the old autotools did back in 2005, I re-implemented autotools support but I'm yet add a commit to my repo, so with both build systems, support for old and new OSs is guaranteed. But only autotools provides easy cross-compilations, only with configure switches. |
I thought we were on CMake 3 already... :) |
This is crazy, I managed to run the test suite on Windows (run-tests.sh), MinGW on Windows produces a proper unshield: MSVC produces a mostly OK unshield, only This is without |
can you please upload artifacts from this? |
Hello. I've built the unshield on linux and extracted a 3GB big .cab without problems, on windows the unpacking process stops with error at about 70%. The problematic part is the size used by fseek and ftell is of type long, which on windows (both 32 and 64 bit) is defined as a 4 bit type, but
reader->file_descriptor->data_offset
is an unit64_t. I've tried patching both functions to_fseeki64
and_ftelli64
(these are windows-exclusive if I'm not mistaken) and then the big cabfile is properly extracted on windows.The text was updated successfully, but these errors were encountered: