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

cmd/go: "go mod download" doesn't fetch necessary modules in workspace mode #51946

Open
h31 opened this issue Mar 25, 2022 · 2 comments
Open

cmd/go: "go mod download" doesn't fetch necessary modules in workspace mode #51946

h31 opened this issue Mar 25, 2022 · 2 comments
Assignees
Labels
GoCommand modules NeedsInvestigation
Milestone

Comments

@h31
Copy link

@h31 h31 commented Mar 25, 2022

What version of Go are you using (go version)?

$ go version
go version go1.18 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/artyom/Library/Caches/go-build"
GOENV="/Users/artyom/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/artyom/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/artyom/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.18/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.18/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/pr/5k6c2yx97cjb9t5fh0httxv80000gn/T/go-build740782791=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

  • git clone https://github.com/sergunya/my_workspace; cd my_workspace/
  • rm go.work.sum
  • go clean -modcache
  • cd cmd/my_app/
  • go mod download
  • go list -m -json all

What did you expect to see?

github.com/samber/lo@v1.3.2-0.20220305174447-4edabde35217 necessary to build my_app module is downloaded and has a "Dir" property in go list output.

What did you see instead?

There's no "Dir" property.

I tried to debug Go source code and found that checksumOk("") in src/cmd/go/internal/modload/build.go:275 returns false for github.com/samber/lo. Building my_app using go build adds the necessary checksum to go.work.sum and the issue disappears. It doesn't help to run go mod tidy or go work sync before go mod download.

@seankhliao seankhliao added NeedsInvestigation GoCommand labels Mar 28, 2022
@seankhliao
Copy link
Contributor

@seankhliao seankhliao commented Mar 28, 2022

@matloob matloob self-assigned this May 11, 2022
@bcmills
Copy link
Member

@bcmills bcmills commented May 11, 2022

This may be a bad interaction with #44435.

@matloob matloob added this to the Go1.19 milestone May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand modules NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

4 participants