SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
reduce binary size
chrislu1494221b0885
diff --git a/.github/workflows/binaries_dev.yml b/.github/workflows/binaries_dev.ymlindex 6e007a7973..d48a557dde 100644--- a/.github/workflows/binaries_dev.yml+++ b/.github/workflows/binaries_dev.yml@@ -53,7 +53,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weed-large-disk@@ -68,7 +68,7 @@ jobs:release_tag: devoverwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weed-normal-disk@@ -102,7 +102,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weed-large-disk@@ -117,7 +117,7 @@ jobs:release_tag: devoverwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weed-normal-diskdiff --git a/.github/workflows/binaries_release0.yml b/.github/workflows/binaries_release0.ymlindex 38c2330830..51cd482c2c 100644--- a/.github/workflows/binaries_release0.yml+++ b/.github/workflows/binaries_release0.yml@@ -38,7 +38,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0# build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weed@@ -52,7 +52,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weeddiff --git a/.github/workflows/binaries_release1.yml b/.github/workflows/binaries_release1.ymlindex 88e59ad169..f98e7b5568 100644--- a/.github/workflows/binaries_release1.yml+++ b/.github/workflows/binaries_release1.yml@@ -38,7 +38,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0# build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weed@@ -52,7 +52,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weeddiff --git a/.github/workflows/binaries_release2.yml b/.github/workflows/binaries_release2.ymlindex 4da7b5c6e9..913e5f0c2a 100644--- a/.github/workflows/binaries_release2.yml+++ b/.github/workflows/binaries_release2.yml@@ -38,7 +38,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0# build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weed@@ -52,7 +52,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weeddiff --git a/.github/workflows/binaries_release3.yml b/.github/workflows/binaries_release3.ymlindex 6c660c0ce1..c5014f3275 100644--- a/.github/workflows/binaries_release3.yml+++ b/.github/workflows/binaries_release3.yml@@ -38,7 +38,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0# build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weed@@ -52,7 +52,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weeddiff --git a/.github/workflows/binaries_release4.yml b/.github/workflows/binaries_release4.ymlindex 1fce192618..c07226ab83 100644--- a/.github/workflows/binaries_release4.yml+++ b/.github/workflows/binaries_release4.yml@@ -39,7 +39,7 @@ jobs:build_flags: -tags elastic,ydb,gocdk,tikvpre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0# build_flags: -tags 5BytesOffset # optional, default is- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weed@@ -53,7 +53,7 @@ jobs:overwrite: truepre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0build_flags: -tags 5BytesOffset,elastic,ydb,gocdk,tikv- ldflags: -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}+ ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}# Where to run `go build .`project_path: weedbinary_name: weeddiff --git a/docker/Makefile b/docker/Makefileindex 9e9d771c20..b473245e81 100644--- a/docker/Makefile+++ b/docker/Makefile@@ -8,7 +8,7 @@ cgo ?= 0binary:export SWCOMMIT=$(shell git rev-parse --short HEAD)export SWLDFLAGS="-X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=$(SWCOMMIT)"- cd ../weed && CGO_ENABLED=$(cgo) GOOS=linux go build $(options) -tags "$(tags)" -ldflags "-extldflags -static $(SWLDFLAGS)" && mv weed ../docker/+ cd ../weed && CGO_ENABLED=$(cgo) GOOS=linux go build $(options) -tags "$(tags)" -ldflags "-s -w -extldflags -static $(SWLDFLAGS)" && mv weed ../docker/binary_race: options = -racebinary_race: cgo = 1