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: cannot find module for path golang.org/x/mobile/event/mouse #35873

Closed
sbinet opened this issue Nov 27, 2019 · 11 comments

Comments

@sbinet
Copy link
Member

@sbinet sbinet commented Nov 27, 2019

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

$ go version
go version go1.13.4 linux/amd64

Does this issue reproduce with the latest release?

yes:

$> go version
go version devel +4e3d58009a Wed Nov 27 15:06:55 2019 +0000 linux/amd64

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/binet/.cache/go-build"
GOENV="/home/binet/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/binet/dev/go/gocode"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/binet/sdk/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/binet/sdk/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/binet/tmp/mobile-issue/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-build612621734=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I am trying to cross-compile this simple program from linux/amd64 to darwin/amd64:

package main

import (
	_ "golang.org/x/exp/shiny/driver"
	_ "golang.org/x/mobile/event/key"
	_ "golang.org/x/mobile/event/paint"
)

func main() {}
$> cat go.mod 
module mobile-issue

go 1.13

require (
	golang.org/x/exp v0.0.0-20191127035308-9964a5a80460
	golang.org/x/mobile v0.0.0-20191123054942-d9e324ca8c38
)

$> GOOS=linux GOARCH=amd64 go build
$> echo $?
0

$> GOOS=darwin GOARCH=amd64 go build
build command-line-arguments: cannot find module for path golang.org/x/mobile/event/mouse
$> echo $?
1

$> GOOS=darwin GOARCH=amd64 go get golang.org/x/mobile/event/...
go: finding golang.org/x/mobile latest
$> echo $?
0

$> GOOS=darwin GOARCH=amd64 go build
build command-line-arguments: cannot find module for path golang.org/x/mobile/event/mouse
$> echo $?
1

seems vaguely related to:

  • #28064 (but that timed out)
  • #28652 (but I am not building this from mainland China, I am on CERN highspeed network)

the error with master is slightly different:

$> GOOS=darwin GOARCH=amd64 go build
../../dev/go/gocode/pkg/mod/golang.org/x/exp@v0.0.0-20191127035308-9964a5a80460/shiny/driver/gldriver/cocoa.go:42:2: cannot find package

line 42 is: import "golang.org/x/mobile/event/mouse"

@gopherbot gopherbot added this to the Unreleased milestone Nov 27, 2019
@gopherbot gopherbot added the mobile label Nov 27, 2019
@hyangah

This comment has been minimized.

Copy link
Contributor

@hyangah hyangah commented Nov 27, 2019

@sbinet thanks for the report. Have you tried to pass -x -v flags? I can't reproduce at this moment. It can be a proxy or network issue, so the -x -v output may be helpful.

@sbinet

This comment has been minimized.

Copy link
Member Author

@sbinet sbinet commented Nov 27, 2019

I tried a couple of times linux/darwin intertwined (w/ always the same result) so I wouldn't bet on a network issue, but, well, I have been known to be mistaken :)

here it is:

$> GOOS=darwin go build -v -x
WORK=/tmp/go-build920545111
../../pkg/mod/golang.org/x/exp@v0.0.0-20191127035308-9964a5a80460/shiny/driver/gldriver/cocoa.go:42:2: cannot find package

(output slightly different b/c I am posting this from another linux machine)

@sbinet

This comment has been minimized.

Copy link
Member Author

@sbinet sbinet commented Nov 27, 2019

ah, and when I blank import ".../mouse", it compiles fine.
(and if I remove ".../shiny/driver" and only keep ".../event/{key,paint}", it compiles correctly as well).

@hyangah

This comment has been minimized.

Copy link
Contributor

@hyangah hyangah commented Nov 27, 2019

Thanks - if we trust what -v -x output says, there was no network download, which may suggest the go command is using the cached module (in my case, the package was in $GOPATH/pkg/mod/golang.org/x/mobile@v0.0.0-20191123054942-d9e324ca8c38/event/mouse).

Maybe clean the module cache (go clean -modcache) ? Alternatively, you can use a throwaway GOPATH (GOPATH=mktemp -d go build -x -v) so the fresh new empty module cache is used.

@hyangah hyangah changed the title x/mobile: cannot find module for path golang.org/x/mobile/event/mouse cmd/go: cannot find module for path golang.org/x/mobile/event/mouse Nov 27, 2019
@sbinet

This comment has been minimized.

Copy link
Member Author

@sbinet sbinet commented Nov 28, 2019

here it is:

$> GOOS=darwin GOPATH=`mktemp -d` go build -x -v
WORK=/tmp/go-build032230554
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.mod
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.mod
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.mod: 200 OK (0.253s)
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20190731235908-ec7cb31e5a56.mod
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.mod
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20190909214602-067311248421.mod
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.mod: 200 OK (0.256s)
# get https://proxy.golang.org/golang.org/x/mod/@v/v0.1.0.mod
# get https://proxy.golang.org/github.com/%21burnt%21sushi/xgb/@v/v0.0.0-20160522181843-27f122750802.mod
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190719004257-d2bd2a29d028.mod
# get https://proxy.golang.org/github.com/go-gl/glfw/v3.3/glfw/@v/v0.0.0-20191125211704-12ad95a8df72.mod
# get https://proxy.golang.org/dmitri.shuralyov.com/gpu/mtl/@v/v0.0.0-20190408044501-666a987793e9.mod
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20191012152004-8de300cfc20a.mod
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190412213103-97732733099d.mod
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190412213103-97732733099d.mod: 200 OK (0.013s)
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.mod: 200 OK (0.033s)
# get https://proxy.golang.org/golang.org/x/text/@v/v0.3.0.mod
# get https://proxy.golang.org/golang.org/x/text/@v/v0.3.0.mod: 200 OK (0.009s)
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20190731235908-ec7cb31e5a56.mod: 200 OK (0.052s)
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20190909214602-067311248421.mod: 200 OK (0.052s)
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190312151609-d3739f865fa6.mod
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190227222117-0694c2d4d067.mod
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20190312151545-0bb0c0a6e846.mod
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190620200207-3b0461eec859.mod
# get https://proxy.golang.org/github.com/%21burnt%21sushi/xgb/@v/v0.0.0-20160522181843-27f122750802.mod: 200 OK (0.055s)
# get https://proxy.golang.org/golang.org/x/sync/@v/v0.0.0-20190423024810-112230192c58.mod
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190620200207-3b0461eec859.mod: 200 OK (0.010s)
# get https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20190308221718-c2843e01d9a2.mod
# get https://proxy.golang.org/golang.org/x/sync/@v/v0.0.0-20190423024810-112230192c58.mod: 200 OK (0.009s)
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190215142949-d0b11bdaac8a.mod
# get https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20190308221718-c2843e01d9a2.mod: 200 OK (0.012s)
# get https://proxy.golang.org/golang.org/x/xerrors/@v/v0.0.0-20190717185122-a985d3407aa7.mod
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190215142949-d0b11bdaac8a.mod: 200 OK (0.010s)
# get https://proxy.golang.org/golang.org/x/xerrors/@v/v0.0.0-20190717185122-a985d3407aa7.mod: 200 OK (0.009s)
# get https://proxy.golang.org/golang.org/x/mod/@v/v0.1.0.mod: 200 OK (0.116s)
# get https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20190510104115-cbcb75029529.mod
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190719004257-d2bd2a29d028.mod: 200 OK (0.118s)
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190312061237-fead79001313.mod
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20190306152737-a1d7652674e8.mod
# get https://proxy.golang.org/dmitri.shuralyov.com/gpu/mtl/@v/v0.0.0-20190408044501-666a987793e9.mod: 200 OK (0.123s)
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20191012152004-8de300cfc20a.mod: 200 OK (0.123s)
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190227222117-0694c2d4d067.mod: 200 OK (0.074s)
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190312151609-d3739f865fa6.mod: 200 OK (0.074s)
# get https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20190510104115-cbcb75029529.mod: 200 OK (0.009s)
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190404232315-eb5bcb51f2a3.mod
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20190312151545-0bb0c0a6e846.mod: 200 OK (0.075s)
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190311183353-d8887717615a.mod
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190404232315-eb5bcb51f2a3.mod: 200 OK (0.010s)
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20190306152737-a1d7652674e8.mod: 200 OK (0.045s)
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190312061237-fead79001313.mod: 200 OK (0.047s)
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190311183353-d8887717615a.mod: 200 OK (0.049s)
# get https://proxy.golang.org/github.com/go-gl/glfw/v3.3/glfw/@v/v0.0.0-20191125211704-12ad95a8df72.mod: 200 OK (0.181s)
go: downloading golang.org/x/mobile v0.0.0-20191123054942-d9e324ca8c38
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.zip
go: downloading golang.org/x/exp v0.0.0-20191127035308-9964a5a80460
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.zip
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.zip: 200 OK (0.091s)
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.zip: 200 OK (0.105s)
go: extracting golang.org/x/mobile v0.0.0-20191123054942-d9e324ca8c38
go: extracting golang.org/x/exp v0.0.0-20191127035308-9964a5a80460
go: downloading golang.org/x/image v0.0.0-20190802002840-cff245a6509b
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.zip
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.zip: 200 OK (0.258s)
go: extracting golang.org/x/image v0.0.0-20190802002840-cff245a6509b
go: finding golang.org/x/mobile v0.0.0-20191123054942-d9e324ca8c38
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.info
go: finding golang.org/x/exp v0.0.0-20191127035308-9964a5a80460
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.info
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.info: 200 OK (0.030s)
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.info: 200 OK (0.044s)
go: finding golang.org/x/image v0.0.0-20190802002840-cff245a6509b
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.info
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.info: 200 OK (0.033s)
build mobile-issue: cannot find module for path golang.org/x/mobile/event/mouse

this behaviour is also showing up in a docker container:

$> docker run --rm -it -v `pwd`:/issue-35873 golang:1.13.4 bash
root@27520c44be65:/go# cd /issue-35873
root@27520c44be65:/issue-35873# ls
go.mod	main.go
root@27520c44be65:/issue-35873# GOOS=darwin GOPATH=`mktemp -d` go build -x -v
WORK=/tmp/go-build940858746
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.mod
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.mod
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.mod: 200 OK (0.095s)
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.mod: 200 OK (0.096s)
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190719004257-d2bd2a29d028.mod
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20191012152004-8de300cfc20a.mod
# get https://proxy.golang.org/github.com/%21burnt%21sushi/xgb/@v/v0.0.0-20160522181843-27f122750802.mod
# get https://proxy.golang.org/github.com/go-gl/glfw/v3.3/glfw/@v/v0.0.0-20191125211704-12ad95a8df72.mod
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.mod
# get https://proxy.golang.org/golang.org/x/mod/@v/v0.1.0.mod
# get https://proxy.golang.org/dmitri.shuralyov.com/gpu/mtl/@v/v0.0.0-20190408044501-666a987793e9.mod
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190412213103-97732733099d.mod
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20190909214602-067311248421.mod
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20190731235908-ec7cb31e5a56.mod
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190719004257-d2bd2a29d028.mod: 200 OK (0.010s)
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20191012152004-8de300cfc20a.mod: 200 OK (0.011s)
# get https://proxy.golang.org/github.com/%21burnt%21sushi/xgb/@v/v0.0.0-20160522181843-27f122750802.mod: 200 OK (0.012s)
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.mod: 200 OK (0.014s)
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20190909214602-067311248421.mod: 200 OK (0.013s)
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190412213103-97732733099d.mod: 200 OK (0.015s)
# get https://proxy.golang.org/golang.org/x/mod/@v/v0.1.0.mod: 200 OK (0.016s)
# get https://proxy.golang.org/github.com/go-gl/glfw/v3.3/glfw/@v/v0.0.0-20191125211704-12ad95a8df72.mod: 200 OK (0.017s)
# get https://proxy.golang.org/dmitri.shuralyov.com/gpu/mtl/@v/v0.0.0-20190408044501-666a987793e9.mod: 200 OK (0.017s)
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20190731235908-ec7cb31e5a56.mod: 200 OK (0.016s)
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190227222117-0694c2d4d067.mod
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20190306152737-a1d7652674e8.mod
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190620200207-3b0461eec859.mod
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190227222117-0694c2d4d067.mod: 200 OK (0.010s)
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190312061237-fead79001313.mod
# get https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20190510104115-cbcb75029529.mod
# get https://proxy.golang.org/golang.org/x/text/@v/v0.3.0.mod
# get https://proxy.golang.org/golang.org/x/xerrors/@v/v0.0.0-20190717185122-a985d3407aa7.mod
# get https://proxy.golang.org/golang.org/x/sync/@v/v0.0.0-20190423024810-112230192c58.mod
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20190312151545-0bb0c0a6e846.mod
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190312151609-d3739f865fa6.mod
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20190306152737-a1d7652674e8.mod: 200 OK (0.010s)
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190620200207-3b0461eec859.mod: 200 OK (0.010s)
# get https://proxy.golang.org/golang.org/x/sync/@v/v0.0.0-20190423024810-112230192c58.mod: 200 OK (0.014s)
# get https://proxy.golang.org/golang.org/x/text/@v/v0.3.0.mod: 200 OK (0.014s)
# get https://proxy.golang.org/golang.org/x/xerrors/@v/v0.0.0-20190717185122-a985d3407aa7.mod: 200 OK (0.015s)
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190312061237-fead79001313.mod: 200 OK (0.015s)
# get https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20190510104115-cbcb75029529.mod: 200 OK (0.015s)
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20190312151609-d3739f865fa6.mod: 200 OK (0.013s)
# get https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20190312151545-0bb0c0a6e846.mod: 200 OK (0.013s)
# get https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20190308221718-c2843e01d9a2.mod
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190215142949-d0b11bdaac8a.mod
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190404232315-eb5bcb51f2a3.mod
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190311183353-d8887717615a.mod
# get https://proxy.golang.org/golang.org/x/sys/@v/v0.0.0-20190215142949-d0b11bdaac8a.mod: 200 OK (0.010s)
# get https://proxy.golang.org/golang.org/x/crypto/@v/v0.0.0-20190308221718-c2843e01d9a2.mod: 200 OK (0.011s)
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190404232315-eb5bcb51f2a3.mod: 200 OK (0.009s)
# get https://proxy.golang.org/golang.org/x/net/@v/v0.0.0-20190311183353-d8887717615a.mod: 200 OK (0.010s)
go: downloading golang.org/x/mobile v0.0.0-20191123054942-d9e324ca8c38
go: downloading golang.org/x/exp v0.0.0-20191127035308-9964a5a80460
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.zip
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.zip
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.zip: 200 OK (0.035s)
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.zip: 200 OK (0.081s)
go: extracting golang.org/x/mobile v0.0.0-20191123054942-d9e324ca8c38
go: extracting golang.org/x/exp v0.0.0-20191127035308-9964a5a80460
go: downloading golang.org/x/image v0.0.0-20190802002840-cff245a6509b
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.zip
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.zip: 200 OK (0.036s)
go: extracting golang.org/x/image v0.0.0-20190802002840-cff245a6509b
go: finding golang.org/x/mobile v0.0.0-20191123054942-d9e324ca8c38
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.info
go: finding golang.org/x/exp v0.0.0-20191127035308-9964a5a80460
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.info
# get https://proxy.golang.org/golang.org/x/exp/@v/v0.0.0-20191127035308-9964a5a80460.info: 200 OK (0.010s)
# get https://proxy.golang.org/golang.org/x/mobile/@v/v0.0.0-20191123054942-d9e324ca8c38.info: 200 OK (0.010s)
go: finding golang.org/x/image v0.0.0-20190802002840-cff245a6509b
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.info
# get https://proxy.golang.org/golang.org/x/image/@v/v0.0.0-20190802002840-cff245a6509b.info: 200 OK (0.009s)
build mobile-issue: cannot find module for path golang.org/x/mobile/event/mouse
@hyangah

This comment has been minimized.

Copy link
Contributor

@hyangah hyangah commented Nov 29, 2019

ah, you're doing cross-compile while I was building on mac.
What happens if set CGO_ENABLED=1?

@hyangah

This comment has been minimized.

Copy link
Contributor

@hyangah hyangah commented Nov 29, 2019

From go list -json on tip, I got

     ...
	"DepsErrors": [
		{
			"ImportStack": [
				"issue-35873",
				"golang.org/x/exp/shiny/driver",
				"golang.org/x/exp/shiny/driver/gldriver",
				"golang.org/x/mobile/event/mouse"
			],
			"Pos": "../go/pkg/mod/golang.org/x/exp@v0.0.0-20191129030459-b0642c663571/shiny/driver/gldriver/cocoa.go:42:2",
			"Err": "cannot find package"
		}
	]

@bcmills @jayconrod

@jayconrod

This comment has been minimized.

Copy link
Contributor

@jayconrod jayconrod commented Dec 3, 2019

This seems to be a bug in go/build. We are including imports from cgo files, even though they are ignored when cgo is disabled. I filed #35946 for that.

@hyangah

This comment has been minimized.

Copy link
Contributor

@hyangah hyangah commented Dec 3, 2019

Thanks @jayconrod. Yes, I agree that this is a bug in go/build.
@sbinet I guess you can workaround by setting CGO_ENABLED=1 and - even when the bug is fixed - you will need cgo anyway.

Do we all agree that we close this bug?

@jayconrod

This comment has been minimized.

Copy link
Contributor

@jayconrod jayconrod commented Dec 3, 2019

I'm working on a fix for #35946. I'll close this bug together with that one.

The error message in cmd/go is unhelpful because we load packages on two paths: once when we load modules (which is correct) and once when we get ready to build (which is buggy). They should both being loading the same set of packages, but they aren't.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 3, 2019

Change https://golang.org/cl/209660 mentions this issue: go/build: don't include imports from cgo files when CGO_ENABLED=0

@jayconrod jayconrod modified the milestones: Unreleased, Go1.14 Dec 3, 2019
@gopherbot gopherbot closed this in ae2e244 Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.