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: cannot vgo get golang.org/x/image #25618

Closed
shogsbro opened this issue May 29, 2018 · 14 comments

Comments

@shogsbro
Copy link

commented May 29, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.10.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN="/Users/sigurd/go/bin"
GOCACHE="/Users/sigurd/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/sigurd/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/b7/lntxvqq15dvgfmlhptx_8y_m0000gp/T/go-build399896100=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

vgo get golang.org/x/image

What did you expect to see?

vgo: finding golang.org/x/image v0.0.0-20180403161127-f315e4403028
vgo: downloading golang.org/x/image v0.0.0-20180403161127-f315e4403028

What did you see instead?

vgo: extracting golang.org/x/image v0.0.0-20180403161127-f315e4403028
vgo: import "golang.org/x/image" [/Users/sigurd/go/src/v/golang.org/x/image@v0.0.0-20180403161127-f315e4403028]: no Go source files

@gopherbot gopherbot added this to the Unreleased milestone May 29, 2018

@AlexRouSg

This comment has been minimized.

Copy link
Contributor

commented May 29, 2018

golang.org/x/image isn't a package, even go get golang.org/x/image errors

@ALTree

This comment has been minimized.

Copy link
Member

commented May 29, 2018

What @AlexRouSg said. Closing here, since it doesn't look like a bug.

@ALTree ALTree closed this May 29, 2018

@shogsbro

This comment has been minimized.

Copy link
Author

commented Jun 1, 2018

Fair enough. I followed instructions in https://github.com/golang/image/blob/master/README.md, which then need updating.

@gopherbot

This comment has been minimized.

Copy link

commented Jun 1, 2018

Change https://golang.org/cl/115675 mentions this issue: README: fix go get instructions

@myitcv

This comment has been minimized.

Copy link
Member

commented Jun 1, 2018

Thanks for pointing that out @shogsbro - I've filed https://go-review.googlesource.com/#/c/image/+/115675 to address the README problem.

@shogsbro

This comment has been minimized.

Copy link
Author

commented Jun 1, 2018

Further info:

$ mkdir vgotest
$ cd vgotest/
$ touch go.mod
$ vi vgotest.go
$ vgo get golang.org/x/image/tiff
vgo get golang.org/x/image/tiff: module root is "golang.org/x/image"
$ vgo get golang.org/x/image
vgo: finding golang.org/x/image v0.0.0-20180403161127-f315e4403028
vgo: downloading golang.org/x/image v0.0.0-20180403161127-f315e4403028
vgo: import "golang.org/x/image" [~/go/src/v/golang.org/x/image@v0.0.0-20180403161127-f315e4403028]: no Go source files

I can work around this by importing from the Github mirror, but points to adoption issues with vgo

@myitcv

This comment has been minimized.

Copy link
Member

commented Jun 1, 2018

@shogsbro vgo get is used to fetch Go modules (hence the first error); so there isn't the symmetry with go get you might expect. This is also being discussed in #24105

Instead you can simply rely on vgo build etc:

cd `mktemp -d`
export GOPATH=$PWD
mkdir hello
cd hello
cat <<EOD > hello.go
package main // import "example.com/hello"

import _ "golang.org/x/image/tiff"

func main() {
}
EOD
echo > go.mod
vgo build
cat go.mod

Gives:

module example.com/hello

require golang.org/x/image v0.0.0-20180403161127-f315e4403028
@shogsbro

This comment has been minimized.

Copy link
Author

commented Jun 1, 2018

Eureka, this worked! However, this at least to me is a non-obvious way of doing it.

@AlexRouSg

This comment has been minimized.

Copy link
Contributor

commented Jun 1, 2018

@myitcv There's a more specific issue on having no go files on the root dir. #24008

@shogsbro That's the normal vgo workflow actually, so once vgo is stable I expect there to be more docs and instructions on how to do things. Right now you'll have to depend on https://research.swtch.com/vgo and asking around.

@myitcv

This comment has been minimized.

Copy link
Member

commented Jun 1, 2018

@shogsbro undoubtedly there's more documentation required for vgo (it will follow), particularly in areas where concepts change from the old go ways: ideally in this situation I would have pointed you towards a guide/README that covered the salient points. But glad you're up and running.

@myitcv

This comment has been minimized.

Copy link
Member

commented Jun 1, 2018

@AlexRouSg - sorry, our messages overlapped there.

Yes, there are a number of open issues around vgo get. I linked to that particular issue because Russ appeared to reference that as the umbrella issue. But either way, we know what you're talking about :)

@shogsbro

This comment has been minimized.

Copy link
Author

commented Jun 1, 2018

Thanks to you both for your quick responses & solutions.

To clarify, I am using vgo in an air-gapped environment, and have a dummy project outside this environment to populate ~/go/src/v/... using vgo get, which then is imported thru a scanning process. Any pointers on a canonical way to improve this process-flow gratefully received.

@AlexRouSg

This comment has been minimized.

Copy link
Contributor

commented Jun 1, 2018

@shogsbro I suggest you to post in one of the places listed in https://github.com/golang/go/wiki/Questions if you need more help on vgo. As not only is this a closed issue, the bug tracker is not normally used for discussions.

@myitcv myitcv changed the title x/image not importable with current vgo x/vgo: cannot vgo get golang.org/x/image Jun 1, 2018

@myitcv

This comment has been minimized.

Copy link
Member

commented Jun 1, 2018

As not only is this a closed issue, the bug tracker is not normally used for discussions.

The Slack channel #vgo is a good place to ask questions indeed.

But in the absence of good documentation, a stable version of vgo etc, I suspect Russ' original instruction to post issues here (https://research.swtch.com/vgo-tour) remains. Because questions might in fact be issues at this stage.

gopherbot pushed a commit to golang/image that referenced this issue Jun 1, 2018
README: fix go get instructions
Currently the instructions tell the user to:

go get -u golang.org/x/image

However, this is not valid because golang.org/x/image contains no Go
files.

Instead it should read:

go get -u golang.org/x/image/...

Fixes golang/go#25618.

Change-Id: I465fac26afdca52878518e4c01d46cf9d12930b9
Reviewed-on: https://go-review.googlesource.com/115675
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>

@golang golang locked and limited conversation to collaborators Jun 1, 2019

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