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/net/trace: cannot find module for path golang.org/x/net/trace #29014

Closed
ScottHuangZL opened this issue Nov 30, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@ScottHuangZL
Copy link

commented Nov 30, 2018

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

go version go1.11.2 windows/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\scott_huang\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=c:\personal\golang\scott_huang
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=c:\personal\GoLang\projects\blockchain\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\SCOTT_~1\AppData\Local\Temp\go-build431748462=/tmp/go-build -gno-record-gcc-switches

What did you do?

go run main.go

What did you expect to see?

Run successfully. The issue may be caused be China not able download golang.org/x/net through normal go get. So I try git clone it from github.com/golang/net and put in my pkg/cache/download folder, but still not work.

In normal none mod enviroment, usually we resolve this kind of issue by my above methodology.

Any tip to resolve this issue if the mod auto get not work? Aka, any manual tip?

What did you see instead?

build github.com/ScottHuangZL/blockchain: cannot find module for path golang.org/x/net/trace

@gopherbot gopherbot added this to the Unreleased milestone Nov 30, 2018

@agnivade

This comment has been minimized.

Copy link
Member

commented Nov 30, 2018

Duplicate of #28652. Please use a replace statement or other solutions which are pointed in that thread.

Thanks.

@agnivade agnivade closed this Nov 30, 2018

@ScottHuangZL

This comment has been minimized.

Copy link
Author

commented Nov 30, 2018

Why close this issue? And #28652 seem also not resolved.

I try add replace golang.org/x/net/trace v0.0.0-20181129055619-fae4c4e3ad76 => github.com/golang/net/trace v0.0.0-20181129055619-fae4c4e3ad76 //indirect

also not work.

Let me restate issue again:

  1. I am plan import "github.com/dgraph-io/badger"
  2. It indirect require golang.org/x/net/trace
  3. I know need try use replace methodology to resolve this kind of issue
  4. But still not work with below pain points:
    a. I have to try find out the version. Can we let it blank or use * to mean match any version?
    b. Even I try go to github to capture your latest commit and put in mod file, it still not work.
    c. I try git clone github.com/golang/net and put in cache folder, also useless.

Any better and easy way? Or else, I have to abandon mod way and go back to traditional way again.

@agnivade

This comment has been minimized.

Copy link
Member

commented Nov 30, 2018

I closed this because it is the duplicate of #28652. Closing this does not mean that the issue is fixed. It just means that the issue is being tracked somewhere else.

You have rightly commented on your pain points on that issue. We will be tracking those in that thread.

Thanks.

@ScottHuangZL

This comment has been minimized.

Copy link
Author

commented Nov 30, 2018

I try below, and finally work!
go mod edit -require=golang.org/x/net@v0.0.0
go mod edit -replace=golang.org/x/net@v0.0.0=github.com/golang/net@latest

But the "go build" take a long time to complete build. ==> I have concern for the long build time even it finally success complete, how to resolve it?? Thanks.

If I try "go build -x -v", it will be failed with below message:
Fetching https://golang.org/x/net?go-get=1
https fetch failed: Get https://golang.org/x/net?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

It means every build actually it try fetch from online again for x/net. Why? thanks.

@ScottHuangZL

This comment has been minimized.

Copy link
Author

commented Dec 3, 2018

A quick way:
go mod tidy
go mod vendor
go build -mod=vendor

Then the build speed still fast!!!

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.