]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: do not attempt to install cmd/addr2line in TestScript/mod_outside
authorBryan C. Mills <bcmills@google.com>
Wed, 18 Jan 2023 15:08:34 +0000 (10:08 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 18 Jan 2023 15:34:40 +0000 (15:34 +0000)
Tests must not write to GOROOT: it might not writable (for example, if
it is owned by root and the user is non-root), and in general we can't
assume that the configuration in which the test is run matches the
configuration with which the installed tools were built.

In this specific case, CL 454836 (for #57007) installs 'cmd' with
CGO_ENABLED=0, but most builders still run the tests with CGO_ENABLED
unset.

Updates #57007.

Change-Id: I2795fcd3ff61c164dc730b62f697f307ab3a167b
Reviewed-on: https://go-review.googlesource.com/c/go/+/461689
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/go/testdata/script/mod_outside.txt

index ed13e59f36160bd32b32ac848aaf3808cbace579..7a0dc9f22f675ec3e5bab3f88d1ab5ceb09fd4f5 100644 (file)
@@ -203,13 +203,6 @@ stderr '^go: ''go install'' requires a version when current directory is not in
 ! go install ./needmod/needmod.go
 stderr 'needmod[/\\]needmod.go:10:2: no required module provides package example.com/version: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
 
-# 'go install' for a package in GOROOT should succeed.
-# (It must be non-stale here so that the test does not write to GOROOT).
-go build -o $devnull cmd/addr2line  # make sure any necessary dependencies are present in GOCACHE
-! stale cmd/addr2line
-go install cmd/addr2line
-! stderr .
-
 # 'go run' should fail if a package argument must be resolved to a module.
 ! go run example.com/printversion
 stderr '^no required module provides package example.com/printversion: go.mod file not found in current directory or any parent directory; see ''go help modules''$'