glide
glide copied to clipboard
Broken cache paths
System Specs
OS: OSX 10.12 Glide: 0.12.3 installed from Brew
Overview
I've run in to an issue when attempting to add dependencies to an existing glide project where the path to cache looks rather odd as it's prefixing the full folder path with dashes to the cached folder name. After deleting both my projects vendor folder, as well as running glide cc
in different combinations, I can't seem to get past errors such as these. They find ways of breaking with different packages, not just x/sys/unix.
Error Message Example:
...
[INFO] --> Fetching updates for golang.org/x/text.
[ERROR] Could not find /Users/dustinblackman/.glide/cache/src/https-golang.org-x-sys/unix: open /Users/dustinblackman/.glide/cache/src/https--Users-dustinblackman-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
[ERROR] Dependency golang.org/x/sys/unix (/Users/dustinblackman/.glide/cache/src/https-golang.org-x-sys/unix) failed to resolve: open /Users/dustinblackman/.glide/cache/src/https--Users-dustinblackman-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory.
[ERROR] Failed to retrieve a list of dependencies: open /Users/dustinblackman/.glide/cache/src/https--Users-dustinblackman-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
Reproduce
Clean project, no vendor folder, empty glide cache, using the the following glide.yml copied out of one of the projects I'm having this issue with.
package: github.com/dustinblackman/app
import:
- package: github.com/hpcloud/tail
- package: github.com/fsouza/go-dockerclient
- package: github.com/iris-contrib/middleware
- package: github.com/davecgh/go-spew
- package: github.com/tidwall/gjson
- package: gopkg.in/kataras/iris.v4
- package: github.com/ungerik/go-dry
- package: gopkg.in/fsnotify.v1
version: ~1.4.1
- package: github.com/spf13/cobra
- package: github.com/spf13/viper
glide install
glide get --all-dependencies github.com/Sirupsen/logrus
After running the last command to install logrus, an error such as the one above will happen.
Same issue here
[DEBUG] Scanning with Arch(), OS(), and Build Tags([])
[DEBUG] Problem parsing package at /Users/danny/.glide/cache/src/https--Users-danny-.glide-cache-src-https-golang.org-x-sys-unix for
[ERROR] Could not find /Users/danny/.glide/cache/src/https-golang.org-x-sys/unix: open /Users/danny/.glide/cache/src/https--Users-danny-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
[ERROR] Dependency golang.org/x/sys/unix (/Users/danny/.glide/cache/src/https-golang.org-x-sys/unix) failed to resolve: open /Users/danny/.glide/cache/src/https--Users-danny-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory.
[ERROR] Failed to retrieve a list of dependencies: open /Users/danny/.glide/cache/src/https--Users-danny-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
This issue is introduced in 0.12.0. 0.11.1 is working fine.
Sorry for the delayed response. This may well be a duplicate of a number of other open issues. Simplest way to figure that out - does the problem go away if you glide cc
?
Same issue for me when installing deps for spf13/cobra
(glide version 0.12.3) :
glide update --all-dependencies
[INFO] Downloading dependencies. Please wait...
[INFO] --> Fetching github.com/spf13/cobra.
[INFO] Resolving imports
[INFO] --> Fetching github.com/inconshreveable/mousetrap.
[INFO] --> Fetching github.com/spf13/pflag.
[INFO] --> Fetching github.com/spf13/viper.
[INFO] --> Fetching github.com/cpuguy83/go-md2man.
[INFO] --> Fetching github.com/fsnotify/fsnotify.
[INFO] --> Fetching github.com/hashicorp/hcl.
[INFO] --> Fetching github.com/magiconair/properties.
[INFO] --> Fetching github.com/mitchellh/mapstructure.
[INFO] --> Fetching github.com/pelletier/go-toml.
[INFO] --> Fetching github.com/spf13/afero.
[INFO] --> Fetching github.com/spf13/cast.
[INFO] --> Fetching github.com/spf13/jwalterweatherman.
[INFO] --> Fetching gopkg.in/yaml.v2.
[INFO] --> Fetching github.com/xordataexchange/crypt.
[INFO] --> Fetching github.com/russross/blackfriday.
[INFO] --> Fetching golang.org/x/sys.
[INFO] --> Fetching github.com/pelletier/go-buffruneio.
[INFO] --> Fetching golang.org/x/text.
[INFO] --> Fetching github.com/pkg/sftp.
[INFO] --> Fetching github.com/shurcooL/sanitized_anchor_name.
[ERROR] Could not find /Users/roland/.glide/cache/src/https-golang.org-x-sys/unix: open /Users/roland/.glide/cache/src/https--Users-roland-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
[ERROR] Dependency golang.org/x/sys/unix (/Users/roland/.glide/cache/src/https-golang.org-x-sys/unix) failed to resolve: open /Users/roland/.glide/cache/src/https--Users-roland-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory.
[ERROR] Failed to retrieve a list of dependencies: open /Users/roland/.glide/cache/src/https--Users-roland-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
I did a glide cc
before.
fyi, glide 0.10.2 worked for me.
I noticed the same problem today running glide update with Glide version 0.12.3.
[ERROR] Could not find /Users/seh/.glide/cache/src/https-golang.org-x-sys/unix: open /Users/seh/.glide/cache/src/https--Users-seh-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
[ERROR] Dependency golang.org/x/sys/unix (/Users/seh/.glide/cache/src/https-golang.org-x-sys/unix) failed to resolve: open /Users/seh/.glide/cache/src/https--Users-seh-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory.
[ERROR] Failed to retrieve a list of dependencies: open /Users/seh/.glide/cache/src/https--Users-seh-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
Note the extra "-Users-seh-.glide-cache-src-https-" in that file path.
% file ~/.glide/cache/src/https-golang.org-x-sys/unix
/Users/seh/.glide/cache/src/https-golang.org-x-sys/unix: directory
Running glide cc has not helped.
This bit me again today, three weeks later, again with this "x/sys/unix" package. Is there any reliable workaround?
So this has been around for a while. Issue #468, despite its title, ends up being about this issue. At the time I first encountered it, I traced the error through the Glide code and came up with a patch that fixed the issue for me. See my comment on Dec 5.
The patch continues to work for me (I just reencountered this problem, having forgotten about it, which led me here). Use at your own risk. Repasted here to save a click.
diff --git a/dependency/resolver.go b/dependency/resolver.go
index bf59c3e..5f339f8 100644
--- a/dependency/resolver.go
+++ b/dependency/resolver.go
@@ -827,7 +827,7 @@ func (r *Resolver) imports(pkg string, testDeps, addTest bool) ([]string, error)
if testDeps {
_, imps, err = IterativeScan(r.Handler.PkgPath(pkg))
} else {
- imps, _, err = IterativeScan(r.Handler.PkgPath(pkg))
+ imps, _, err = IterativeScan(pkg)
}
if err != nil {
@neocortical What glide version are you at? Your patch didn't work in 0.13.0-dev
I am at 0.13.0-dev and it still works for me.
Is there any workaround that doesn't involve hacking the glide code?
9 months later, I'm now running into this as well:
[INFO] --> Fetching updates for github.com/boombuler/barcode.
[ERROR] Could not find /Users/josh/.glide/cache/src/https-golang.org-x-sys/unix: open /Users/josh/.glide/cache/src/https--Users-josh-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
[ERROR] Dependency golang.org/x/sys/unix (/Users/josh/.glide/cache/src/https-golang.org-x-sys/unix) failed to resolve: open /Users/josh/.glide/cache/src/https--Users-josh-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory.
[ERROR] Failed to retrieve a list of test dependencies: open /Users/josh/.glide/cache/src/https--Users-josh-.glide-cache-src-https-golang.org-x-sys-unix: no such file or directory
This seems like quite a serious bug to remain unresolved. How have others worked around this other than hacking glide code as @brikis98 suggests?
the same to me
For me, it works after did the command glide install
before glide update
, don't know why but ok.
I'm using glide 0.13.4 and getting after : glide get cloud.google.com/go/translate/apiv3 --all-dependencies
[ERROR] Could not find /home/mm/.glide/cache/src/https-github.com-lib-pq/oid: open /home/mm/.glide/cache/src/https--home-mm-.glide-cache-src-https-github.com-lib-pq-oid: no
such file or directory
[ERROR] Dependency github.com/lib/pq (/home/mm/.glide/cache/src/https-github.com-lib-pq/oid) failed to resolve: open /home/mm/.glide/cache/src/https--home-mm-.glide-cache-sr
c-https-github.com-lib-pq-oid: no such file or directory.
[ERROR] Failed to retrieve a list of dependencies: open /home/mm/.glide/cache/src/https--home-mm-.glide-cache-src-https-github.com-lib-pq-oid: no such file or directory
is there still no fix for this?