Skip to content

Commit

Permalink
feat: Add bzip2 support to apt_deb_repository.bzl (#127)
Browse files Browse the repository at this point in the history
* Resolves #116

We have to download a package from https://apt-archive.postgresql.org/pub/repos/apt/dists/bookworm-pgdg-archive/main/binary-arm64/index.html, which only provides `Packages.bz2` and does not provide `Packages.xz` or `Packages.gz`.

We fixed this by locally patching our copy of `rules_distroless` to include `bz2` support here. This PR upstreams the change we made.
  • Loading branch information
jthemphill authored Dec 5, 2024
1 parent 5d605fc commit fc95904
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apt/private/apt_deb_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ load(":version_constraint.bzl", "version_constraint")
def _fetch_package_index(rctx, url, dist, comp, arch, integrity):
target_triple = "{dist}/{comp}/{arch}".format(dist = dist, comp = comp, arch = arch)

# See https://linux.die.net/man/1/xz and https://linux.die.net/man/1/gzip
# See https://linux.die.net/man/1/xz , https://linux.die.net/man/1/gzip , and https://linux.die.net/man/1/bzip2
# --keep -> keep the original file (Bazel might be still committing the output to the cache)
# --force -> overwrite the output if it exists
# --decompress -> decompress
supported_extensions = {
"xz": ["xz", "--decompress", "--keep", "--force"],
"gz": ["gzip", "--decompress", "--keep", "--force"],
"bz2": ["bzip2", "--decompress", "--keep", "--force"],
}

failed_attempts = []
Expand Down

0 comments on commit fc95904

Please sign in to comment.