forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: avoid re-enqueuing workspace dependencies with errors
Fixes golang#53874. Change-Id: I41ab15cb9b86b807a9d9ad21fe21fb7aa5fbb46f Reviewed-on: https://go-review.googlesource.com/c/go/+/417594 Run-TryBot: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
- Loading branch information
Showing
2 changed files
with
61 additions
and
3 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,59 @@ | ||
go work init | ||
go work use . ./sub | ||
|
||
# Verify that the go.mod files for both modules in the workspace are tidy, | ||
# and add missing go.sum entries as needed. | ||
|
||
cp go.mod go.mod.orig | ||
go mod tidy | ||
cmp go.mod go.mod.orig | ||
|
||
cd sub | ||
cp go.mod go.mod.orig | ||
go mod tidy | ||
cmp go.mod go.mod.orig | ||
cd .. | ||
|
||
go list -m all | ||
stdout '^rsc\.io/quote v1\.5\.1$' | ||
stdout '^rsc\.io/sampler v1\.3\.1$' | ||
|
||
# Now remove the module dependencies from the module cache. | ||
# Because one module upgrades a transitive dependency needed by another, | ||
# listing the modules in the workspace should error out. | ||
|
||
go clean -modcache | ||
env GOPROXY=off | ||
! go list -m all | ||
stderr '^go: rsc.io/[email protected]: module lookup disabled by GOPROXY=off$' | ||
|
||
-- example.go -- | ||
package example | ||
|
||
import _ "rsc.io/sampler" | ||
-- go.mod -- | ||
module example | ||
|
||
go 1.19 | ||
|
||
require rsc.io/sampler v1.3.0 | ||
|
||
require ( | ||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect | ||
rsc.io/testonly v1.0.0 // indirect | ||
) | ||
-- sub/go.mod -- | ||
module example/sub | ||
|
||
go 1.19 | ||
|
||
require rsc.io/quote v1.5.1 | ||
|
||
require ( | ||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect | ||
rsc.io/sampler v1.3.1 // indirect | ||
) | ||
-- sub/sub.go -- | ||
package example | ||
|
||
import _ "rsc.io/quote" |