Skip to content

Commit

Permalink
cmd: update vendored golang.org/x/mod
Browse files Browse the repository at this point in the history
Pull in CL 500335. It teaches modfile.IsDirectoryPath to recognize all
relative paths that begin with a "." or ".." path element as a valid
directory path (rather than a module path). This allows removing the
path == "." check that CL 389298 added to modload.ToDirectoryPath.

go get golang.org/x/mod@6e58e47c  # CL 500335
go mod tidy
go mod vendor

Updates #51448.
Fixes #60572.

Change-Id: Ide99c728c8dac8fd238e13f6d6a0c3917d7aea2d
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/500355
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
  • Loading branch information
dmitshur authored and gopherbot committed Oct 26, 2023
1 parent 0046c14 commit 7546c79
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22
require (
github.com/google/pprof v0.0.0-20230811205829-9131a7e9cc17
golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307
golang.org/x/mod v0.13.0
golang.org/x/mod v0.13.1-0.20231025225536-6e58e47c7bd6
golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36
golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3
golang.org/x/term v0.13.1-0.20231011140651-6a610bc55bff
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab h1:BA4a7pe
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307 h1:1nIbNxjxQ3+dss3xYMxayoIZONazUTg8/BENwc19sAQ=
golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.13.1-0.20231025225536-6e58e47c7bd6 h1:YSyE+/SK6vfYAxf27iVtUZ/tTZOHGN6epnMgE1al/+M=
golang.org/x/mod v0.13.1-0.20231025225536-6e58e47c7bd6/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36 h1:+lDu3sHZVY5Qqb7ynMbjaT4IsYicvoxypEOIE4aYlYE=
golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3 h1:G9se7UpoI67yWrFY0IIFGf6H3nwLLUZFDBCyOJwWeSc=
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/go/internal/modload/modfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ var latestVersionIgnoringRetractionsCache par.ErrCache[string, module.Version] /
// an absolute path or a relative path starting with a '.' or '..'
// path component.
func ToDirectoryPath(path string) string {
if path == "." || modfile.IsDirectoryPath(path) {
if modfile.IsDirectoryPath(path) {
return path
}
// The path is not a relative path or an absolute path, so make it relative
Expand Down
26 changes: 21 additions & 5 deletions src/cmd/go/testdata/script/work_init_path.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
# Regression test for https://go.dev/issue/51448.
# 'go work init . foo/bar' should produce a go.work file
# with the same paths as 'go work init; go work use -r .'.
# 'go work init . .. foo/bar' should produce a go.work file
# with the same paths as 'go work init; go work use -r ..',
# and it should have 'use .' rather than 'use ./.' inside.

go work init . foo/bar
cd dir

go work init . .. foo/bar
mv go.work go.work.init

go work init
go work use -r .
go work use -r ..
cmp go.work go.work.init

cmpenv go.work $WORK/go.work.want

-- go.mod --
module example
go 1.18
-- foo/bar/go.mod --
-- dir/go.mod --
module example
go 1.18
-- dir/foo/bar/go.mod --
module example
go 1.18
-- $WORK/go.work.want --
go $goversion

use (
.
..
./foo/bar
)
12 changes: 6 additions & 6 deletions src/cmd/vendor/golang.org/x/mod/modfile/rule.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cmd/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ golang.org/x/arch/arm/armasm
golang.org/x/arch/arm64/arm64asm
golang.org/x/arch/ppc64/ppc64asm
golang.org/x/arch/x86/x86asm
# golang.org/x/mod v0.13.0
# golang.org/x/mod v0.13.1-0.20231025225536-6e58e47c7bd6
## explicit; go 1.18
golang.org/x/mod/internal/lazyregexp
golang.org/x/mod/modfile
Expand Down

0 comments on commit 7546c79

Please sign in to comment.