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/vgo: vgo mod -require flag value format conflicts with shell redirect #26230

Closed
myitcv opened this issue Jul 5, 2018 · 2 comments

Comments

@myitcv
Copy link
Member

commented Jul 5, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.10.3 linux/amd64
vgo commit 6cd5a417451d8ee907692eded07ef1b6b53825b1

Does this issue reproduce with the latest release?

Yes.

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/tmp/tmp.sBFmjarlrd"
GOPROXY=""
GORACE=""
GOROOT="/home/myitcv/gos"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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-build515814233=/tmp/go-build -gno-record-gcc-switches"
VGOMODROOT="/tmp/tmp.sBFmjarlrd/hello"

What did you do?

cd `mktemp -d`
export GOPATH=$PWD
mkdir hello
cd hello
vgo mod -init -module example.com/hello
vgo mod -require rsc.io/quote@v1.5.2
vgo mod -replace rsc.io/quote@v1.5.2=>github.com/myitcv/vgo-by-example-quote-fork@master

gives:

bash: github.com/myitcv/vgo-by-example-quote-fork@master: No such file or directory

What did you expect to see?

Because the value passed to the -require flag is not quoted, this output is expected (at least in Bash).

So I wonder whether we should either:

  • do nothing, on the basis vgo mod will mostly be called by tools (assuming it will)
  • change the format of the value passed to the -require flag
  • quote the example:
...

The -replace='old@v=>new@w' and -dropreplace=old@v flags
add and drop a replacement of the given module path and version pair.
Note that -replace overrides any existing replacements for old@v.

...

because it feels like this is something that people will unwittingly fall foul of.

/cc @rsc @bcmills

@gopherbot gopherbot added this to the vgo milestone Jul 5, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2018

I'll send a CL changing it to plain =, like we use in other flags.

@rsc rsc self-assigned this Jul 5, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Jul 6, 2018

Change https://golang.org/cl/122404 mentions this issue: cmd/go/internal/modcmd: change -replace syntax from => to =

@golang golang locked and limited conversation to collaborators Jul 12, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.