Bug 14171

Summary: [feature request] zip program
Product: Busybox Reporter: Vadim Kantorov <vadimkantorov>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Vadim Kantorov 2021-08-22 18:49:35 UTC
Compressing "zip" utility would be useful (e.g. so that this archive could be opened on Windows without installing additional software) to have in addition to existing "unzip".

For my usecase I rolled my own https://github.com/vadimkantorov/busyz (as busybox applet in https://github.com/busytex/busyide/blob/main/busyz.c) using https://github.com/richgel999/miniz
Comment 1 Denys Vlasenko 2021-10-07 23:31:25 UTC
miniz.c is WAY too large.

$ cc -Os -c miniz.c 
miniz.c:3079:9: note: ‘#pragma message: Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.’
 3079 | #pragma message("Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.")
      |         ^~~~~~~
$ size miniz.o 
   text	   data	    bss	    dec	    hex	filename
  57201	      0	      0	  57201	   df71	miniz.o

For comparison, existing busybox code to handle zip file format:
$ size unzip.o 
   text	   data	    bss	    dec	    hex	filename
   3799	      0	      0	   3799	    ed7	unzip.o
gzip decompressor per se:
$ size libarchive/decompress_gunzip.o
   text	   data	    bss	    dec	    hex	filename
   4950	      0	      0	   4950	   1356	libarchive/decompress_gunzip.o
and the gzip compression code:
$ size gzip.o 
   text	   data	    bss	    dec	    hex	filename
   5854	      0	      0	   5854	   16de	gzip.o

I would prefer something like 15kb or less of code to support .zip file creation. Not 57kb.