Skip to content

x/vgo: cannot vgo get golang.org/x/image #25618

Closed
@shogsbro

Description

@shogsbro

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

Activity

added this to the Unreleased milestone on May 29, 2018
AlexRouSg

AlexRouSg commented on May 29, 2018

@AlexRouSg
Contributor

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

ALTree

ALTree commented on May 29, 2018

@ALTree
Member

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

shogsbro

shogsbro commented on Jun 1, 2018

@shogsbro
Author

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

gopherbot

gopherbot commented on Jun 1, 2018

@gopherbot
Contributor

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

myitcv

myitcv commented on Jun 1, 2018

@myitcv
Member

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

shogsbro

shogsbro commented on Jun 1, 2018

@shogsbro
Author

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

myitcv commented on Jun 1, 2018

@myitcv
Member

@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

shogsbro commented on Jun 1, 2018

@shogsbro
Author

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

AlexRouSg

AlexRouSg commented on Jun 1, 2018

@AlexRouSg
Contributor

@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

myitcv commented on Jun 1, 2018

@myitcv
Member

@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

myitcv commented on Jun 1, 2018

@myitcv
Member

@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

shogsbro commented on Jun 1, 2018

@shogsbro
Author

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

AlexRouSg commented on Jun 1, 2018

@AlexRouSg
Contributor

@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.

15 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @shogsbro@myitcv@ALTree@AlexRouSg@gopherbot

        Issue actions

          x/vgo: cannot vgo get golang.org/x/image · Issue #25618 · golang/go