Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

godep: Unable to find dependent package golang.org/x/sys/unix in context of /Users/apple/workspace/go/src/github.com/Sirupsen/logrus #377

Open
ghost opened this issue Dec 22, 2015 · 30 comments
Assignees

Comments

@ghost
Copy link

ghost commented Dec 22, 2015

on go 1.5.2
I cant work out why it screams for logrus.

gedw99-MacBook-Pro:backend apple$ go env
GOARCH="amd64"
GOBIN="/Users/apple/workspace/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/apple/workspace/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT=""
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"



gedw99-MacBook-Pro:backend apple$ godep save -r
godep: Unable to find dependent package golang.org/x/sys/unix in context of /Users/apple/workspace/go/src/github.com/Sirupsen/logrus
gedw99-MacBook-Pro:backend apple$ go get github.com/Sirupsen/logrus
gedw99-MacBook-Pro:backend apple$ godep save -r
godep: Unable to find dependent package golang.org/x/sys/unix in context of /Users/apple/workspace/go/src/github.com/Sirupsen/logrus
gedw99-MacBook-Pro:backend apple$ 


@ghost
Copy link
Author

ghost commented Dec 22, 2015

SO, is this a bug ? Or misuse by me ?
Once i did a go get golang.org/x/sys/unix, then godep was happy.
So it should be included in godep binary or whatever ?


dw99-MacBook-Pro:backend apple$ godep save -r
godep: Unable to find dependent package golang.org/x/sys/unix in context of /Users/apple/workspace/go/src/github.com/Sirupsen/logrus
gedw99-MacBook-Pro:backend apple$ go get golang.org/x/sys/unix
gedw99-MacBook-Pro:backend apple$ godep save -r
gedw99-MacBook-Pro:backend apple$ 


My json file includes it now

"GoVersion": "go1.5",
    "Deps": [
        {
            "ImportPath": "github.com/Sirupsen/logrus",
            "Comment": "v0.8.7-53-g446d1c1",
            "Rev": "446d1c146faa8ed3f4218f056fcd165f6bcfda81"
        },
        {
            "ImportPath": "github.com/cenkalti/backoff",
            "Rev": "4dc77674aceaabba2c7e3da25d4c823edfb73f99"
        },
        {
            "ImportPath": "github.com/dancannon/gorethink",
            "Comment": "v1.2.0",
            "Rev": "a124c9663325ed9f7fb669d17c69961b59151e6e"
        },
        {
            "ImportPath": "github.com/golang/protobuf/proto",
            "Rev": "68415e7123da32b07eab49c96d2c4d6158360e9b"
        },
        {
            "ImportPath": "github.com/gorilla/context",
            "Rev": "1c83b3eabd45b6d76072b66b746c20815fb2872d"
        },
        {
            "ImportPath": "github.com/gorilla/mux",
            "Rev": "9c068cf16d982f8bd444b8c352acbeec34c4fe5b"
        },
        {
            "ImportPath": "github.com/gorilla/websocket",
            "Rev": "3986be78bf859e01f01af631ad76da5b269d270c"
        },
        {
            "ImportPath": "github.com/hailocab/go-hostpool",
            "Rev": "faaa51ba3a12563c543dfcca581b81fa2c2de95e"
        },
        {
            "ImportPath": "golang.org/x/sys/unix",
            "Rev": "833a04a10549a95dc34458c195cbad61bbb6cb4d"
        },
        {
            "ImportPath": "gopkg.in/fatih/pool.v2",
            "Rev": "cba550ebf9bce999a02e963296d4bc7a486cb715"
        }
    ]
}


@freeformz
Copy link

It is a transitive dependency that "go get" does not fetch, but can be required on other platforms to build the package. Older versions of godep relied on the go tool, but we no longer do, for exactly this reason.

I plan on enhancing this workflow, especially around GO15VENDOREXPERIMENT.

Sent from my iPhone

On Dec 22, 2015, at 06:06, Ged notifications@github.com wrote:

This is a bug i think.
Once i did a go get golang.org/x/sys/unix, then godep was happy.
So it should be included in godep binary or whatever ?

dw99-MacBook-Pro:backend apple$ godep save -r
godep: Unable to find dependent package golang.org/x/sys/unix in context of /Users/apple/workspace/go/src/github.com/Sirupsen/logrus
gedw99-MacBook-Pro:backend apple$ go get golang.org/x/sys/unix
gedw99-MacBook-Pro:backend apple$ godep save -r
gedw99-MacBook-Pro:backend apple$


Reply to this email directly or view it on GitHub.

@mikeatlas
Copy link

I've hit this as well while attempting cross platform compilations on our CI build server. I added a go get golang.org/x/sys/unix call prior to the GOOS=x GOARCH=y go build step, and it resolved the "error"... although it does seem superfluous to make a call to fetch a core Go package and/or include it in our Godeps.

@freeformz
Copy link

@mikeatlas golang.org/x/sys/unix is not a "core" Go package. If you godep save and record that dep you can remove the need to fetch it with go get.

@geofffranks
Copy link

Also ran into this with github.com/mattn/go-isatty. GOOS=solaris godep save ./... got me the right deps, but according to #161 the platform-specific fetching was fixed with the latest versions of GoDep.

Pulling from master on godep, and re-installing resolved this for me. maybe take a look at that?

@freeformz
Copy link

@geofffranks Yes, this should be fixed as of a month or two ago. I'm going to close this issue, but feel free to re-open if it's still failing with deps saved by v55.

Thanks!

@xealot
Copy link

xealot commented Feb 25, 2016

I'm seeing this during save, it's quite confusing.

$ godep version
godep v55 (darwin/amd64/go1.6)
$ godep save ./cmd/...
godep: Package (golang.org/x/sys/unix) not found

Is this because go get doesn't bother installing golang.org/x/sys/unix anymore?

@freeformz
Copy link

Something you are requiring is transitively pulling in golang.org/x/sys/unix across OSes.

@andreleblanc-wf
Copy link

I am running go 1.6 and godep v56, and still having this issue with logrus:

$ godep version
godep v56 (darwin/amd64/go1.6)

$ godep restore
godep: Dep (github.com/Sirupsen/logrus) restored, but was unable to load it with error:
    Package (golang.org/x/sys/unix) not found
godep: Error checking some deps.

@freeformz
Copy link

go get golang.org/x/sys/unix. After the restore you probably need to re-save to record golang.org/x/sys/unix.

@roxma
Copy link

roxma commented May 18, 2016

I had the same issue. Saidly, We Tianchao people can't asscess golang.org directly, and I had to download the package via proxy manually to solve the dependency issue...

@roxma
Copy link

roxma commented May 18, 2016

the terminals_solaris.go in the Logrus package has a build constraints // +build solaris, which is where golang.org/x/sys/unix get imported.

I build my project on centos,, so I don't need unix package for it, but godep still claims Unable to find dependent package golang.org/x/sys/unix

Should we add a -b option into godep to generate dependency following those build constraints?

@freeformz
Copy link

Sorry. I should have replied sooner. This got lost in email. :-(

I'd much rather do this by making this configurable via an array in Godps.json. Plus ensure that our code handles all the various permutations of build tags. And maybe default to what is hard coded now.

@blainsmith
Copy link

Any updates on this? Running Go1.6 and Godep 70 on OSX and still getting this error with godep save ./...

@diogogmt
Copy link

I'm also having problems with the golang.org/x/sys/unix when saving the applications dependencies.

@freeformz
However, would this problem be related to vendoring libraries that also do vendoring?

@freeformz
Copy link

@diogogmt This is likely due to the fact that godep ignores arch build constraints, since it doesn't know where you will finally compile code. It's very common for people to dev on macOS, but build on Linux for instance.

@denyskoch
Copy link

denyskoch commented Aug 19, 2016

getting same error [godep: Package (golang.org/x/sys/unix) not found]

  • OSX 10.11.6

    $ godep version
    godep v74 (darwin/amd64/go1.7)

    $ go version
    go version go1.7 darwin/amd64

@thomasmodeneis
Copy link

thomasmodeneis commented Aug 29, 2016

Weird, after updating from 1.6.2 to 1.7 on macos 10.8.x I'm running into the same error

$ godep save
godep: WARNING: Godep workspaces (./Godeps/_workspace) are deprecated and support for them will be removed when go1.8 is released.
godep: WARNING: Go version (go1.7) & $GO15VENDOREXPERIMENT= wants to enable the vendor experiment, but disabling because a Godep workspace (Godeps/_workspace) exists
godep: Package (golang.org/x/sys/unix) not found

I got it fixed after deleting /usr/local/go and doing a clean instalation followed by go get golang.org/x/sys/unix

@freeformz
Copy link

go get golang.org/x/sys/unix

FWIW: Now that work has started for a native solution (
https://groups.google.com/forum/#!msg/go-package-management/P8TehVoFLjg/Ni6VRyOjEAAJ),
I'm likely not going to be working on godep very much. In the interim I'm
suggesting people migrate to govendor (https://github.com/kardianos/govendor)
if they are having problems with godep.

On Mon, Aug 29, 2016 at 1:47 AM thomasmodeneis notifications@github.com
wrote:

Weird, after updating from 1.6.2 to 1.7 on macos 10.8.x I'm running into
the same error

$ godep save
godep: WARNING: Godep workspaces (./Godeps/_workspace) are deprecated and support for them will be removed when go1.8 is released.
godep: WARNING: Go version (go1.7) & $GO15VENDOREXPERIMENT= wants to enable the vendor experiment, but disabling because a Godep workspace (Godeps/_workspace) exists
godep: Package (golang.org/x/sys/unix) not found


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#377 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAAZ2J3a_gmAQLRBLJ_1jKfauSK9ybhks5qkpycgaJpZM4G51iU
.

@freeformz
Copy link

PS: You will need to add "solaris" to the list of ignores in
vendor/vendor.json if you move to govendor or you will still need
x/sys/unix.

On Mon, Aug 29, 2016 at 11:10 AM Edward Muller edwardam@interlix.com
wrote:

go get golang.org/x/sys/unix http://golang.org/x/sys/unix

FWIW: Now that work has started for a native solution (
https://groups.google.com/forum/#!msg/go-package-management/P8TehVoFLjg/Ni6VRyOjEAAJ),
I'm likely not going to be working on godep very much. In the interim I'm
suggesting people migrate to govendor (
https://github.com/kardianos/govendor) if they are having problems with
godep.

On Mon, Aug 29, 2016 at 1:47 AM thomasmodeneis notifications@github.com
wrote:

Weird, after updating from 1.6.2 to 1.7 on macos 10.8.x I'm running into
the same error

$ godep save
godep: WARNING: Godep workspaces (./Godeps/_workspace) are deprecated and support for them will be removed when go1.8 is released.
godep: WARNING: Go version (go1.7) & $GO15VENDOREXPERIMENT= wants to enable the vendor experiment, but disabling because a Godep workspace (Godeps/_workspace) exists
godep: Package (golang.org/x/sys/unix) not found


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#377 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAAZ2J3a_gmAQLRBLJ_1jKfauSK9ybhks5qkpycgaJpZM4G51iU
.

@hadv
Copy link

hadv commented Nov 10, 2016

I have the same problem when building docker image. It can be solved by adding below go get

RUN go get golang.org/x/sys/unix

@ashcrow
Copy link

ashcrow commented Nov 21, 2016

go get golang.org/x/sys/unix

Doesn't seem to work anymore as it's become a redirect to https://godoc.org/golang.org/x/sys/unix

@caojunxyz
Copy link

caojunxyz commented Nov 30, 2016

I encountered the same problem, my environment is:
macOS 10.12.1
godep v75 (darwin/amd64/go1.7)
go version go1.7 darwin/amd64

govendor works well.

When I ran command: go get -u -v golang.org/x/sys/unix, it also failed with output:
Fetching https://golang.org/x/sys/unix?go-get=1
https fetch failed: Get https://golang.org/x/sys/unix?go-get=1: dial tcp 216.239.37.1:443: i/o timeout
package golang.org/x/sys/unix: unrecognized import path "golang.org/x/sys/unix" (https fetch: Get https://golang.org/x/sys/unix?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

@wanghaoran1988
Copy link

wanghaoran1988 commented Mar 22, 2017

I met the problem:
godep v79 (linux/amd64/go1.7.1
go version go1.8 linux/amd64

go get golang.org/x/sys/unix                                       
# cd /home/haoran/workspace/devel/src/golang.org/x/sys; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/sys/unix: exit status 1

@wanghaoran1988
Copy link

After I delete the pakage, and run go get again, it works know. :)

@dmonay
Copy link

dmonay commented Apr 16, 2017

I am getting the same error. @ashcrow if the package is no longer hosted at golang.org why do other packages still reference that import path?

godep: error downloading dep (golang.org/x/sys/unix): unable to determine git status exit status 128

When I try to go get the package directly, I get this error:

$ go get -v -u golang.org/x/sys/...
Fetching https://golang.org/x/sys?go-get=1
https fetch failed: Get https://golang.org/x/sys?go-get=1: net/http: TLS handshake timeout
package golang.org/x/sys/...: unrecognized import path "golang.org/x/sys/..." (https fetch: Get https://golang.org/x/sys?go-get=1: net/http: TLS handshake timeout)

The odd part is that when godep restore is running/hanging, I can't access https sites on my entire system (i.e. any browser, curl, etc). I think godep is hanging because of the TLS handshake timeout, but I don't know where this timeout is stemming from - is it something on my system (like a misconfigured certificate) or is it a problem with a Go tool, or is it an issue with the code repositories' hosting?

The TLS timeout happens with this package as well:

$ go get -v gopkg.in/yaml.v2
Fetching https://gopkg.in/yaml.v2?go-get=1
https fetch failed: Get https://gopkg.in/yaml.v2?go-get=1: net/http: TLS handshake timeout
package gopkg.in/yaml.v2: unrecognized import path "gopkg.in/yaml.v2" (https fetch: Get https://gopkg.in/yaml.v2?go-get=1: net/http: TLS handshake timeout)

@dmonay
Copy link

dmonay commented Apr 23, 2017

Turns out this was an issue with OpenDNS fsnotify/fsnotify#204 (comment)

@mattberther
Copy link

I'm seeing similar errors. Has anyone identified a solution?

$ go get -v -u golang.org/x/tools/cmd/gorename
Fetching https://golang.org/x/tools/cmd/gorename?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/gorename?go-get=1: dial tcp 216.58.216.241:443: connect: host is down
package golang.org/x/tools/cmd/gorename: unrecognized import path "golang.org/x/tools/cmd/gorename" (https fetch: Get https://golang.org/x/tools/cmd/gorename?go-get=1: dial tcp 216.58.216.241:443: connect: host is down)

@mattberther
Copy link

Turns out mine was an issue with Little Snitch (a network filter), although Im still not clear why.

@tigerneil
Copy link

tigerneil commented Feb 24, 2019

fix this by downloading packages manually.

mkdir -p $GOPATH/src/golang.org/x/
cd !$
git clone https://github.com/golang/sys.git

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests