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: vague error when VCS tool not available #26982

Closed
myitcv opened this issue Aug 14, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@myitcv
Copy link
Member

commented Aug 14, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.11rc1 linux/amd64

Does this issue reproduce with the latest release?

n/a: working with 1.11rc1

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

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

What did you do?

Requires that bzr not be in your PATH:

export GOPATH=$(mktemp -d)
cd $(mktemp -d)
mkdir hello
cd hello
go mod init example.com/hello
cat <<EOD > main.go
package main

import _ "launchpad.net/gocheck"

func main() {}
EOD
go mod tidy

What did you expect to see?

An error message telling me that bzr was not available in my PATH

What did you see instead?

Zero exit code and no messages. go.mod also untouched:

$ cat go.mod
module example.com/hello

go build at least fails with a non-zero exit code, but a rather vague error message:

$ go build
build example.com/hello: cannot find module for path launchpad.net/gocheck

In fact in this situation we can be very specific: the error comes about because bzr is not in our PATH.

/cc @rsc @bcmills

Not sure whether you would consider this a release-blocker? I've not marked it as such for now

@myitcv myitcv added the modules label Aug 14, 2018

@myitcv myitcv added this to the Go1.11 milestone Aug 14, 2018

@rsc rsc changed the title cmd/go: mod tidy fails silently if VCS tool not available cmd/go: vague error when VCS tool not available Aug 17, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Aug 17, 2018

Filed #27063 for the silent mod tidy and repurposed this for the missing VCS error.

@gopherbot

This comment has been minimized.

Copy link

commented Aug 17, 2018

Change https://golang.org/cl/129683 mentions this issue: cmd/go: treat VCS errors as hard errors in module search

@gopherbot gopherbot closed this in 850c964 Aug 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.