]> Cypherpunks repositories - gostls13.git/commit
cmd/go: fix incorrect determining default value of CGO_ENABLED
authorqiulaidongfeng <2645477756@qq.com>
Wed, 23 Oct 2024 12:55:43 +0000 (20:55 +0800)
committerMichael Matloob <matloob@golang.org>
Thu, 8 May 2025 15:12:15 +0000 (08:12 -0700)
commit8cd6d68a0881d2bc0081081a847bb36fc314e761
tree80503f1163750ce8163981e294cecbfc02524c20
parentbd1f9a4963eff6672e7e7b6d1b03ca0c51f28663
cmd/go: fix incorrect determining default value of CGO_ENABLED

The default value is the value obtained when
no environment variables are set and go env  -w is not used.

In the past,
we used the current value
(may be modified by an environment variable to a non-default value),
error was used as the default value.

For #69994

Change-Id: Iead3a6cacd04dc51a094ffb9f7bb7553320fcd78
Reviewed-on: https://go-review.googlesource.com/c/go/+/621995
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/dist/build.go
src/cmd/dist/buildgo.go
src/cmd/dist/buildruntime.go
src/cmd/go/internal/cfg/cfg.go
src/cmd/go/testdata/script/env_changed.txt
src/go/build/build.go