From: Jeffery To Date: Thu, 2 Jan 2020 19:48:19 +0000 (+0800) Subject: golang: Re-format environment variable unexports X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=afaf95b4d87a8a3307c134dee90dd667aa2ffc42;p=feed%2Fpackages.git golang: Re-format environment variable unexports This changes the formatting of environment variable unexports in golang-values.mk to be more maintainable, and to document the sources of variables. There should be no change to the actual list of variables unexported. Signed-off-by: Jeffery To --- diff --git a/lang/golang/golang-values.mk b/lang/golang/golang-values.mk index a52dcc92de..d127ef6226 100644 --- a/lang/golang/golang-values.mk +++ b/lang/golang/golang-values.mk @@ -12,22 +12,91 @@ endif include $(GO_INCLUDE_DIR)/golang-version.mk +# Unset environment variables +# There are more magic variables to track down, but ain't nobody got time for that + +# From https://golang.org/cmd/go/#hdr-Environment_variables + +# General-purpose environment variables: +unexport \ + GCCGO \ + GOARCH \ + GOBIN \ + GOCACHE \ + GODEBUG \ + GOFLAGS \ + GOOS \ + GOPATH \ + GOROOT \ + GOTMPDIR +# Unmodified: +# GOPRIVATE +# GOPROXY +# GONOPROXY +# GOSUMDB +# GONOSUMDB + +# Environment variables for use with cgo: unexport \ - GOARCH GOBIN GOCACHE GOFLAGS GOHOSTARCH GOOS GOPATH GORACE GOROOT GOTMPDIR GCCGO \ - GOGC GODEBUG GOMAXPROCS GOTRACEBACK \ CGO_ENABLED \ - CGO_CFLAGS CGO_CFLAGS_ALLOW CGO_CFLAGS_DISALLOW \ + CGO_CFLAGS CGO_CFLAGS_ALLOW CGO_CFLAGS_DISALLOW \ CGO_CPPFLAGS CGO_CPPFLAGS_ALLOW CGO_CPPFLAGS_DISALLOW \ CGO_CXXFLAGS CGO_CXXFLAGS_ALLOW CGO_CXXFLAGS_DISALLOW \ - CGO_FFLAGS CGO_FFLAGS_ALLOW CGO_FFLAGS_DISALLOW \ - CGO_LDFLAGS CGO_LDFLAGS_ALLOW CGO_LDFLAGS_DISALLOW \ - GOARM GO386 GOMIPS GOMIPS64 \ - GO111MODULE \ - GOROOT_FINAL GO_EXTLINK_ENABLED GIT_ALLOW_PROTOCOL \ - CC_FOR_TARGET CXX_FOR_TARGET GO_DISTFLAGS GO_GCFLAGS GO_LDFLAGS GOBUILDTIMELOGFILE GOROOT_BOOTSTRAP \ - BOOT_GO_GCFLAGS GOEXPERIMENT GOBOOTSTRAP_TOOLEXEC - # there are more magic environment variables to track down, but ain't nobody got time for that - # deliberately left untouched: GOPROXY GONOPROXY GOSUMDB GONOSUMDB GOPRIVATE + CGO_FFLAGS CGO_FFLAGS_ALLOW CGO_FFLAGS_DISALLOW \ + CGO_LDFLAGS CGO_LDFLAGS_ALLOW CGO_LDFLAGS_DISALLOW + +# Architecture-specific environment variables: +unexport \ + GOARM \ + GO386 \ + GOMIPS \ + GOMIPS64 + +# Special-purpose environment variables: +unexport \ + GOROOT_FINAL \ + GO_EXTLINK_ENABLED \ + GIT_ALLOW_PROTOCOL + +# From https://golang.org/cmd/go/#hdr-Module_support +unexport \ + GO111MODULE + +# From https://golang.org/pkg/runtime/#hdr-Environment_Variables +unexport \ + GOGC \ + GOMAXPROCS \ + GORACE \ + GOTRACEBACK + +# From https://golang.org/cmd/cgo/#hdr-Using_cgo_with_the_go_command +unexport \ + CC_FOR_TARGET \ + CXX_FOR_TARGET + +# From https://golang.org/doc/install/source#environment +unexport \ + GOHOSTARCH + +# From https://golang.org/src/make.bash +unexport \ + GO_GCFLAGS \ + GO_LDFLAGS \ + GO_DISTFLAGS \ + GOBUILDTIMELOGFILE \ + GOROOT_BOOTSTRAP + +# From https://golang.org/src/cmd/dist/build.go +unexport \ + BOOT_GO_GCFLAGS + +# From https://golang.org/src/cmd/dist/buildtool.go +unexport \ + GOBOOTSTRAP_TOOLEXEC + +# From https://golang.org/src/cmd/internal/objabi/util.go +unexport \ + GOEXPERIMENT go_arch=$(subst \ aarch64,arm64,$(subst \