From 9cffb568249364d86c25df92595bda58cace95e4 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Oct 03 2019 00:08:42 +0000 Subject: update to 1.8.5 (#1757636) drop obsolete patches --- diff --git a/.gitignore b/.gitignore index 7a5f7e0..2a5614d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /compress-1.7.0.tar.gz /compress-1.7.2.tar.gz /compress-1.8.4.tar.gz +/compress-1.8.5.tar.gz diff --git a/0001-Fix-32-bit-system-test-runs.patch b/0001-Fix-32-bit-system-test-runs.patch deleted file mode 100644 index 6657ff0..0000000 --- a/0001-Fix-32-bit-system-test-runs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From b999e7024499cc5228e176cd41f9646aa185f7a9 Mon Sep 17 00:00:00 2001 -From: Klaus Post -Date: Fri, 27 Sep 2019 09:53:13 -0700 -Subject: [PATCH] Fix 32 bit system test runs - -Fixes #163 ---- - .travis.yml | 2 +- - s2/encode.go | 3 ++- - s2/s2.go | 2 +- - s2/s2_test.go | 18 +++++++++++++----- - zstd/encoder_options_test.go | 1 - - 5 files changed, 17 insertions(+), 9 deletions(-) - -diff --git a/.travis.yml b/.travis.yml -index 332adc6..4afed80 100644 ---- a/.travis.yml -+++ b/.travis.yml -@@ -22,7 +22,7 @@ script: - - go test -cpu=2 -tags=noasm ./... - - go test -cpu=1,4 -short -race ./... - - go build github.com/klauspost/compress/s2/cmd/s2c && go build github.com/klauspost/compress/s2/cmd/s2d && s2c s2c && s2d s2c.s2 && rm s2c && rm s2d && rm s2c.s2 -- - GOOS=linux GOARCH=386 go install ./... -+ - GOOS=linux GOARCH=386 go test -short ./... - - matrix: - allow_failures: -diff --git a/s2/encode.go b/s2/encode.go -index d8aff0e..fc82889 100644 ---- a/s2/encode.go -+++ b/s2/encode.go -@@ -161,6 +161,7 @@ const MaxBlockSize = math.MaxUint32 - binary.MaxVarintLen32 - 5 - // uncompressed length. - // - // It will return a negative value if srcLen is too large to encode. -+// 32 bit platforms will have lower thresholds for rejecting big content. - func MaxEncodedLen(srcLen int) int { - n := uint64(srcLen) - if n > 0xffffffff { -@@ -171,7 +172,7 @@ func MaxEncodedLen(srcLen int) int { - n = n + uint64((bits.Len64(n)+7)/7) - - // Add maximum size of encoding block as literals. -- n += uint64(literalExtraSize(srcLen)) -+ n += uint64(literalExtraSize(int64(srcLen))) - if n > 0xffffffff { - return -1 - } -diff --git a/s2/s2.go b/s2/s2.go -index f0ed32a..c98da6c 100644 ---- a/s2/s2.go -+++ b/s2/s2.go -@@ -110,7 +110,7 @@ func crc(b []byte) uint32 { - - // literalExtraSize returns the extra size of encoding n literals. - // n should be >= 0 and <= math.MaxUint32. --func literalExtraSize(n int) int { -+func literalExtraSize(n int64) int64 { - if n == 0 { - return 0 - } -diff --git a/s2/s2_test.go b/s2/s2_test.go -index fbc461a..d90c21c 100644 ---- a/s2/s2_test.go -+++ b/s2/s2_test.go -@@ -24,6 +24,9 @@ import ( - "github.com/klauspost/compress/snappy" - ) - -+const maxUint = ^uint(0) -+const maxInt = int(maxUint >> 1) -+ - var ( - download = flag.Bool("download", false, "If true, download any missing files before running benchmarks") - testdataDir = flag.String("testdataDir", "testdata", "Directory containing the test data") -@@ -32,10 +35,10 @@ var ( - - func TestMaxEncodedLen(t *testing.T) { - testSet := []struct { -- in, out int -+ in, out int64 - }{ - {in: 0, out: 1}, -- {in: 1 << 24, out: 1<<24 + binary.PutVarint([]byte{binary.MaxVarintLen32: 0}, int64(1<<24)) + literalExtraSize(1<<24)}, -+ {in: 1 << 24, out: 1<<24 + int64(binary.PutVarint([]byte{binary.MaxVarintLen32: 0}, int64(1<<24))) + literalExtraSize(1<<24)}, - {in: MaxBlockSize, out: math.MaxUint32}, - {in: math.MaxUint32 - binary.MaxVarintLen32 - literalExtraSize(math.MaxUint32), out: math.MaxUint32}, - {in: math.MaxUint32 - 9, out: -1}, -@@ -51,14 +54,19 @@ func TestMaxEncodedLen(t *testing.T) { - {in: -1, out: -1}, - {in: -2, out: -1}, - } -+ // 32 bit platforms have a different threshold. -+ if maxInt == math.MaxInt32 { -+ testSet[2].out = -1 -+ testSet[3].out = -1 -+ } - // Test all sizes up to maxBlockSize. -- for i := 0; i < maxBlockSize; i++ { -- testSet = append(testSet, struct{ in, out int }{in: i, out: i + binary.PutVarint([]byte{binary.MaxVarintLen32: 0}, int64(i)) + literalExtraSize(i)}) -+ for i := int64(0); i < maxBlockSize; i++ { -+ testSet = append(testSet, struct{ in, out int64 }{in: i, out: i + int64(binary.PutVarint([]byte{binary.MaxVarintLen32: 0}, i)) + literalExtraSize(i)}) - } - for i := range testSet { - tt := testSet[i] - want := tt.out -- got := MaxEncodedLen(tt.in) -+ got := int64(MaxEncodedLen(int(tt.in))) - if got != want { - t.Fatalf("input: %d, want: %d, got: %d", tt.in, want, got) - } -diff --git a/zstd/encoder_options_test.go b/zstd/encoder_options_test.go -index f691405..23db3da 100644 ---- a/zstd/encoder_options_test.go -+++ b/zstd/encoder_options_test.go -@@ -132,7 +132,6 @@ func TestWindowSize(t *testing.T) { - {(1 << 10) + 1, true}, - {(1 << 10) * 3, true}, - {1 << 30, false}, -- {1 << 31, true}, - } - for _, tt := range tests { - t.Run(strconv.Itoa(tt.windowSize), func(t *testing.T) { --- -2.21.0 - diff --git a/golang-github-klauspost-compress-timeout.patch b/golang-github-klauspost-compress-timeout.patch deleted file mode 100644 index e4b0dc3..0000000 --- a/golang-github-klauspost-compress-timeout.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up compress-1.8.4/zstd/encoder_test.go.timeout compress-1.8.4/zstd/encoder_test.go ---- compress-1.8.4/zstd/encoder_test.go.timeout 2019-09-18 00:41:01.000000000 +0000 -+++ compress-1.8.4/zstd/encoder_test.go 2019-09-14 19:48:15.523420380 +0000 -@@ -97,7 +97,7 @@ func TestEncoder_EncodeAllEncodeXML(t *t - } - - func TestEncoderRegression(t *testing.T) { -- defer timeout(30 * time.Second)() -+ defer timeout(35 * time.Second)() - data, err := ioutil.ReadFile("testdata/comp-crashers.zip") - if err != nil { - t.Fatal(err) diff --git a/golang-github-klauspost-compress.spec b/golang-github-klauspost-compress.spec index dc1cb77..1507fff 100644 --- a/golang-github-klauspost-compress.spec +++ b/golang-github-klauspost-compress.spec @@ -5,7 +5,7 @@ # https://github.com/klauspost/compress %global goipath github.com/klauspost/compress -Version: 1.8.4 +Version: 1.8.5 %gometa @@ -30,10 +30,6 @@ Summary: Optimized compression packages License: BSD URL: %{gourl} Source0: %{gosource} -# https://github.com/klauspost/compress/issues/163 -Patch0: 0001-Fix-32-bit-system-test-runs.patch -# https://github.com/klauspost/compress/issues/165 -Patch1: %{name}-timeout.patch BuildRequires: golang(github.com/cespare/xxhash) BuildRequires: golang(github.com/klauspost/cpuid) @@ -65,6 +61,10 @@ BuildRequires: golang(github.com/google/go-cmp/cmp) %gopkgfiles %changelog +* Wed Oct 02 2019 Dominik Mierzejewski - 1.8.5-1 +- update to 1.8.5 (#1757636) +- drop obsolete patches + * Fri Sep 27 2019 Dominik Mierzejewski - 1.8.4-1 - update to 1.8.4 (#1742049) - backport upstream patch for 32-bit arches diff --git a/sources b/sources index 7a27dd0..d592a26 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (compress-1.8.4.tar.gz) = 2027941437e6da52e0c132b072e9c50ad74cb1731934b57ceff753800eb202049bd8bbf1af76304aa214142aa05967c6b30803e148f8b8da61e3b520e5b4a9d5 +SHA512 (compress-1.8.5.tar.gz) = da2cb824f585f1e4bdf83dbf4fca22d7f92d50563e000b353490d39e4466fd4f61f6804b79cbf4a48427b8ac8b6bbd958317ba799252d30a74328303bfbcfe67