aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/build_gopath_order.txt
blob: ac26c28a9f2e3ca7859252b511ebcd2efcda88ad (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
# golang.org/issue/14176#issuecomment-179895769
# golang.org/issue/14192
# -I arguments to compiler could end up not in GOPATH order,
# leading to unexpected import resolution in the compiler.

env GOPATH=$WORK/p1${:}$WORK/p2
mkdir $WORK/p1/src/foo $WORK/p2/src/baz
mkdir $WORK/p2/pkg/${GOOS}_${GOARCH} $WORK/p1/src/bar
cp foo.go $WORK/p1/src/foo/foo.go
cp baz.go $WORK/p2/src/baz/baz.go
cp foo.a $WORK/p2/pkg/${GOOS}_${GOARCH}/foo.a
cp bar.go $WORK/p1/src/bar/bar.go

go install -x bar

# add in baz.a to the mix
mkdir $WORK/p1/pkg/${GOOS}_${GOARCH}
cp baz.a $WORK/p1/pkg/${GOOS}_${GOARCH}/baz.a
env GOPATH=$WORK/p1${:}$WORK/p2
go install -x bar
env GOPATH=$WORK/p2${:}$WORK/p1
go install -x bar

-- foo.go --
package foo
-- baz.go --
package baz
-- foo.a --
bad
-- baz.a --
bad
-- bar.go --
package bar
import _ "baz"
import _ "foo"