mirror of
https://github.com/restic/rest-server.git
synced 2026-09-27 06:21:28 -07:00
build.go: Make binaries completely static (disables cgo)
https://github.com/restic/restic/commit/7e0a4c66e722bb367c4e7154c05db26189dceb31
This commit is contained in:
@@ -205,7 +205,7 @@ func cleanEnv() (env []string) {
|
|||||||
func build(cwd, goos, goarch, gopath string, args ...string) error {
|
func build(cwd, goos, goarch, gopath string, args ...string) error {
|
||||||
args = append([]string{"build"}, args...)
|
args = append([]string{"build"}, args...)
|
||||||
cmd := exec.Command("go", args...)
|
cmd := exec.Command("go", args...)
|
||||||
cmd.Env = append(cleanEnv(), "GOPATH="+gopath, "GOARCH="+goarch, "GOOS="+goos)
|
cmd.Env = append(cleanEnv(), "GOPATH="+gopath, "GOARCH="+goarch, "GOOS="+goos, "CGO_ENABLED=0")
|
||||||
cmd.Dir = cwd
|
cmd.Dir = cwd
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
|
|||||||
Reference in New Issue
Block a user