bazelbuild / rules_pkg

Bazel rules for creating packages of many types (zip, tar, deb, rpm, ...)
Apache License 2.0
216 stars 171 forks source link

pkg_deb: permit data.tar.zst #759

Closed adam-azarchs closed 10 months ago

adam-azarchs commented 10 months ago

dpkg has supported zstd-compressed data since version 1.21.18 (and at least in ubuntu 22.04, dpkg 1.21.1 seems to also support it, though the feature is undocumented; I think the support is implicit through tar 1.31+). While pkg_tar does not yet directly support making zstd-compressed tarballs, aside from the possibility of constructing such tarballs by other means, one can still build them by supplying a custom compressor.

pkg_deb does not currently allow using a data.tar.zst, in two places: https://github.com/bazelbuild/rules_pkg/blob/ff60b34e037313927b9067dd883dd82e1fbc211e/pkg/private/deb/deb.bzl#L19 disallows supplying a tar.zst. If one fixes that, there's also https://github.com/bazelbuild/rules_pkg/blob/ff60b34e037313927b9067dd883dd82e1fbc211e/pkg/private/deb/make_deb.py#L240-L241 which will strip off the .zst suffix, rendering the resulting .deb unusable.

Worth noting, every .deb archive that I've spot-checked in the Ubuntu jammy (22.04) repository has used data.tar.zst, which I'd say makes this a pretty main-stream feature.