Skip to content

vendor: github.com/golang/snappy v1.0.0#3685

Merged
tonistiigi merged 1 commit intodocker:masterfrom
thaJeztah:snappier
Mar 3, 2026
Merged

vendor: github.com/golang/snappy v1.0.0#3685
tonistiigi merged 1 commit intodocker:masterfrom
thaJeztah:snappier

Conversation

@thaJeztah
Copy link
Member

Ensure arm64 frame sizes are 8 (mod 16)

fixes: "Weird failure when building on Raspbian / Debian 10.11"

full diff: golang/snappy@v0.0.4...v1.0.0

Ensure arm64 frame sizes are 8 (mod 16)

fixes: "Weird failure when building on Raspbian / Debian 10.11"

full diff: golang/snappy@v0.0.4...v1.0.0

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Member Author

FWIW; this version matches what GitHub uses; https://github.com/cli/cli/blob/7a590331b599a0ac60e55225dc26c79c8b0d51a0/go.mod#L26

I noticed that this module has been archived though; wondering if GitHub (if they define this format to use) is considering alternatives 🤔

Screenshot 2026-03-03 at 16 32 13

@thaJeztah
Copy link
Member Author

Ah! Looks like klauspost/compress has alternatives; worth considering perhaps?

https://pkg.go.dev/github.com/klauspost/compress/snappy

This is a drop-in replacement for github.com/golang/snappy.

And... apparently s2 may be an alternative as well;

https://pkg.go.dev/github.com/klauspost/compress/s2#section-readme

S2 is an extension of Snappy.

S2 is aimed for high throughput, which is why it features concurrent compression for bigger payloads.

Decoding is compatible with Snappy compressed content, but content compressed with S2 cannot be decompressed by Snappy. This means that S2 can seamlessly replace Snappy without converting compressed content.

@thaJeztah
Copy link
Member Author

Oh! And looks like snappy there is a wrapper around s2, so no need to choose really;
https://github.com/klauspost/compress/blob/v1.18.4/snappy/decode.go#L39-L48

// Decode returns the decoded form of src. The returned slice may be a sub-
// slice of dst if dst was large enough to hold the entire decoded block.
// Otherwise, a newly allocated slice will be returned.
//
// The dst and src must not overlap. It is valid to pass a nil dst.
//
// Decode handles the Snappy block format, not the Snappy stream format.
func Decode(dst, src []byte) ([]byte, error) {
	return s2.Decode(dst, src)
}

@thaJeztah
Copy link
Member Author

@tonistiigi tonistiigi merged commit 8f02b16 into docker:master Mar 3, 2026
160 checks passed
@thaJeztah thaJeztah deleted the snappier branch March 3, 2026 16:42
@tonistiigi tonistiigi added this to the v0.32.0 milestone Mar 3, 2026
@tonistiigi tonistiigi mentioned this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants