Masterminds / glide

Package Management for Golang
https://glide.sh
Other
8.15k stars 541 forks source link

cannot find package "." #968

Open k1ng440 opened 6 years ago

k1ng440 commented 6 years ago
[INFO]  Resolving imports
[INFO]  Found GB manifest file in /home/k1ng/.glide/cache/src/https-github.com-fatih-color
[INFO]  --> Parsing GB metadata...
[INFO]  --> Fetching updates for github.com/mattn/go-colorable
[INFO]  --> Setting version for github.com/mattn/go-colorable to 5411d3eea5978e6cdc258b30de592b60df6aba96.
[INFO]  --> Fetching updates for github.com/mattn/go-isatty
[INFO]  --> Setting version for github.com/mattn/go-isatty to 57fdcb988a5c543893cc61bce354a6e24ab70022.
[INFO]  --> Fetching updates for github.com/moul/http2curl
[INFO]  --> Fetching updates for github.com/rs/cors
[INFO]  --> Detected semantic version. Setting version for google.golang.org/grpc to v1.9.2
[INFO]  --> Fetching updates for golang.org/x/crypto
[INFO]  --> Setting version for golang.org/x/sys to e24f485414aeafb646f6fca458b0bf869c0880a1.
[INFO]  --> Fetching updates for github.com/mgutz/ansi
[INFO]  --> Detected semantic version. Setting version for github.com/go-redis/redis to v6.8.2
[INFO]  --> Fetching updates for github.com/graarh/golang-socketio
[INFO]  Found Godeps.json file in /home/k1ng/.glide/cache/src/https-github.com-moul-http2curl
[INFO]  --> Parsing Godeps metadata...
[INFO]  --> Fetching updates for google.golang.org/genproto
[INFO]  --> Fetching updates for golang.org/x/text
[INFO]  --> Detected semantic version. Setting version for github.com/onsi/ginkgo to v1.4.0
[INFO]  --> Detected semantic version. Setting version for github.com/onsi/gomega to v1.3.0
[INFO]  --> Fetching updates for github.com/corpix/uarand
[ERROR] Error scanning bitbucket.org/k1ng440/multi-exchange-fetcher/currency/calculator: cannot find package "." in:
        /mnt/d/Go/src/bitbucket.org/k1ng440/multi-exchange-fetcher/currency/calculator
[ERROR] Error scanning bitbucket.org/k1ng440/multi-exchange-fetcher/storage/memory: cannot find package "." in:
        /mnt/d/Go/src/bitbucket.org/k1ng440/multi-exchange-fetcher/storage/memory
[INFO]  --> Fetching updates for gopkg.in/yaml.v2
[ERROR] Failed to retrieve a list of test dependencies: Error resolving imports
seeruk commented 6 years ago

Some more info on this, as it's something I've hit too. It looks like it's caused by a repository's structure changing, i.e. a sub-package being moved, or removed entirely.

I'm not sure if this is required sometimes, but I'd prefer it if Glide simple didn't care about the structure of the code once it's fetched a repository. There are many times when I want to download updated code and put it in the vendor directory so that I can make the code changes necessary for a build, but I have to either place the dependencies in there manually, or start making changes without the support of my IDE's auto-completion because the updated dependencies don't exist yet. Both of those options are quite frustrating (though I'd argue that the approach dep takes to similar issues is even worse right now...).

eliquious commented 6 years ago

Has anyone discovered a work around for this error?

seeruk commented 6 years ago

If the package that has been updated is under your own control, then I've since found it easier to use some of the newer Go features like type aliases to ease the pain from refactoring. So, instead of just moving a package, move it and then make aliases to the new location in the old one so that your older code still works. Then, gradually move things over. Basically just mark things as deprecated but make sure they're still usable for a little while until you've ported new code over.

If the package is not in your control, then you can always clone the version you want manually to your vendor folder and make your updates in your code. Once you're done, Glide should let you update again. If it's much more complex, sometimes it's even easier to revert to using go get until you're done updating packages, and rely on your $GOPATH contents.

It's far from ideal, but there are ways you can work around it at least. In the mean time, I've also made an issue about this on dep. I think they're looking into a way of disabling this kind of check if you just want the tool to trust you as the developer.

kofalt commented 6 years ago

I'm running into this a lot with docker and docker-ish imports.

It would be nice to have a flag that lets me update all my other, healthy deps, and ignore the one with a problem. Right now, it's a bit of a pain to check for updates for everything else.

ravik-karn commented 6 years ago

any solution found yet?

yogihardi commented 5 years ago

maybe you can try clean up the cache and do update

$> glide cc
$> glide up
jasimmk commented 5 years ago

maybe you can try clean up the cache and do update

$> glide cc
$> glide up

Worked for me, thanks

xing00lian commented 4 years ago

why this could work?

phaneendrayeluri commented 4 years ago

I have a similar issue with an application I am building. I tried all the above, but no luck.

glide init added the following dependency to the glide.yaml `....

but when I run glide up i get the following error. ... [ERROR] Error scanning github.com/jackc/pgproto3/v2: cannot find package "." in: /Users/XXXXX/.glide/cache/src/https-github.com-jackc-pgproto3/v2 ...

jayd3e commented 4 years ago

Ironically, I was trying to do the exact same thing as @phaneendrayeluri . Same library and version. I am receiving the same error message.

ShiinaOrez commented 4 years ago

I haven't used glide on my MBP, but still receive this error, any solution else?

ShiinaOrez commented 4 years ago

I haven't used glide on my MBP, but still receive this error, any solution else?

fine, just go mod tidy, NEVER trust in GOPROXY... Coding at China is too difficult.

amarouane-ABDELHAK commented 4 years ago

I like glide but this problem is a mood killer, I am looking for a new/better go package manager #sad #disappointed

jayd3e commented 4 years ago

I would switch to just using go mod at this point. We have had a really smooth time migrating to it. Glide and dep were both the "unofficial experiments" for developing a native Go package manager, which we now have.

mnmistake commented 3 years ago

So? any news?

mnuddindev commented 2 years ago

any fix? i made a project with gofiber/fiber/v2 but its showing the same error. i want to push that on heroku but can't because of that. and on the other hand go mod vendor not working this case. what can i do now?