Open thesayyn opened 1 year ago
@aiuto this affects distroless repository. I have time to create a PR here. Not sure what should be the fix here though.
I have tried adding a post process action to some of our targets but that leads to longer build time in some of the larger targets.
I feel like the principled fix here is to not have pkg_tar strip leading slashes.
What do you think?
The leading './' is a mistake. I would rather hack up deps
to strip the './' as well.
Since future work will be to eliminate deps in favor of richer semantics, I don't worry so much about hacks there.
The leading './' is a mistake.
could you elaborate on this a bit more? This is the standard way all the Debian packages are distributed.
pkg_tar creates broken archives when any of the
deps
contain entries with leading./
in their path.Imagine a tar file that is downloaded via http_archive with leading
./
path entriesA BUILD file that looks like this;
The resulting archive that pkg_tar creates, in this case, looks like the below;
This semantically corrupt archive as there are two entries for
var/lib/dpkg/
.var/lib/dpkg/
and./var/lib/dpkg/
is the same from the extractor tools standpoint.Ideally, I'd expect pkg_tar to have no opinion about what leading path the entries have but I guess that's not an option anymore.
If that's the case pkg_tar should be fixing the deps as well to produce semantically correct archives.