aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar/zip.cc
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-06-01 14:45:21 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2015-06-01 15:50:49 +0000
commiteb6e90397eff1083f0574b6cbd94eb9f42d2d239 (patch)
tree7eac158033f6db031ea5ac167f75fd3ff800c4a1 /third_party/ijar/zip.cc
parent14b437bf749baf0488cfc7e4ed7589dc4af9bec3 (diff)
Use the ijar ZIP implementation in Blaze instead of libarchive
This ZIP implementation is lightweight and rely on zlib for compression. libarchive was a bit tricky to set-up so it's better to use that one. -- Change-Id: I607b492998572e834e095a4606eeb77c0b574542 Reviewed-on: https://bazel-review.googlesource.com/#/c/1410/ MOS_MIGRATED_REVID=94910072
Diffstat (limited to 'third_party/ijar/zip.cc')
-rw-r--r--third_party/ijar/zip.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/third_party/ijar/zip.cc b/third_party/ijar/zip.cc
index 989f50b826..604c2f1467 100644
--- a/third_party/ijar/zip.cc
+++ b/third_party/ijar/zip.cc
@@ -54,11 +54,13 @@
#define GENERAL_PURPOSE_BIT_FLAG_COMPRESSED (1 << 3)
#define GENERAL_PURPOSE_BIT_FLAG_UTF8_ENCODED (1 << 11)
+#define GENERAL_PURPOSE_BIT_FLAG_COMPRESSION_SPEED ((1 << 2) | (1 << 1))
#define GENERAL_PURPOSE_BIT_FLAG_SUPPORTED \
- (GENERAL_PURPOSE_BIT_FLAG_COMPRESSED | GENERAL_PURPOSE_BIT_FLAG_UTF8_ENCODED)
+ (GENERAL_PURPOSE_BIT_FLAG_COMPRESSED \
+ | GENERAL_PURPOSE_BIT_FLAG_UTF8_ENCODED \
+ | GENERAL_PURPOSE_BIT_FLAG_COMPRESSION_SPEED)
namespace devtools_ijar {
-
// In the absence of ZIP64 support, zip files are limited to 4GB.
// http://www.info-zip.org/FAQ.html#limits
static const u8 kMaximumOutputSize = std::numeric_limits<uint32_t>::max();
@@ -119,8 +121,11 @@ class InputZipFile : public ZipExtractor {
// time it is found too small, until it reaches MAX_BUFFER_SIZE. If that is
// not enough, we bail out. We only decompress class files, so they should
// be smaller than 64K anyway, but we give a little leeway.
+ // MAX_BUFFER_SIZE must be bigger than the size of the biggest file in the
+ // ZIP. It is set to 128M here so we can uncompress the Bazel server with
+ // this library.
static const size_t INITIAL_BUFFER_SIZE = 256 * 1024; // 256K
- static const size_t MAX_BUFFER_SIZE = 16 * 1024 * 1024;
+ static const size_t MAX_BUFFER_SIZE = 128 * 1024 * 1024;
static const size_t MAX_MAPPED_REGION = 32 * 1024 * 1024;
// These metadata fields are the fields of the ZIP header of the file being