From 7a50762b9ed05f1410a24f52571b49a25cd561eb Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 23 Nov 2023 00:48:27 -0800 Subject: [PATCH] reduce binary size by skipping rclone --- .github/workflows/go.yml | 4 ++-- Makefile | 4 ++-- weed/storage/backend/rclone_backend/dummy.go | 1 + weed/storage/backend/rclone_backend/rclone_backend.go | 3 +++ weed/storage/backend/rclone_backend/rclone_progress.go | 3 +++ 5 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 weed/storage/backend/rclone_backend/dummy.go diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2ea755fca..f23721987 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -34,7 +34,7 @@ jobs: cd weed; go get -v -t -d ./... - name: Build - run: cd weed; go build -tags "elastic gocdk sqlite ydb tikv" -v . + run: cd weed; go build -tags "elastic gocdk sqlite ydb tikv rclone" -v . - name: Test - run: cd weed; go test -tags "elastic gocdk sqlite ydb tikv" -v ./... + run: cd weed; go test -tags "elastic gocdk sqlite ydb tikv rclone" -v ./... diff --git a/Makefile b/Makefile index 9ae877fa6..fbe357db6 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ warp_install: go install github.com/minio/warp@v0.7.6 full_install: - cd weed; go install -tags "elastic gocdk sqlite ydb tikv" + cd weed; go install -tags "elastic gocdk sqlite ydb tikv rclone" server: install weed -v 4 server -s3 -filer -volume.max=0 -master.volumeSizeLimitMB=1024 -volume.preStopSeconds=1 -s3.port=8000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false -s3.config=./docker/compose/s3.json @@ -32,4 +32,4 @@ benchmark_with_pprof: debug = 1 benchmark_with_pprof: benchmark test: - cd weed; go test -tags "elastic gocdk sqlite ydb tikv" -v ./... \ No newline at end of file + cd weed; go test -tags "elastic gocdk sqlite ydb tikv rclone" -v ./... diff --git a/weed/storage/backend/rclone_backend/dummy.go b/weed/storage/backend/rclone_backend/dummy.go new file mode 100644 index 000000000..721256a00 --- /dev/null +++ b/weed/storage/backend/rclone_backend/dummy.go @@ -0,0 +1 @@ +package rclone_backend diff --git a/weed/storage/backend/rclone_backend/rclone_backend.go b/weed/storage/backend/rclone_backend/rclone_backend.go index 55fde6456..c634db048 100644 --- a/weed/storage/backend/rclone_backend/rclone_backend.go +++ b/weed/storage/backend/rclone_backend/rclone_backend.go @@ -1,3 +1,6 @@ +//go:build rclone +// +build rclone + package rclone_backend import ( diff --git a/weed/storage/backend/rclone_backend/rclone_progress.go b/weed/storage/backend/rclone_backend/rclone_progress.go index cf359ca40..738f33d82 100644 --- a/weed/storage/backend/rclone_backend/rclone_progress.go +++ b/weed/storage/backend/rclone_backend/rclone_progress.go @@ -1,3 +1,6 @@ +//go:build rclone +// +build rclone + package rclone_backend import "github.com/rclone/rclone/fs/accounting"