Getting a crc and size into the local header requires setting it
before writing the payload, or using a streaming data header after
the payload with the crc and size. Stored (uncompressed) entries
are not allowed to use a streaming data header.
Symlinks are always stored uncompressed, so set the crc and size
in the file header before writing the payload.
Also set the mode to 0777 to match the behavior of zip.
This relands I66c5d41f0a5b23b828d6a03a3790afedc5a97625 with fixes
for the size and mode.
Test: m checkbuild
Test: zipdetails on zip with symlink created with soong_zip has same
crc in local header and central header.
Test: Compare zipdetails output of zip containing symlink created
by soong_zip and by zip --symlinks -X.
Bug: 110716403
Change-Id: Iec0bc9056a0d9cdab76f015844aca9c711e72e5b
This reverts commit b88c4dfb87.
This made it worse, now that the local header crc matches the global
header, unzip will attempt to unzip the symlink. However, the local
header size is still incorrect, so it produces an empty file instead
of a symlink.
Bug: 110716403
Change-Id: Ifd9aabc04d180b7ead4aec8566c151206b6b7c57
Getting a crc into the local header requires setting it before writing
the payload, or using a streaming data header after the payload with
the crc. Stored (uncompressed) entries are not allowed to use a
streaming data header.
Symlinks are always stored uncompressed, so set the crc in the file
header before writing the payload.
Test: m checkbuild
Test: zipdetails on zip with symlink created with soong_zip has same
crc in local header and central header.
Bug: 110716403
Change-Id: I66c5d41f0a5b23b828d6a03a3790afedc5a97625
Sometime the size of our command line passed to soong_zip go program
exceeds the cmdline size limit. So add an RespFile support with "@" special
character prefix.
The args in the cmdline will be considered together with the
args in RespFile during soong_zip running.
Test: real tests in my local machine, and compare the
res/libphonenumber.jar before and after changes.
./cmd -o test.zip '""'-C -> [./cmd,-o,test.zip,""-C]
./cmd -o test.zip '-C -f -> [./cmd,-o,test.zip,-C -f]
./cmd -o test.zip '\"'-C -f -> [./cmd,-o,test.zip,\"-C -f]
./cmd -o test.zip '\\'-C -f -> [./cmd,-o,test.zip,\\-C -f]
./cmd -o test.zip '\a'-C -f -> [./cmd,-o,test.zip,\a-C -f]
./cmd -o test.zip \'-C -> [./cmd,-o,test.zip,'-C]
./cmd -o test.zip \\-C -> [./cmd,-o,test.zip,\-C]
./cmd -o test.zip \"-C -> [./cmd,-o,test.zip,"-C]
./cmd -o test.zip "'"-C -> [./cmd,-o,test.zip,'-C]
./cmd -o test.zip "\\"-C -f -> [./cmd,-o,test.zip,\a-C -f]
./cmd -o test.zip "\""-C -f -> [./cmd,-o,test.zip,"a-C -f]
Bug: b/72484223
Change-Id: I83c3630b70c8396c8e8a3f266244d868d754c4e8
Simplify making restat rules by adding a --write_if_changed argument
to soong_zip that generates the output file into memory and then
compares it to the version on disk before writing it out.
Test: builds
Change-Id: I5059a1e3a11e79b0ca538b3b829bc7479c126ce6
to make it faster/easier to invoke from other Go programs
(such as multiproduct_kati)
Bug: 67478260
Test: m -j
Change-Id: Idd2671a44290550197c88f53dd11a6dd39c85cc5