-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: add go command known variables to test cache hash
The go test result must not be cached when each of known variables to go command change. To do this, add all known variables to test metadata. Fixes #32285 Change-Id: I90be6a72f46c42d965aec4fed534c0623244cd3d Reviewed-on: https://go-review.googlesource.com/c/go/+/179040 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
- Loading branch information
Showing
5 changed files
with
88 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
env GO111MODULE=on | ||
go mod init foo | ||
go test | ||
stdout ^ok\s+foo | ||
env GO111MODULE=off | ||
go test | ||
stdout ^ok\s+ | ||
! stdout ^ok\s+(cache)$ | ||
|
||
-- main_test.go -- | ||
package main | ||
|
||
import "testing" | ||
|
||
func TestF(t *testing.T) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2019 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// Package cfg holds configuration shared by the Go command and internal/testenv. | ||
// Definitions that don't need to be exposed outside of cmd/go should be in | ||
// cmd/go/internal/cfg instead of this package. | ||
package cfg | ||
|
||
// KnownEnv is a list of environment variables that affect the operation | ||
// of the Go command. | ||
const KnownEnv = ` | ||
AR | ||
CC | ||
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_ENABLED | ||
CGO_FFLAGS | ||
CGO_FFLAGS_ALLOW | ||
CGO_FFLAGS_DISALLOW | ||
CGO_LDFLAGS | ||
CGO_LDFLAGS_ALLOW | ||
CGO_LDFLAGS_DISALLOW | ||
CXX | ||
FC | ||
GCCGO | ||
GO111MODULE | ||
GO386 | ||
GOARCH | ||
GOARM | ||
GOBIN | ||
GOCACHE | ||
GOENV | ||
GOEXE | ||
GOFLAGS | ||
GOGCCFLAGS | ||
GOHOSTARCH | ||
GOHOSTOS | ||
GOMIPS | ||
GOMIPS64 | ||
GONOPROXY | ||
GONOSUMDB | ||
GOOS | ||
GOPATH | ||
GOPPC64 | ||
GOPRIVATE | ||
GOPROXY | ||
GOROOT | ||
GOSUMDB | ||
GOTMPDIR | ||
GOTOOLDIR | ||
GOWASM | ||
GO_EXTLINK_ENABLED | ||
PKG_CONFIG | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters