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

bazel build error: unrecognized import path: "golang.org/x/sys" #89

Closed
YellyYU opened this issue Jul 22, 2018 · 9 comments
Closed

bazel build error: unrecognized import path: "golang.org/x/sys" #89

YellyYU opened this issue Jul 22, 2018 · 9 comments

Comments

@YellyYU
Copy link

YellyYU commented Jul 22, 2018

Hi guys:

I a new-learner of gVisor and was following the README instructions to look into gVisor these days.

Everything goes well when I download the latest nightly build, move it to /usr/local/bin, configuring docker in /etc/docker/daemon.json, and run the command $ docker run --runtime=runsc ...

And the runsc command such as $ runsc run ... also seems normal.

However, when I sought to compile runsc from source, I got error "unrecognized import path: "golang.org/x/sys"" at $ bazel build runsc.

I googled for possible solutions but none of them can get me out of this.

I am sure I got the contents from sources like https://github.com/golang/sys.git under my $GOPATH/src/golang.org/x/ directory, but the error just won't go.

I hope anyone here could help me. Many thanks.

@prattmic
Copy link
Member

Hm, it should "just work". Could you include the entire output from bazel build?

@YellyYU
Copy link
Author

YellyYU commented Jul 24, 2018

@prattmic first thank you for your prompt reply!

Specifically I run $ bazel build runsc in gvisor directory, the outputs are as follows:

WARNING: ignoring http_proxy in environment.
Starting local Bazel server and connecting to it...
.........
ERROR: /home/yelly/gvisor/runsc/cmd/BUILD:5:1: no such package '@org_golang_x_sys//unix': failed to fetch org_golang_x_sys: 2018/07/24 19:07:06 unrecognized import path "golang.org/x/sys"
and referenced by '//runsc/cmd:cmd'
ERROR: Analysis of target '//runsc:runsc' failed; build aborted: no such package '@org_golang_x_sys//unix': failed to fetch org_golang_x_sys: 2018/07/24 19:07:06 unrecognized import path "golang.org/x/sys"
INFO: Elapsed time: 62.445s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (180 packages loaded)

And here are some information that might be useful:
$ docker version
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:17:20 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm

Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:15:30 2018
OS/Arch: linux/amd64
Experimental: false

$ uname -a
Linux yelly-ipads 4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Many thanks if you could help me with this prob

@newmanwang
Copy link
Contributor

newmanwang commented Jul 24, 2018

Got the same error by following "Installing from Source" in project README.md.

[rice@localhost gvisor]$ go version
go version go1.10.3 linux/amd64
[rice@localhost gvisor]$ uname -a
Linux localhost.localdomain 4.15.16-200.fc26.x86_64 #1 SMP Mon Apr 9 17:49:29 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[rice@localhost gvisor]$ pwd
/data/project/github/newmanwang/gvisor/src/gvisor.googlesource.com/gvisor
[rice@localhost gvisor]$ echo $GOPATH
/data/project/github/newmanwang/gvisor
[rice@localhost gvisor]$ echo $GOROOT
/home/rice/.gvm/gos/go1.10.3
[rice@localhost gvisor]$ bazel build runsc
ERROR: /data/project/github/newmanwang/gvisor/src/gvisor.googlesource.com/gvisor/runsc/cmd/BUILD:5:1: no such package '@org_golang_x_sys//unix': failed to fetch org_golang_x_sys: 2018/07/24 21:17:59 unrecognized import path "golang.org/x/sys"
and referenced by '//runsc/cmd:cmd'
ERROR: Analysis of target '//runsc:runsc' failed; build aborted: no such package '@org_golang_x_sys//unix': failed to fetch org_golang_x_sys: 2018/07/24 21:17:59 unrecognized import path "golang.org/x/sys"
INFO: Elapsed time: 42.944s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (104 packages loaded)

@newmanwang
Copy link
Contributor

newmanwang commented Jul 24, 2018

The problem is gone by setting HTTP_PROXY and HTTPS_PROXY environment before running bazel build. Thanks to the great wall... @YellyYU

@wuqixuan
Copy link

@newmanwang Would you tell me how and what did you set for HTTP_PROXY and HTTPS_PROXY ?

@newmanwang
Copy link
Contributor

newmanwang commented Jul 25, 2018

Make HTTP_PROXY and HTTPS_PROXY point to a proxy that beat the greate firewall, e.g HTTPS_PROXY=192.168.16.1:1080 @wuqixuan

@Ddnirvana
Copy link

@newmanwang hi, I also meet the same problem like @YellyYU , and I have set the http_proxy and https_proxy environment. However, from the build log, the fist line "WARNING: ignoring http_proxy in environment" tells that this setting is ignored by bazel. Have you meet this issue? Could you tell me how to fix that problem..

@newmanwang
Copy link
Contributor

@prattmic Try HTTPS_PROXY/HTTP_PROXY instead of https_proxy/http_proxy

@YellyYU
Copy link
Author

YellyYU commented Aug 17, 2018

This problem is gone after I pulled the latest source code and rebuild...

@YellyYU YellyYU closed this as completed Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants