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

Consider switching from 7za to unarchiver #795

Closed
fasterthanlime opened this issue Jul 11, 2016 · 47 comments
Closed

Consider switching from 7za to unarchiver #795

fasterthanlime opened this issue Jul 11, 2016 · 47 comments
Labels
compatibility Can we make more games compatible with the app without them having to change anything? ui / ux Something graphical, something you experience

Comments

@fasterthanlime
Copy link
Collaborator

fasterthanlime commented Jul 11, 2016

maybe finally bringing rar support without silly license restrictions?

The Unarchiver is an OSX app that can extract various archive formats (see the Full list).

The underlying compression engine is open-source and cross-platform and has a command-line front-end. It's LGPL'd (including the unrar code), and available on bitbucket at: https://bitbucket.org/WAHa_06x36/theunarchiver/src

@fasterthanlime fasterthanlime added ui / ux Something graphical, something you experience compatibility Can we make more games compatible with the app without them having to change anything? labels Jul 11, 2016
@fasterthanlime
Copy link
Collaborator Author

Some research: it's a mercurial repository (cries), the engine is contained in the enigmatically-named XADMaster directory, there's Makefiles for linux & windows, and to get OSX binaries, one may simply do:

for scheme in lsar unar; do xcodebuild -configuration Release -workspace XADMaster.xcodeproj/project.xcworkspace -scheme $scheme -derivedDataPath build; done

Simply running xcodebuild without any arguments results in a failing build, as it's not able to find UniversalDetector.

Contrary to 7-zip, unarchiver provides two separate binaries for listing and extracting, both of which are around 5MB (debug), 2.5MB (release), 1.8MB (release stripped), and a .zip archive containing the both of them is 1.8MB (for comparison, the current OSX 7za binary we distribute is 969KB). That seems acceptable considering the added features.

otool -L output:

$ otool -L ~/Dev/theunarchiver/XADMaster/build/Build/Products/Release/unar
/Users/amos/Dev/theunarchiver/XADMaster/build/Build/Products/Release/unar:
        /usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1258.0.0)
        /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1258.1.0)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 728.9.0)

All of these (afaict) are built-ins on OSX, so shouldn't be an issue.

We might need to start depending on libbz2 and libz on Linux, but will be able to drop the p7zip dependency.

The generated unar is able to properly extract Momodora 1's rar file: https://rdein.itch.io/momodora-i (also, it runs under Wine! but that's another ticket..)

lsar has a detailed output mode with the -l flag:

/Users/amos/Downloads/Momodora.rar: RAR
     Flags  File size   Ratio  Mode  Date       Time   Name
     =====  ==========  =====  ====  ========== =====  ====
  0. -----        1024  49.6%  Ft29  2010-03-21 19:35  Momodora 1.5/CleanMem.dll
  1. -----       22561  90.1%  Ft29  2010-07-25 22:36  Momodora 1.5/cut.ini
  2. -----          13   0.0%  None  2010-07-21 14:52  Momodora 1.5/data/doll/press_f12_three_times.txt
  3. -----         670   0.0%  None  2010-07-31 00:33  Momodora 1.5/data/graphic/bg1.PNG
  4. -----         547   0.0%  None  2010-07-31 00:34  Momodora 1.5/data/graphic/bg2.PNG
  5. -----         611   0.0%  None  2010-07-31 00:34  Momodora 1.5/data/graphic/bg3.PNG
  6. -----         598   0.0%  None  2010-07-31 00:34  Momodora 1.5/data/graphic/bg4.PNG
  7. -----         410   0.0%  None  2010-07-31 00:34  Momodora 1.5/data/graphic/bg5.PNG
  8. -----         557   0.0%  None  2010-07-31 00:34  Momodora 1.5/data/graphic/bg6.PNG
  9. -----         575   0.0%  None  2010-07-31 00:34  Momodora 1.5/data/graphic/bg7.PNG
 10. -----         691   0.0%  None  2010-07-31 00:35  Momodora 1.5/data/graphic/bg8.PNG
 11. -----        3126  27.6%  Ft29  2010-07-31 00:14  Momodora 1.5/data/graphic/bg91.PNG
 12. -----        2598  45.0%  Ft29  2010-07-31 00:14  Momodora 1.5/data/graphic/bg92.PNG
 13. -----        2408  56.5%  Ft29  2010-07-31 00:15  Momodora 1.5/data/graphic/bg93.PNG
 14. -----        2364  57.3%  Ft29  2010-07-31 00:15  Momodora 1.5/data/graphic/bg94.PNG
 15. -----        3643  16.7%  Ft29  2010-07-31 00:15  Momodora 1.5/data/graphic/bg95.PNG
 16. -----       11872   0.1%  Ft29  2010-07-07 16:18  Momodora 1.5/data/graphic/title.PNG
 17. -----           0  -----  None  2012-02-21 01:33  Momodora 1.5/data/saves/slot1/dummy
 18. -----       43580  60.3%  Ft29  2009-11-22 05:33  Momodora 1.5/data/sound/bat.wav
 19. -----       27072  46.0%  Ft29  2009-11-20 17:30  Momodora 1.5/data/sound/bazooka.wav
 20. -----        6646   9.8%  Ft29  2010-06-25 21:38  Momodora 1.5/data/sound/boom.wav
 21. -----      492533   5.1%  Ft29  2010-12-13 14:54  Momodora 1.5/data/sound/boss.ogg
 22. -----        9074  12.5%  Ft29  2009-11-19 20:15  Momodora 1.5/data/sound/dorahit.wav
 23. -----      371231   5.9%  Ft29  2010-12-13 16:30  Momodora 1.5/data/sound/end1.ogg
 24. -----      920552   2.2%  Ft29  2010-12-13 16:33  Momodora 1.5/data/sound/end2.ogg
 25. -----       19606  31.3%  Ft29  2010-02-03 15:41  Momodora 1.5/data/sound/exp_s.wav
 26. -----      760982   3.8%  Ft29  2010-12-13 14:57  Momodora 1.5/data/sound/extra.ogg
 27. -----        3904   3.9%  Ft29  2010-06-25 21:14  Momodora 1.5/data/sound/fall.wav
 28. -----      598784   1.6%  Ft29  2010-12-13 14:57  Momodora 1.5/data/sound/finalboss.ogg
 29. -----       10906  17.8%  Ft29  2009-11-19 20:14  Momodora 1.5/data/sound/hit.wav
 30. -----       30584  30.9%  Ft29  2010-07-03 16:06  Momodora 1.5/data/sound/item.wav
 31. -----        3200   4.7%  Ft29  2009-12-21 20:34  Momodora 1.5/data/sound/jump.wav
 32. -----       16740  57.8%  Ft29  2010-08-05 17:59  Momodora 1.5/data/sound/laser.wav
 33. -----       39214  30.8%  Ft29  2009-11-19 20:15  Momodora 1.5/data/sound/loadsound.wav
 34. -----        6728   3.3%  Ft29  2010-07-03 15:42  Momodora 1.5/data/sound/matk1.wav
 35. -----       14756  27.8%  Ft29  2010-07-03 16:05  Momodora 1.5/data/sound/matk2.wav
 36. -----        3534   7.4%  Ft29  2010-02-21 01:25  Momodora 1.5/data/sound/menuclose.wav
 37. -----       13302  17.1%  Ft29  2010-02-21 01:28  Momodora 1.5/data/sound/menuopen.wav
 38. -----        8394   9.6%  Ft29  2010-07-31 15:58  Momodora 1.5/data/sound/notok2.wav
 39. -----        3454  13.7%  Ft29  2009-11-19 20:15  Momodora 1.5/data/sound/ok.wav
 40. -----       24778  21.4%  Ft29  2009-11-19 20:14  Momodora 1.5/data/sound/pick.wav
 41. -----       23104  21.0%  Ft29  2009-11-19 20:15  Momodora 1.5/data/sound/pickitem.wav
 42. -----       11398  18.1%  Ft29  2009-11-22 05:38  Momodora 1.5/data/sound/punch2.wav
 43. -----       18944  13.0%  Ft29  2010-06-25 21:34  Momodora 1.5/data/sound/savin.wav
 44. -----      144758  54.6%  Ft29  2010-05-22 10:24  Momodora 1.5/data/sound/scream1.wav
 45. -----        7752  63.4%  Ft29  2009-11-19 20:15  Momodora 1.5/data/sound/shooting.wav
 46. -----       48506  41.4%  Ft29  2010-07-03 16:15  Momodora 1.5/data/sound/shooting2.wav
 47. -----      679974   5.1%  Ft29  2010-12-13 14:54  Momodora 1.5/data/sound/stage1.ogg
 48. -----      490510   1.7%  Ft29  2010-12-13 15:00  Momodora 1.5/data/sound/stage2.ogg
 49. -----      953897   4.6%  Ft29  2010-12-13 16:12  Momodora 1.5/data/sound/stage3.ogg
 50. -----      591180   4.0%  Ft29  2010-12-13 16:14  Momodora 1.5/data/sound/stage4.ogg
 51. -----      705114  15.7%  Ft29  2010-12-13 16:22  Momodora 1.5/data/sound/stage5.ogg
 52. -----      478458   1.3%  Ft29  2010-12-13 16:23  Momodora 1.5/data/sound/stage6.ogg
 53. -----      617341   1.6%  Ft29  2010-12-13 16:25  Momodora 1.5/data/sound/stage7.ogg
 54. -----      659997   1.6%  Ft29  2010-12-13 16:28  Momodora 1.5/data/sound/stage8.ogg
 55. -----       20952  19.0%  Ft29  2010-06-25 21:34  Momodora 1.5/data/sound/tictac.wav
 56. -----      356723  16.2%  Ft29  2010-12-13 14:41  Momodora 1.5/data/sound/title.ogg
 57. -----        4577  42.2%  Ft29  2013-10-29 19:36  Momodora 1.5/data/sound/xxxx.ogg
 58. -----        1166  72.5%  Ft29  2014-09-14 12:24  Momodora 1.5/momo.config.ini
 59. -----     3020815  37.3%  Ft29  2014-09-14 18:59  Momodora 1.5/momodora1_v1.5.exe
 60. -----      109080  54.6%  Ft29  2011-02-20 02:15  Momodora 1.5/OpenAL32.dll
 61. -----        2652  42.3%  Ft29  2011-02-18 00:06  Momodora 1.5/README.txt
 62. -----      310272  42.1%  Ft29  2013-01-29 06:36  Momodora 1.5/SGAudio.dll
 63. -----      444952  55.1%  Ft29  2011-02-20 02:15  Momodora 1.5/wrap_oal.dll
 64. D----           0  -----  None  2014-09-14 13:16  Momodora 1.5/data/saves/slot1/
 65. D----           0  -----  None  2014-01-16 17:25  Momodora 1.5/data/doll/
 66. D----           0  -----  None  2014-01-16 17:37  Momodora 1.5/data/graphic/
 67. D----           0  -----  None  2014-09-14 13:13  Momodora 1.5/data/saves/
 68. D----           0  -----  None  2014-09-14 11:42  Momodora 1.5/data/sound/
 69. D----           0  -----  None  2014-09-14 13:13  Momodora 1.5/data/
 70. D----           0  -----  None  2014-09-14 13:27  Momodora 1.5/
(Flags: D=Directory, R=Resource fork, L=Link, E=Encrypted, @=Extended attributes)
(Mode: Ft29=Fastest v2.9)

This is non-trivial to parse, but possible (and most importantly, it seems the output format is constant).

unar accepts -f (force overwrite) and -o (output directory) options, and outputs file names as it extracts them:

/Users/amos/Downloads/Momodora.rar: RAR
  Momodora 1.5/CleanMem.dll  (1024 B)... OK.
  Momodora 1.5/cut.ini  (22561 B)... OK.
  Momodora 1.5/data/doll/press_f12_three_times.txt  (13 B)... OK.
  Momodora 1.5/data/graphic/bg1.PNG  (670 B)... OK.
  Momodora 1.5/data/graphic/bg2.PNG  (547 B)... OK.
  Momodora 1.5/data/graphic/bg3.PNG  (611 B)... OK.
  Momodora 1.5/data/graphic/bg4.PNG  (598 B)... OK.
  Momodora 1.5/data/graphic/bg5.PNG  (410 B)... OK.
  Momodora 1.5/data/graphic/bg6.PNG  (557 B)... OK.
  Momodora 1.5/data/graphic/bg7.PNG  (575 B)... OK.
  Momodora 1.5/data/graphic/bg8.PNG  (691 B)... OK.
  Momodora 1.5/data/graphic/bg91.PNG  (3126 B)... OK.
  Momodora 1.5/data/graphic/bg92.PNG  (2598 B)... OK.
  Momodora 1.5/data/graphic/bg93.PNG  (2408 B)... OK.
  Momodora 1.5/data/graphic/bg94.PNG  (2364 B)... OK.
  Momodora 1.5/data/graphic/bg95.PNG  (3643 B)... OK.
  Momodora 1.5/data/graphic/title.PNG  (11872 B)... OK.
  Momodora 1.5/data/saves/slot1/dummy  (0 B)... OK.
  Momodora 1.5/data/sound/bat.wav  (43580 B)... OK.
  Momodora 1.5/data/sound/bazooka.wav  (27072 B)... OK.
  Momodora 1.5/data/sound/boom.wav  (6646 B)... OK.
  Momodora 1.5/data/sound/boss.ogg  (492533 B)... OK.
  Momodora 1.5/data/sound/dorahit.wav  (9074 B)... OK.
  Momodora 1.5/data/sound/end1.ogg  (371231 B)... OK.
  Momodora 1.5/data/sound/end2.ogg  (920552 B)... OK.
  Momodora 1.5/data/sound/exp_s.wav  (19606 B)... OK.
  Momodora 1.5/data/sound/extra.ogg  (760982 B)... OK.
  Momodora 1.5/data/sound/fall.wav  (3904 B)... OK.
  Momodora 1.5/data/sound/finalboss.ogg  (598784 B)... OK.
  Momodora 1.5/data/sound/hit.wav  (10906 B)... OK.
  Momodora 1.5/data/sound/item.wav  (30584 B)... OK.
  Momodora 1.5/data/sound/jump.wav  (3200 B)... OK.
  Momodora 1.5/data/sound/laser.wav  (16740 B)... OK.
  Momodora 1.5/data/sound/loadsound.wav  (39214 B)... OK.
  Momodora 1.5/data/sound/matk1.wav  (6728 B)... OK.
  Momodora 1.5/data/sound/matk2.wav  (14756 B)... OK.
  Momodora 1.5/data/sound/menuclose.wav  (3534 B)... OK.
  Momodora 1.5/data/sound/menuopen.wav  (13302 B)... OK.
  Momodora 1.5/data/sound/notok2.wav  (8394 B)... OK.
  Momodora 1.5/data/sound/ok.wav  (3454 B)... OK.
  Momodora 1.5/data/sound/pick.wav  (24778 B)... OK.
  Momodora 1.5/data/sound/pickitem.wav  (23104 B)... OK.
  Momodora 1.5/data/sound/punch2.wav  (11398 B)... OK.
  Momodora 1.5/data/sound/savin.wav  (18944 B)... OK.
  Momodora 1.5/data/sound/scream1.wav  (144758 B)... OK.
  Momodora 1.5/data/sound/shooting.wav  (7752 B)... OK.
  Momodora 1.5/data/sound/shooting2.wav  (48506 B)... OK.
  Momodora 1.5/data/sound/stage1.ogg  (679974 B)... OK.
  Momodora 1.5/data/sound/stage2.ogg  (490510 B)... OK.
  Momodora 1.5/data/sound/stage3.ogg  (953897 B)... OK.
  Momodora 1.5/data/sound/stage4.ogg  (591180 B)... OK.
  Momodora 1.5/data/sound/stage5.ogg  (705114 B)... OK.
  Momodora 1.5/data/sound/stage6.ogg  (478458 B)... OK.
  Momodora 1.5/data/sound/stage7.ogg  (617341 B)... OK.
  Momodora 1.5/data/sound/stage8.ogg  (659997 B)... OK.
  Momodora 1.5/data/sound/tictac.wav  (20952 B)... OK.
  Momodora 1.5/data/sound/title.ogg  (356723 B)... OK.
  Momodora 1.5/data/sound/xxxx.ogg  (4577 B)... OK.
  Momodora 1.5/momo.config.ini  (1166 B)... OK.
  Momodora 1.5/momodora1_v1.5.exe  (3020815 B)... OK.
  Momodora 1.5/OpenAL32.dll  (109080 B)... OK.
  Momodora 1.5/README.txt  (2652 B)... OK.
  Momodora 1.5/SGAudio.dll  (310272 B)... OK.
  Momodora 1.5/wrap_oal.dll  (444952 B)... OK.
  Momodora 1.5/data/saves/slot1/  (dir)... OK.
  Momodora 1.5/data/doll/  (dir)... OK.
  Momodora 1.5/data/graphic/  (dir)... OK.
  Momodora 1.5/data/saves/  (dir)... OK.
  Momodora 1.5/data/sound/  (dir)... OK.
  Momodora 1.5/data/  (dir)... OK.
  Momodora 1.5/  (dir)... OK.
Successfully extracted to "./Momodora 1.5".

Thus, with a combination of lsar and unar, we can get 'extraction progress / ETA information'.

@fasterthanlime
Copy link
Collaborator Author

The next step is to set up a repository under github.com/itchio that contains a copy of unarchiver's source tree along with Gitlab CI scripts to build it and upload it to the ibrew archive server (cf. https://itch.io/docs/itch/installing/dependencies.html )

@fasterthanlime
Copy link
Collaborator Author

fasterthanlime commented Jul 11, 2016

So, I'm a bit of a CI fanboy ~~~these days~~~ this year, but considering that unarchiver requires GNUStep to build on Windows (and probably Linux), that's a lot of deps to impose on our CI build machines.

Besides, I don't expect the source code of unarchiver to change that often - I'll just include a cookbook in the repository, but not enable CI for it.

update installed the full GNUStep development suite, windows build is in progress, the tension is palpable:

screen shot 2016-07-11 at 18 02 38

update 2: windows build was a success, but the resulting .exe depends on a bunch of .dlls, will see if I can come up with a static build of some sort.

@fasterthanlime
Copy link
Collaborator Author

fasterthanlime commented Jul 12, 2016

Apparently shipping libstdc++'s dll is enough. Can someone confirm that they can run both lsar.exe and unar.exe from the attached archive? They're both signed with my certificate (Right click -> Properties -> Digital signatures tab to check) so you know it's me. Should be able to extract https://rdein.itch.io/momodora-i without issues.

(Warning: the archive contains 3 files that aren't into a specific folder, so it'll dump unar.exe, lsar.exe and a .dll wherever you extract them).

Download here: 📦 unarchiver.zip

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

@fasterthanlime Doesn't work for me. Both executables need libgcc_s_dw2-1.dll, objc-4.dll and gnustep-base-1_24.dll in addition to libstdc++-6.dll.

@fasterthanlime
Copy link
Collaborator Author

@quyse thanks! what tool did you use to find that out? I usually use ldd but it refused to run on those executables for some reason, and Dependency Walker is hit and miss.

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

@fasterthanlime I just run the executables, and Windows tells me everything in three consecutive message boxes :) Also I use Dependency Walker, sometimes it cannot find Windows system libs for no reason, but other than that it's usually helpful.

@fasterthanlime
Copy link
Collaborator Author

Hmmm maybe installing GNUStep modified my PATH environment variable.. that wouldn't be good. (and would explain why on my windows it does find gnustep-base-1_24.dll)

@fasterthanlime
Copy link
Collaborator Author

Hmmm maybe installing GNUStep modified my PATH environment variable..

Sure enough, it did...

Oh boy, 38mb's worth of DLLs later, here's a new archive

📦 unarchiver.zip

@alexnask
Copy link

I get no missing DLL errors but:

The application was unable to start correctly (0xc0000007b). Click OK to close the application.

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

Oh boy, 38mb's worth of DLLs later, here's a new archive

Still doesn't work, both need libffi-6.dll, libintl-8.dll and libxml2-2.dll. I see only 29.9 Mb of files after unpacking, maybe you forgot those?

@alexnask
Copy link

@quyse
Weird, I get the error I quoted above, so on my setup I guess stuff crashes before loading the libraries? :P

@fasterthanlime
Copy link
Collaborator Author

fasterthanlime commented Jul 12, 2016

I see only 29.9 Mb of files after unpacking

Yeah, 38mb was unstripped, I stripped them. I'll add those other three. But theunarchiver is increasingly looking like it's not really an option :( Although there are ways to reduce ICU data size to a few kbs (currently at 15MB).

@alexnask
Copy link

I'm pretty sure I've statically linked libstdc++ on mingw before too, although it seems to only be 957 KB, so I'm not sure it's worth it.
Haven't played around with GNUStep at all though so I don't know about the rest of the libraries.

@fasterthanlime
Copy link
Collaborator Author

With libffi, libintl, libxml2: 📦 unarchiver.zip

@alexnask
Copy link

Seems to run fine!

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

@fasterthanlime Yep, finally works, successfully extracted Momodora rar with unar.

@fasterthanlime
Copy link
Collaborator Author

fasterthanlime commented Jul 12, 2016

Phew! Now let's try building a smaller icu4c. Without libicudata, the archive size is down to 7MB which, I suppose, is reasonable to be able to extract anything and everything reliably?

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

maybe finally bringing rar support without silly license restrictions?

@fasterthanlime Sorry, what was the problem with official unrar library? Surely it's not free software as in free speech, but it's open source, and license agreement seem to be rather liberal. (And the library/exe is small). 7z also seem to include exactly that implementation for RAR support. Am I missing something?

@fasterthanlime
Copy link
Collaborator Author

@quyse well, the license restriction was my only objection to shipping a version of 7z that has unrar support. The fewer licenses I have to worry about, the better I feel! Since theunarchiver is LGPL all around, it's relatively easy to deal with.

So it's more of an idealistic/politics decision than a technical one.

@fasterthanlime
Copy link
Collaborator Author

fasterthanlime commented Jul 12, 2016

Quick status update: even though theunarchiver's code explicitly references ICU4C types and functions, it doesn't look like it's used at all in the Windows codepath. Instead, it's the default GNUStep distribution that uses it. I'm currently building a stripped-down version of gnustep-base to try and trim down the eventual size even further.

update 1: for example, libxml2 isn't actually necessary since theunarchiver only uses NSXMLParser and that doesn't use libxml2.

update 2: neither is libgnutls!

Steps so far:

  • run msys2 32-bit shell (32-bit binaries work on both 64 and 32-bit windows)
  • download and extract gnustep-make
  • follow build instructions for gnu make. Running make install creates /usr/GNUstep. source GNUstep environment file.
  • download and extract gnustep-base
  • install mingw-w64-i686-{gcc,gcc-objc,libffi,pkgconfig,libiconv} via pacman
  • current configure command line (confirmed working):
 ./configure --enable-libffi --with-default-config=/usr/GNUstep/Local/Configuration/GNUstep.conf --disable-xml --disable-tls --disable-icu
  • edit obj-c header to typedef int BOOL instead of typedef unsigned char BOOL so it won't conflict with minwindef.h (not sure about that one..)

In theunarchiver sources:

  • edit XADMaster/Makefile.windows and UniversalDetector/Makefile.windows to look for headers/libraries in /usr/GNUstep/Local/ instead of C:\GNUstep\GNUstep\System
  • while you're at it, replace -O2 with -Os and -g with -g0

@fasterthanlime
Copy link
Collaborator Author

If you folks want to help while I'm dealing with GNUStep's build system, preparing .zip and .rar archives with unicode file characters would help (french éàâç, cyrillic, japanese/chinese characters, etc.). I want to make sure that disabling libicu altogether doesn't prevent theunarchiver from extracting those (the documentation isn't entirely clear on that).

@fasterthanlime
Copy link
Collaborator Author

Oooh why do I see that only now, this is so good

screen shot 2016-07-12 at 17 03 52

One more reason to spend time getting theunarchiver working!

@fasterthanlime
Copy link
Collaborator Author

Update: successfully built unar.exe and lsar.exe with my custom-built GNUstep runtime! Extracts Momodora.rar just fine. unstripped exe size is about 7MB, similar to the others, I'll start DLL hunting now.

@fasterthanlime
Copy link
Collaborator Author

Update 2: still had the other GNUstep distribution in my path. Not so fast!

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

preparing .zip and .rar archives with unicode file characters would help

https://drive.google.com/folderview?id=0BwTCpCPC0rtuZjM0cGJNdTcxUXM&usp=sharing

@fasterthanlime
Copy link
Collaborator Author

fasterthanlime commented Jul 12, 2016

Wow okay when actually built against my runtime, -g0 and -Os, the binaries are 3.1MB, let's see what they depend on.

@fasterthanlime
Copy link
Collaborator Author

fasterthanlime commented Jul 12, 2016

All .exe + dll required are now 12MB uncompressed, Here's a 4.5MB archive that should hopefully work for you:

(edit: the .exes are above are not signed, let me know if you want me to sign them first)

@fasterthanlime
Copy link
Collaborator Author

(Note: when testing unarchiver-lite.zip, extract it into an empty directory, not over the other one, otherwise there'll be too many DLLs)

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

@fasterthanlime libffi-6.dll and zlib1.dll are missing :(

@fasterthanlime
Copy link
Collaborator Author

fasterthanlime commented Jul 12, 2016

Ah, those make sense! They're small though (36K & 92K)

@alexnask
Copy link

Works nicely (with the two dlls copied over from the previous build), tested the rar archive with the unicode characters from @quyse.

Good job!

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

Works nicely (with the two dlls copied over from the previous build)

Seem to work for me as well with all three archives (zip, 7z and rar)

@fasterthanlime
Copy link
Collaborator Author

Works nicely (with the two dlls copied over from the previous build), tested the rar archive with the unicode characters from @quyse.

You folks are stealing my job! 😸

Here's the (hopefully final) 32-bit build, with all DLLs, stripped and signed by me:

📦 unarchiver-windows-386.zip

Working on a 64-bit build now

@fasterthanlime
Copy link
Collaborator Author

Other helpful research would be:

  • How does unarchiver behave with tar.gz ? (I'd expect it to extract both in one go)
  • How does it work on naked .tar ? (we have some of those on itch.io)
  • Does it extract symlinks correctly? (gonna have to wait for non-windows builds for that).

@fasterthanlime
Copy link
Collaborator Author

Here's a 64-bit build, stripped, signed, and should have all DLLs:

📦 unarchiver-windows-amd64.zip

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

@fasterthanlime Both 32-bit and 64-bit final versions work for me for all test archives.

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

.tar.gz works (in one go), .tar works too.

Symlinks are getting skipped though. Got the following output:

>..\unarchive\unar testarchive.tar.gz
testarchive.tar.gz: Tar in Gzip
  testarchive/  (dir)... OK.
  testarchive/aaa/  (dir)... OK.
  testarchive/aaa/bbb.txt  (10 B)... OK.
  testarchive/ccc.txt  (link)... Failed! (File is not fully supported)
Extraction to directory "" failed (1 file failed.)

I've added testarchive.tar.gz with symlink inside (made on Linux) into the same shared folder on Google Drive.

@fasterthanlime
Copy link
Collaborator Author

Symlinks are getting skipped though.

On windows, that's normal — it would either have to create junctions (which can only point to absolute paths) or require superuser privilege

@fasterthanlime
Copy link
Collaborator Author

First linux build, for 32-bit, stripped, statically linked with a bunch of stuff (including minimal libicu), dynamically linked with libffi, libgnustep-base and libobjc, shipped along with it and with an RPATH of $ORIGIN, which means the dynamic linker will look into the executable's directory first.

Give that baby a try! You'll still need a 32-bit linux distro, the barer the better:

📦 unarchiver-linux-386.zip

(Not signed because signing binaries on Linux is not a thing apparently)

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

Give that baby a try! You'll still need a 32-bit linux distro, the barer the better

Checked on Arch Linux 64-bit (with additionally installed 32-bit system libs), works!

@fasterthanlime
Copy link
Collaborator Author

@quyse woo! even with non-ascii characters?

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

even with non-ascii characters?

@fasterthanlime yes!

@fasterthanlime
Copy link
Collaborator Author

And here's the 64-bit build, same build workflow:

📦 unarchiver-linux-amd64.zip

@quyse
Copy link
Contributor

quyse commented Jul 12, 2016

64-bit build works for me too, tested with all archives 👍

@fasterthanlime
Copy link
Collaborator Author

Just uploaded all builds as an ibrew repository to https://dl.itch.ovh/

Example install: GET https://dl.itch.ovh/unarchiver/windows-amd64/LATEST to get latest version, GET https://dl.itch.ovh/unarchiver/windows-amd64/v1.10.1/unarchiver.tar.gz.

This is a new format of ibrew package (previously there was naked executable and 7z), and will also require having its subdirectory added to $PATH (in addition to the top-level itch/bin ibrew install directory).

Here's the complete ibrew repository structure:

.
├── darwin-amd64
│   ├── LATEST
│   └── v1.10.1
│       ├── unarchiver
│       │   ├── lsar
│       │   └── unar
│       └── unarchiver.tar.gz
├── linux-386
│   ├── LATEST
│   └── v1.10.1
│       ├── unarchiver
│       │   ├── libffi.so.5
│       │   ├── libgnustep-base.so.1.24
│       │   ├── libobjc.so.4
│       │   ├── lsar
│       │   └── unar
│       └── unarchiver.tar.gz
├── linux-amd64
│   ├── LATEST
│   └── v1.10.1
│       ├── unarchiver
│       │   ├── libffi.so.5
│       │   ├── libgnustep-base.so.1.24
│       │   ├── libobjc.so.4
│       │   ├── lsar
│       │   └── unar
│       └── unarchiver.tar.gz
├── windows-386
│   ├── LATEST
│   └── v1.10.1
│       ├── unarchiver
│       │   ├── gnustep-base-1_24.dll
│       │   ├── libffi-6.dll
│       │   ├── libgcc_s_dw2-1.dll
│       │   ├── libiconv-2.dll
│       │   ├── libobjc-4.dll
│       │   ├── libstdc++-6.dll
│       │   ├── libwinpthread-1.dll
│       │   ├── lsar.exe
│       │   ├── unar.exe
│       │   └── zlib1.dll
│       └── unarchiver.tar.gz
└── windows-amd64
    ├── LATEST
    └── v1.10.1
        ├── unarchiver
        │   ├── gnustep-base-1_24.dll
        │   ├── libbz2-1.dll
        │   ├── libffi-6.dll
        │   ├── libgcc_s_seh-1.dll
        │   ├── libiconv-2.dll
        │   ├── libobjc-4.dll
        │   ├── libstdc++-6.dll
        │   ├── libwinpthread-1.dll
        │   ├── lsar.exe
        │   ├── unar.exe
        │   └── zlib1.dll
        └── unarchiver.tar.gz

15 directories, 43 files

@fasterthanlime
Copy link
Collaborator Author

This is going really really well! Adding .tar.gz formulas was dead simple (and doesn't require any v8 bindings), I even cleaned up ibrew's code a bit while I was at it.

Adding unarchiver support to util/extract was super simple too (I just messed up path normalization on win32 at first), I removed a bunch of the .rar checks already, now to remove all the 7-zip cruft.

Things I'm happy to see go:

  • Dealing with two completely different output formats between 7-zip 9.20 and 15.x
  • Linux build of itch depending on p7zip-full
  • 7-zip formula having this weird osWhitelist thing (I'll completely remove ibrew support for that)
  • Us shipping binaries we haven't compiled directly (barring Electron)
  • Dependency on file(1) — I still have to test my theory but I think lsar might be able to identify everything we were previously using file(1) for.
  • The countless compatibility reports about not being able to play .rar games

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Can we make more games compatible with the app without them having to change anything? ui / ux Something graphical, something you experience
Projects
None yet
Development

No branches or pull requests

3 participants