Skip to content

glide-report fails to find cached file due to incorrect result of dependency.Remote() #6

@dmitris

Description

@dmitris

I'm getting failures of glide-report when there are repositories with custom aka "vanity" paths such as golang.org/x/crypto that require dynamic lookup.

Here's how to replicate:

go get github.com/dmitris/deptest
cd $GOPATH/src/github.com/dmitris/deptest
glide-report
  • the above may or may not work, but with the following I can force the error:
rm -fr ~/.glide/cache/
$ $GOPATH/bin/glide-report
[WARN]	Disclaimer, this report is to help highlight things to consider. It is
[WARN]	alpha software and the rules are still under consideration.
[INFO]	Reading glide.yaml file to understand configured versions and ranges
[INFO]	Reading glide.lock file to understand pinned revisions
[INFO]	Fetching dependency data, this may take a moment...
Report on .

------------------------------------------------------------------------------
Direct Imports
------------------------------------------------------------------------------

Analysis of golang.org/x/crypto:
● Dependency does not provide Semantic Version releases
[ERROR]	Unable to get cached repo data: open /Users/dmitris/.glide/cache/info/https-go.googlesource.com-crypto.json: no such file or directory

I believe this happens due to the logic in https://github.com/Masterminds/glide/blob/master/cfg/config.go#L470-L471 which just adds https:// to the Dependency's Name (d.Name) and does not do a dynamic lookup necessary for custom/vanity import paths such as "golang.org/x/crypto". #4 is possibly related (since it also mentiones a repo with custom import path).

I have a proposed PR for glide/cfg that fixes the issue (by adding a call to vcs.NewRepo which performs a dynamic lookup if needed) and will submit it in a moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions