Masterminds / glide

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

Libraries that resides in subfolders can't be installed #946

Open palsivertsen opened 6 years ago

palsivertsen commented 6 years ago

When adding a dependency that resides in a subfolder Glide fails on install.

Example:

package: my-project
import:
  - package: gitlab.com/company/project/libraries/my-library
    repo: git@gitlab.com/company/project/libraries/my-library.git

Doing glide i results in the following error:

[ERROR] Error scanning gitlab.com/company/project/libraries/my-library: cannot find package "." in:
    /home/user/.glide/cache/src/git-gitlab.com-company-projects-libraries-my-library.git/libraries/my-library

Note the last line -libraries-my-library.git/libraries/my-library where libraries/my-library is treated as a subpackage.

palsivertsen commented 6 years ago

Changing the package name from gitlab.com/company/project/libraries/my-library to gitlab.com/company/my-library works

zppro commented 6 years ago

@palsivertsen where to change the package name: in reference or .yaml i met same problem

palsivertsen commented 6 years ago

@zppro Change it in the glide.yaml file like so:

package: my-project
import:
-  - package: gitlab.com/company/project/libraries/my-library
+  - package: gitlab.com/company/my-library
    repo: git@gitlab.com/company/project/libraries/my-library.git

Then imports like this should work: import "gitlab.com/company/my-library"