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: work use does nothing when not in workspace root #50931

Closed
seankhliao opened this issue Jan 31, 2022 · 2 comments
Closed

cmd/go: work use does nothing when not in workspace root #50931

seankhliao opened this issue Jan 31, 2022 · 2 comments
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@seankhliao
Copy link
Member

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

$ go version
go version go1.18beta2 linux/amd64
go version devel go1.18-5fd8c9b5c5 Sat Jan 29 03:53:30 2022 +0000 linux/amd64

Does this issue reproduce with the latest release?

prerelease

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/arccy/.cache/go-build"
GOENV="/home/arccy/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/arccy/.data/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/arccy/.data/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/arccy/sdk/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/arccy/sdk/gotip/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel go1.18-5fd8c9b5c5 Sat Jan 29 03:53:30 2022 +0000"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/arccy/tmp/testrepo-771/go.mod"
GOWORK="/home/arccy/tmp/testrepo-771/go.work"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4285625585=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ mkdir example && cd example               
$ go mod init example                               
$ go work init       
$ mkdir bar && cd bar        
$ go mod init example/bar       
$ go work use . 
$ cat ../go.work
go 1.18

What did you expect to see?

Either use bar added to go.work or an error

What did you see instead?

no entry added, no error reported

cc @bcmills @matloob

@seankhliao seankhliao added NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go labels Jan 31, 2022
@bcmills bcmills added the modules label Feb 1, 2022
@bcmills bcmills self-assigned this Feb 1, 2022
@bcmills bcmills added this to the Go1.18 milestone Feb 1, 2022
@gopherbot
Copy link

Change https://golang.org/cl/382240 mentions this issue: cmd/go: fix relative-path normalization in go.work files

@bcmills
Copy link
Member

bcmills commented Feb 1, 2022

Thanks for the report! go work use is new in 1.18 and this is a pretty severe bug in it, so marking as release-blocker (and I've just mailed out what I believe is the fix).

@rsc rsc unassigned bcmills Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants