mirror of
https://github.com/restic/restic.git
synced 2025-03-30 00:00:14 +01:00
backend/gs: disable GRPC API to reduce binary size bloat
Since cloud.google.com/go/storage v1.44.0 the GRPC API is enabled by default. However, this causes the restic binary size to explode by 20MB. So just disable it again.
This commit is contained in:
parent
171f303399
commit
2b65ef5710
2 changed files with 11 additions and 7 deletions
14
build.go
14
build.go
|
@ -53,12 +53,14 @@ import (
|
|||
|
||||
// config contains the configuration for the program to build.
|
||||
var config = Config{
|
||||
Name: "restic", // name of the program executable and directory
|
||||
Namespace: "github.com/restic/restic", // subdir of GOPATH, e.g. "github.com/foo/bar"
|
||||
Main: "./cmd/restic", // package name for the main package
|
||||
DefaultBuildTags: []string{"selfupdate"}, // specify build tags which are always used
|
||||
Tests: []string{"./..."}, // tests to run
|
||||
MinVersion: GoVersion{Major: 1, Minor: 23, Patch: 0}, // minimum Go version supported
|
||||
Name: "restic", // name of the program executable and directory
|
||||
Namespace: "github.com/restic/restic", // subdir of GOPATH, e.g. "github.com/foo/bar"
|
||||
Main: "./cmd/restic", // package name for the main package
|
||||
// disable_grpc_modules is necessary to reduce the binary size since cloud.google.com/go/storage v1.44.0
|
||||
// see https://github.com/googleapis/google-cloud-go/issues/11448
|
||||
DefaultBuildTags: []string{"selfupdate", "disable_grpc_modules"}, // specify build tags which are always used
|
||||
Tests: []string{"./..."}, // tests to run
|
||||
MinVersion: GoVersion{Major: 1, Minor: 23, Patch: 0}, // minimum Go version supported
|
||||
}
|
||||
|
||||
// Config configures the build.
|
||||
|
|
|
@ -106,7 +106,9 @@ func build(sourceDir, outputDir, goos, goarch string) (filename string) {
|
|||
}
|
||||
outputFile := filepath.Join(outputDir, filename)
|
||||
|
||||
tags := "selfupdate"
|
||||
// disable_grpc_modules is necessary to reduce the binary size since cloud.google.com/go/storage v1.44.0
|
||||
// see https://github.com/googleapis/google-cloud-go/issues/11448
|
||||
tags := "selfupdate,disable_grpc_modules"
|
||||
if opts.Tags != "" {
|
||||
tags += "," + opts.Tags
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue