glide icon indicating copy to clipboard operation
glide copied to clipboard

cannot find package "."

Open k1ng440 opened this issue 6 years ago • 16 comments

[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

k1ng440 avatar Jan 21 '18 18:01 k1ng440

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...).

seeruk avatar Jan 24 '18 15:01 seeruk

Has anyone discovered a work around for this error?

eliquious avatar Jan 29 '18 23:01 eliquious

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.

seeruk avatar Jan 29 '18 23:01 seeruk

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.

kofalt avatar Apr 05 '18 16:04 kofalt

any solution found yet?

ravik-karn avatar Apr 12 '18 06:04 ravik-karn

maybe you can try clean up the cache and do update

$> glide cc
$> glide up

yogihardi avatar Oct 10 '18 09:10 yogihardi

maybe you can try clean up the cache and do update

$> glide cc
$> glide up

Worked for me, thanks

jasimmk avatar Sep 18 '19 02:09 jasimmk

why this could work?

xing00lian avatar Nov 21 '19 07:11 xing00lian

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 `....

  • package: github.com/jackc/pgx version: ^4.2.1 ...`

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 ...

phaneendrayeluri avatar Jan 15 '20 21:01 phaneendrayeluri

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

jayd3e avatar Jan 23 '20 09:01 jayd3e

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

ShiinaOrez avatar May 11 '20 08:05 ShiinaOrez

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.

ShiinaOrez avatar May 11 '20 09:05 ShiinaOrez

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

amarouane-ABDELHAK avatar Jul 08 '20 14:07 amarouane-ABDELHAK

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.

jayd3e avatar Jul 08 '20 16:07 jayd3e

So? any news?

mnmistake avatar Dec 01 '20 19:12 mnmistake

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?

mnuddindev avatar Apr 23 '22 20:04 mnuddindev