bazelbuild / bazelbuild/bazel

Consider singlejar as a replacement for the ijar zipper

Open
#19,446 2 comments 1 reaction 0 assignees View on GitHub
P2 team-Rules-Java type: feature request type: process
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

ijar was refactored to provide a general purpose 'zipper' utility in
2015 (https://github.com/bazelbuild/bazel/commit/084411250036cb5724a6cfe8c65744b679cb436e). I think the desire at the time was to have a fast way to create deterministic, time-stamp free archives.

The zip implementation in ijar is sufficient to handle reading jars of JVM`.class` files and producing ABI jars, but it wasn't created as a general-purpose zip implementation, and the ijar zip utility has required various bug fixes over the years ([recent example](https://github.com/bazelbuild/bazel/pull/19408)).

After ijar zipper was created, 'singlejar' was re-implemented in c++ (starting in 2016 in https://github.com/bazelbuild/bazel/commit/f667aa54f4fcc2c04182de9bc267a7ee469f6445), and as of 2021 the c++ singlejar is used on all of the platforms Bazel supports (https://github.com/bazelbuild/bazel/issues/7365). Singlejar is a fast, general-purpose tool for creating deterministic zip archives, which a more robust zip implementation.

This bug tracks investigating migrating uses of the ijar's zipper to singlejar, and turning down zipper.

Contributor guide

Open the contributing guide

Research direction

The issue names ijar's zipper and C++ singlejar as the components to compare; begin by locating all uses of the ijar zipper and the existing singlejar implementation. Confirm each use can move to singlejar and that the zipper can be retired while preserving deterministic archive behavior across supported platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, java
Domain
build-system, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.