Go 1.27 changed compress/flate encoder output in CL 707355 while
improving compression speed (golang/go#75532). This changes the bytes of
every gzip-compressed layer BuildKit produces, and therefore their
digests, breaking cache reuse and content dedup against layers built by
earlier BuildKit releases.
Vendor the writer half of Go 1.26.5's compress/flate as
util/compression/go126flate (verbatim copy of tag go1.26.5,
c19862e5f8415b4f24b189d065ed739517c548ba) together with the small amount
of gzip framing that image layers use, and route the gzip compressor
through it. Output is byte-identical to Go 1.26.5 compress/gzip for all
compression levels, so layer digests stay stable regardless of the
toolchain BuildKit is built with.
Note this only covers the plain gzip compressor; estargz and nydus still
use the stdlib encoder.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>