-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x/mod: remove vendor/modules.txt from module download
This fixes a bug where vendor/modules.txt was accidently included during a module download. This CL trims this file for 1.24 modules and beyond. We cannot remove this for earlier Go versions because this would alter checksums and cause a checksum failure. This CL also adds the ability to case on the Go version in the root's go.mod file, enabling future behavior changes if necessary. Fixes: golang/go#63395 Updates: golang/go#37397 Change-Id: I4a4f2174b0f5e79c7e5c516e0db3c91e7d2ae4d9 Reviewed-on: https://go-review.googlesource.com/c/mod/+/584635 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Matloob <[email protected]>
- Loading branch information
1 parent
46a3137
commit 9cd0e4c
Showing
10 changed files
with
221 additions
and
16 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,23 @@ | ||
-- want -- | ||
valid: | ||
$work/go.mod | ||
$work/valid.go | ||
$work/vendor/modules.txt | ||
|
||
omitted: | ||
$work/.hg_archival.txt: file is inserted by 'hg archive' and is always omitted | ||
$work/.git: directory is a version control repository | ||
$work/sub: directory is in another module | ||
$work/vendor/x/y: file is in vendor directory | ||
|
||
invalid: | ||
$work/invalid.go': malformed file path "invalid.go'": invalid char '\'' | ||
-- valid.go -- | ||
-- go.mod -- | ||
go 1.23 | ||
-- invalid.go' -- | ||
-- vendor/modules.txt -- | ||
-- vendor/x/y -- | ||
-- sub/go.mod -- | ||
-- .hg_archival.txt -- | ||
-- .git/x -- |
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,24 @@ | ||
-- want -- | ||
valid: | ||
$work/go.mod | ||
$work/valid.go | ||
|
||
omitted: | ||
$work/.hg_archival.txt: file is inserted by 'hg archive' and is always omitted | ||
$work/.git: directory is a version control repository | ||
$work/sub: directory is in another module | ||
$work/vendor/modules.txt: file is in vendor directory | ||
$work/vendor/x/y: file is in vendor directory | ||
|
||
invalid: | ||
$work/invalid.go': malformed file path "invalid.go'": invalid char '\'' | ||
-- go.mod -- | ||
go 1.24 | ||
-- valid.go -- | ||
-- invalid.go' -- | ||
-- vendor/modules.txt -- | ||
-- vendor/x/y -- | ||
-- sub/go.mod -- | ||
go 1.23 | ||
-- .hg_archival.txt -- | ||
-- .git/x -- |
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,28 @@ | ||
-- want -- | ||
valid: | ||
valid.go | ||
go.mod | ||
vendor/modules.txt | ||
|
||
omitted: | ||
vendor/x/y: file is in vendor directory | ||
sub/go.mod: file is in another module | ||
.hg_archival.txt: file is inserted by 'hg archive' and is always omitted | ||
|
||
invalid: | ||
not/../clean: file path is not clean | ||
invalid.go': malformed file path "invalid.go'": invalid char '\'' | ||
valid.go: multiple entries for file "valid.go" | ||
-- valid.go -- | ||
-- not/../clean -- | ||
-- go.mod -- | ||
go 1.23 | ||
-- invalid.go' -- | ||
-- vendor/x/y -- | ||
-- vendor/modules.txt -- | ||
-- sub/go.mod -- | ||
-- .hg_archival.txt -- | ||
-- valid.go -- | ||
duplicate | ||
-- valid.go -- | ||
another duplicate |
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,29 @@ | ||
-- want -- | ||
valid: | ||
valid.go | ||
go.mod | ||
|
||
omitted: | ||
vendor/x/y: file is in vendor directory | ||
vendor/modules.txt: file is in vendor directory | ||
sub/go.mod: file is in another module | ||
.hg_archival.txt: file is inserted by 'hg archive' and is always omitted | ||
|
||
invalid: | ||
not/../clean: file path is not clean | ||
invalid.go': malformed file path "invalid.go'": invalid char '\'' | ||
valid.go: multiple entries for file "valid.go" | ||
-- valid.go -- | ||
-- not/../clean -- | ||
-- go.mod -- | ||
go 1.24 | ||
-- invalid.go' -- | ||
-- vendor/x/y -- | ||
-- vendor/modules.txt -- | ||
-- sub/go.mod -- | ||
go 1.23 | ||
-- .hg_archival.txt -- | ||
-- valid.go -- | ||
duplicate | ||
-- valid.go -- | ||
another duplicate |
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,15 @@ | ||
path=example.com/m | ||
version=v1.0.0 | ||
hash=h1:WxQ7ERgHLILawPCiuSwXp5UHul7CUSRRftO8b7GTnV8= | ||
-- go.mod -- | ||
module example.com/m | ||
|
||
go 1.24 | ||
modules.txt is excluded in 1.24+. See golang.org/issue/63395 | ||
-- vendor/modules.txt -- | ||
excluded | ||
see comment in isVendoredPackage and golang.org/issue/31562. | ||
-- vendor/example.com/x/x.go -- | ||
excluded | ||
-- sub/vendor/sub.txt -- | ||
excluded |
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,15 @@ | ||
path=example.com/m | ||
version=v1.0.0 | ||
hash=h1:WxQ7ERgHLILawPCiuSwXp5UHul7CUSRRftO8b7GTnV8= | ||
-- go.mod -- | ||
module example.com/m | ||
|
||
go 1.24 | ||
modules.txt is excluded in 1.24+. See golang.org/issue/63395 | ||
-- vendor/modules.txt -- | ||
excluded | ||
see comment in isVendoredPackage and golang.org/issue/31562. | ||
-- vendor/example.com/x/x.go -- | ||
excluded | ||
-- sub/vendor/sub.txt -- | ||
excluded |
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