Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/internal/versions: malformed module path "go/version": missing dot in first path element #64490

Closed
dfioravanti opened this issue Dec 1, 2023 · 6 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@dfioravanti
Copy link

Go version

go version go1.21.4 darwin/arm64

What operating system and processor architecture are you using (go env)?

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='~/Library/Caches/go-build'
GOENV='~/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='~/diego/go/pkg/mod'
GONOPROXY='<company_github>'
GONOSUMDB='<company_github>'
GOOS='darwin'
GOPATH='~/go'
GOPRIVATE='<company_github>'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/opt/go/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/opt/go/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='<path_to_folder>/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/nd/zj4rx5qx4sb91d7jp4pl588h0000gn/T/go-build3776138920=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Since a few days ago running go get -u all returns go: all: malformed module path "go/version": missing dot in first path element. From what I can tell the only mention of go/versions is in vendor/golang.org/x/tools/internal/versions/versions_go122.go. Which uses

import (
	"go/version"
)

Looking at the git blame for src/go/version/version.go it looks like it was changed ~3 weeks ago. Which kinda correlates with when the update stopped working for me. Is this a bug or am I doing something silly? Thanks a lot for the help

What did you expect to see?

Update all dependencies

What did you see instead?

go: all: malformed module path "go/version": missing dot in first path element

@ezbercihk
Copy link

@dfioravanti I am seeing this same problem.. I see you closed this issue almost immediately without any comments so I wanted to check what fixed it for you. Thanks!

@dfioravanti
Copy link
Author

Oh it is not fixed, I thought I made a mistake, but the error is still there. I can reopen. Btw, using go get -u ./... works

@dfioravanti dfioravanti reopened this Dec 6, 2023
@ezbercihk
Copy link

oh ok, good to know. that the error is still there for you as well.. yes, go get -u ./... does work but not for testing dependencies.. those still need to be updated manually unfortunately

@cagedmantis cagedmantis changed the title golang.org/x/tools: malformed module path "go/version": missing dot in first path element x/tools: malformed module path "go/version": missing dot in first path element Dec 6, 2023
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 6, 2023
@cagedmantis cagedmantis added this to the Backlog milestone Dec 6, 2023
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Dec 6, 2023
@cagedmantis cagedmantis changed the title x/tools: malformed module path "go/version": missing dot in first path element x/tools/internal/versions: malformed module path "go/version": missing dot in first path element Dec 6, 2023
@cagedmantis
Copy link
Contributor

@timothy-king

@bcmills
Copy link
Contributor

bcmills commented Dec 6, 2023

This is a result of #32345: go get in module mode ignores build constraints when resolving the module graph, which causes it to try to resolve a module for the import of the go/version package (which of course it can't do).

We added logic to ignore that in go mod tidy for #44557, but we didn't add it to go get because with that command you have the option to request a narrower subset of packages.

See also:

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/550395 mentions this issue: internal/versions: remove use of go/versions

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 18, 2023
@dmitshur dmitshur modified the milestones: Backlog, Go1.22 Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

6 participants