aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/link_matching_actionid.txt
blob: b8d423d027b693503b11e154201b98b68b955d13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Checks that an identical binary is built with -trimpath from the same
# source files, with GOROOT in two different locations.
# Verifies golang.org/issue/38989

[short] skip
[!symlink] skip

# Symlink the compiler to a local path
env GOROOT=$WORK/goroot1
symlink $GOROOT -> $TESTGO_GOROOT

# Set up fresh GOCACHE
env GOCACHE=$WORK/gocache1
mkdir $GOCACHE

# Build a simple binary
go build -o binary1 -trimpath -x main.go

# Now repeat the same process with the compiler at a different local path
env GOROOT=$WORK/goroot2
symlink $GOROOT -> $TESTGO_GOROOT

env GOCACHE=$WORK/gocache2
mkdir $GOCACHE

go build -o binary2 -trimpath -x main.go

# Check that the binaries match exactly
go tool buildid binary1
cp stdout buildid1
go tool buildid binary2
cp stdout buildid2
cmp buildid1 buildid2


-- main.go --
package main
func main() {}