]> Cypherpunks repositories - gostls13.git/commit
cmd/go: fix disallow of p/vendor/x during vendor experiment
authorRuss Cox <rsc@golang.org>
Fri, 31 Jul 2015 15:54:42 +0000 (11:54 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 31 Jul 2015 18:49:45 +0000 (18:49 +0000)
commit45971c60c31303ed9100d3ac8c3030c4d48d7084
treef071ba911c54ea0258f671617468280574b5bd1e
parentc5dff7282e27c640c192edb34b92c5c6459aa804
cmd/go: fix disallow of p/vendor/x during vendor experiment

The percolation of errors upward in the load process could
drop errors, meaning that a build tree could, depending on the
processing order, import the same directory as both "p/vendor/x"
and as "x". That's not supposed to be allowed. But then, worse,
the build would generate two jobs for building that directory,
which would use the same work space and overwrite each other's files,
leading to very strange failures.

Two fixes:

1. Fix the propagation of errors upward (prefer errors over success).
2. Check explicitly for duplicated packages before starting a build.

New test for #1.
Since #2 can't happen, tested #2 by hand after reverting fix for #1.

Fixes #11913.

Change-Id: I6d2fc65f93b8fb5f3b263ace8d5f68d803a2ae5c
Reviewed-on: https://go-review.googlesource.com/13022
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/pkg.go
src/cmd/go/testdata/testvendor/src/p/p.go [new file with mode: 0644]
src/cmd/go/testdata/testvendor/src/q/vendor/x/x.go [new file with mode: 0644]
src/cmd/go/testdata/testvendor/src/q/y/y.go [new file with mode: 0644]
src/cmd/go/testdata/testvendor/src/q/z/z.go [new file with mode: 0644]
src/cmd/go/vendor_test.go