glide icon indicating copy to clipboard operation
glide copied to clipboard

Broken cache paths

Open dustinblackman opened this issue 8 years ago • 15 comments

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.

dustinblackman avatar Oct 14 '16 19:10 dustinblackman

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

dverbeek84 avatar Nov 04 '16 11:11 dverbeek84

This issue is introduced in 0.12.0. 0.11.1 is working fine.

dverbeek84 avatar Nov 04 '16 12:11 dverbeek84

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?

sdboyer avatar Dec 07 '16 20:12 sdboyer

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.

rhuss avatar Dec 29 '16 09:12 rhuss

fyi, glide 0.10.2 worked for me.

rhuss avatar Dec 29 '16 09:12 rhuss

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.

seh avatar Jan 03 '17 21:01 seh

This bit me again today, three weeks later, again with this "x/sys/unix" package. Is there any reliable workaround?

seh avatar Jan 24 '17 21:01 seh

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 avatar Mar 02 '17 19:03 neocortical

@neocortical What glide version are you at? Your patch didn't work in 0.13.0-dev

lucaswxp avatar Mar 30 '17 18:03 lucaswxp

I am at 0.13.0-dev and it still works for me.

neocortical avatar Mar 30 '17 19:03 neocortical

Is there any workaround that doesn't involve hacking the glide code?

brikis98 avatar Apr 01 '17 04:04 brikis98

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?

josh-padnick avatar Jul 25 '17 02:07 josh-padnick

the same to me

zouyee avatar Jul 31 '17 14:07 zouyee

For me, it works after did the command glide install before glide update, don't know why but ok.

priscila225 avatar Oct 03 '17 19:10 priscila225

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?

matthias-mess avatar Oct 01 '20 05:10 matthias-mess