diff --git a/go.mod b/go.mod index 853be51d1..7279689d4 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/valyala/fastjson v1.6.4 github.com/valyala/fastrand v1.1.0 github.com/valyala/fasttemplate v1.2.2 - github.com/valyala/gozstd v1.19.1 + github.com/valyala/gozstd v1.20.1 github.com/valyala/histogram v1.2.0 github.com/valyala/quicktemplate v1.7.0 golang.org/x/net v0.10.0 diff --git a/go.sum b/go.sum index 40a38e6aa..d95b206db 100644 --- a/go.sum +++ b/go.sum @@ -443,8 +443,8 @@ github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/gozstd v1.19.1 h1:6Ftg2xogscS/9FEdn+qJvM8AxifLNUK65Ez6tp3doYI= -github.com/valyala/gozstd v1.19.1/go.mod h1:y5Ew47GLlP37EkTB+B4s7r6A5rdaeB7ftbl9zoYiIPQ= +github.com/valyala/gozstd v1.20.1 h1:xPnnnvjmaDDitMFfDxmQ4vpx0+3CdTg2o3lALvXTU/g= +github.com/valyala/gozstd v1.20.1/go.mod h1:y5Ew47GLlP37EkTB+B4s7r6A5rdaeB7ftbl9zoYiIPQ= github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY= github.com/valyala/quicktemplate v1.7.0 h1:LUPTJmlVcb46OOUY3IeD9DojFpAVbsG+5WFTcjMJzCM= diff --git a/vendor/github.com/valyala/gozstd/Makefile b/vendor/github.com/valyala/gozstd/Makefile index b7f1372d3..90ca115ba 100644 --- a/vendor/github.com/valyala/gozstd/Makefile +++ b/vendor/github.com/valyala/gozstd/Makefile @@ -4,59 +4,67 @@ GOOS_GOARCH := $(GOOS)_$(GOARCH) GOOS_GOARCH_NATIVE := $(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH) LIBZSTD_NAME := libzstd_$(GOOS_GOARCH).a ZSTD_VERSION ?= v1.5.5 -MUSL_BUILDER_IMAGE=golang:1.20.1-alpine -BUILDER_IMAGE := local/builder_musl:2.0.0-$(shell echo $(MUSL_BUILDER_IMAGE) | tr : _)-1 +ZIG_BUILDER_IMAGE=euantorano/zig:0.10.1 +BUILDER_IMAGE := local/builder_musl:2.0.0-$(shell echo $(ZIG_BUILDER_IMAGE) | tr : _ | tr / _)-1 .PHONY: libzstd.a $(LIBZSTD_NAME) libzstd.a: $(LIBZSTD_NAME) $(LIBZSTD_NAME): ifeq ($(GOOS_GOARCH),$(GOOS_GOARCH_NATIVE)) + rm -f $(LIBZSTD_NAME) cd zstd/lib && ZSTD_LEGACY_SUPPORT=0 MOREFLAGS=$(MOREFLAGS) $(MAKE) clean libzstd.a mv zstd/lib/libzstd.a $(LIBZSTD_NAME) -else -ifeq ($(GOOS_GOARCH),linux_arm) - cd zstd/lib && CC=arm-linux-gnueabi-gcc ZSTD_LEGACY_SUPPORT=0 MOREFLAGS=$(MOREFLAGS) $(MAKE) clean libzstd.a - mv zstd/lib/libzstd.a libzstd_linux_arm.a -endif -ifeq ($(GOOS_GOARCH),linux_arm64) - cd zstd/lib && CC=aarch64-linux-gnu-gcc ZSTD_LEGACY_SUPPORT=0 MOREFLAGS=$(MOREFLAGS) $(MAKE) clean libzstd.a - mv zstd/lib/libzstd.a libzstd_linux_arm64.a -endif -ifeq ($(GOOS_GOARCH),linux_musl_amd64) - cd zstd/lib && ZSTD_LEGACY_SUPPORT=0 MOREFLAGS=$(MOREFLAGS) $(MAKE) clean libzstd.a - mv zstd/lib/libzstd.a libzstd_linux_musl_amd64.a -endif -ifeq ($(GOOS_GOARCH),linux_musl_arm64) - cd zstd/lib && ZSTD_LEGACY_SUPPORT=0 MOREFLAGS=$(MOREFLAGS) $(MAKE) clean libzstd.a - mv zstd/lib/libzstd.a libzstd_linux_musl_arm64.a -endif +else ifeq ($(GOOS_GOARCH),linux_amd64) + TARGET=x86_64-linux GOARCH=amd64 GOOS=linux $(MAKE) package-arch +else ifeq ($(GOOS_GOARCH),linux_arm) + TARGET=arm-linux-gnueabi GOARCH=arm GOOS=linux $(MAKE) package-arch +else ifeq ($(GOOS_GOARCH),linux_arm64) + TARGET=aarch64-linux GOARCH=arm64 GOOS=linux $(MAKE) package-arch +else ifeq ($(GOOS_GOARCH),linux_musl_amd64) + TARGET=x86_64-linux-musl GOARCH=amd64 GOOS=linux_musl $(MAKE) package-arch +else ifeq ($(GOOS_GOARCH),linux_musl_arm64) + TARGET=aarch64-linux-musl GOARCH=arm64 GOOS=linux_musl $(MAKE) package-arch +else ifeq ($(GOOS_GOARCH),darwin_arm64) + TARGET=aarch64-macos GOARCH=arm64 GOOS=darwin $(MAKE) package-arch +else ifeq ($(GOOS_GOARCH),darwin_amd64) + TARGET=x86_64-macos GOARCH=amd64 GOOS=darwin $(MAKE) package-arch +else ifeq ($(GOOS_GOARCH),windows_amd64) + TARGET=x86_64-windows GOARCH=amd64 GOOS=windows GOARCH=amd64 $(MAKE) package-arch endif package-builder: (docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q '$(BUILDER_IMAGE)$$') \ || docker build \ - --build-arg builder_image=$(MUSL_BUILDER_IMAGE) \ + --build-arg builder_image=$(ZIG_BUILDER_IMAGE) \ --tag $(BUILDER_IMAGE) \ builder -package-musl: package-builder +package-arch: package-builder + rm -f $(LIBZSTD_NAME) docker run --rm \ - --user $(shell id -u):$(shell id -g) \ --mount type=bind,src="$(shell pwd)",dst=/zstd \ -w /zstd \ $(DOCKER_OPTS) \ $(BUILDER_IMAGE) \ - sh -c "GOOS=linux_musl make clean libzstd.a" - docker run --rm \ - --user $(shell id -u):$(shell id -g) \ - --mount type=bind,src="$(shell pwd)",dst=/zstd \ - --env CC=/opt/cross-builder/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc \ - -w /zstd \ - $(DOCKER_OPTS) \ - $(BUILDER_IMAGE) \ - sh -c "GOARCH=arm64 GOOS=linux_musl make clean libzstd.a" + -c 'cd zstd/lib && \ + ZSTD_LEGACY_SUPPORT=0 AR="zig ar" \ + CC="zig cc -target $(TARGET)" \ + CXX="zig cc -target $(TARGET)" \ + MOREFLAGS=$(MOREFLAGS) \ + $(MAKE) clean libzstd.a' + mv -f zstd/lib/libzstd.a $(LIBZSTD_NAME) +# freebsd and illumos aren't supported by zig compiler atm. +release: + GOOS=linux GOARCH=amd64 $(MAKE) libzstd.a + GOOS=linux GOARCH=arm64 $(MAKE) libzstd.a + GOOS=linux GOARCH=arm $(MAKE) libzstd.a + GOOS=linux_musl GOARCH=amd64 $(MAKE) libzstd.a + GOOS=linux_musl GOARCH=arm64 $(MAKE) libzstd.a + GOOS=darwin GOARCH=arm64 $(MAKE) libzstd.a + GOOS=darwin GOARCH=amd64 $(MAKE) libzstd.a + GOOS=windows GOARCH=amd64 $(MAKE) libzstd.a clean: rm -f $(LIBZSTD_NAME) diff --git a/vendor/github.com/valyala/gozstd/README.md b/vendor/github.com/valyala/gozstd/README.md index 2bd32e3ca..8c05784a7 100644 --- a/vendor/github.com/valyala/gozstd/README.md +++ b/vendor/github.com/valyala/gozstd/README.md @@ -76,19 +76,6 @@ env CC=arm-linux-gnueabi-gcc GOOS=linux GOARCH=arm CGO_ENABLED=1 go build ./main * [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) -### How to build for Windows x64 - -* download & install TDM64-GCC: https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm64-2/tdm64-gcc-10.3.0-2.exe -* download & install GnuWin32-make: https://gnuwin32.sourceforge.net/downlinks/make.php -* download & install CMake: https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3-windows-x86_64.msi -* `cd gozstd\zstd\cmake` -* `mkdir out` -* `cd out` -* `cmake .. -DZSTD_BUILD_SHARED=OFF -DZSTD_BUILD_PROGRAMS=OFF -G "MinGW Makefiles"` -* `make` -* `copy lib/libzstd.a ../../../../libzstd_windows_amd64.a` - - ## FAQ * Q: _Which go version is supported?_ diff --git a/vendor/github.com/valyala/gozstd/libzstd_darwin_amd64.a b/vendor/github.com/valyala/gozstd/libzstd_darwin_amd64.a index ec16bf5c0..5c12111ea 100644 Binary files a/vendor/github.com/valyala/gozstd/libzstd_darwin_amd64.a and b/vendor/github.com/valyala/gozstd/libzstd_darwin_amd64.a differ diff --git a/vendor/github.com/valyala/gozstd/libzstd_darwin_arm64.a b/vendor/github.com/valyala/gozstd/libzstd_darwin_arm64.a index 92761606f..1339570a7 100644 Binary files a/vendor/github.com/valyala/gozstd/libzstd_darwin_arm64.a and b/vendor/github.com/valyala/gozstd/libzstd_darwin_arm64.a differ diff --git a/vendor/github.com/valyala/gozstd/libzstd_linux_arm.a b/vendor/github.com/valyala/gozstd/libzstd_linux_arm.a index 6ecca1de0..527b393c0 100644 Binary files a/vendor/github.com/valyala/gozstd/libzstd_linux_arm.a and b/vendor/github.com/valyala/gozstd/libzstd_linux_arm.a differ diff --git a/vendor/github.com/valyala/gozstd/libzstd_linux_arm64.a b/vendor/github.com/valyala/gozstd/libzstd_linux_arm64.a index af70e8e1c..6b4439dfe 100644 Binary files a/vendor/github.com/valyala/gozstd/libzstd_linux_arm64.a and b/vendor/github.com/valyala/gozstd/libzstd_linux_arm64.a differ diff --git a/vendor/github.com/valyala/gozstd/libzstd_linux_musl_amd64.a b/vendor/github.com/valyala/gozstd/libzstd_linux_musl_amd64.a index 9efa3a11e..0a42810f3 100644 Binary files a/vendor/github.com/valyala/gozstd/libzstd_linux_musl_amd64.a and b/vendor/github.com/valyala/gozstd/libzstd_linux_musl_amd64.a differ diff --git a/vendor/github.com/valyala/gozstd/libzstd_linux_musl_arm64.a b/vendor/github.com/valyala/gozstd/libzstd_linux_musl_arm64.a index efcbce913..6b4439dfe 100644 Binary files a/vendor/github.com/valyala/gozstd/libzstd_linux_musl_arm64.a and b/vendor/github.com/valyala/gozstd/libzstd_linux_musl_arm64.a differ diff --git a/vendor/github.com/valyala/gozstd/libzstd_windows_amd64.a b/vendor/github.com/valyala/gozstd/libzstd_windows_amd64.a index e5b2a393f..c3af82dcf 100644 Binary files a/vendor/github.com/valyala/gozstd/libzstd_windows_amd64.a and b/vendor/github.com/valyala/gozstd/libzstd_windows_amd64.a differ diff --git a/vendor/modules.txt b/vendor/modules.txt index ecbd64410..8d7976f60 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -487,7 +487,7 @@ github.com/valyala/fastrand # github.com/valyala/fasttemplate v1.2.2 ## explicit; go 1.12 github.com/valyala/fasttemplate -# github.com/valyala/gozstd v1.19.1 +# github.com/valyala/gozstd v1.20.1 ## explicit; go 1.12 github.com/valyala/gozstd # github.com/valyala/histogram v1.2.0