Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignored packages are written to glide.lock #460

Closed
zcahana opened this issue Jun 6, 2016 · 4 comments
Closed

Ignored packages are written to glide.lock #460

zcahana opened this issue Jun 6, 2016 · 4 comments
Labels
Milestone

Comments

@zcahana
Copy link

zcahana commented Jun 6, 2016

Hello,

I'm using the ignore: directive in glide.yaml to mark some package to be ignored.
When running glide up, this package is not downloaded by glide, but still gets written into glide.lock.
Later on, when running glide install, glide tries to fetch the ignored package.

I've recreated this behavior using the following simple setup:

/home/zvic/Workspace/go/src/github.com/myorg
├── app
│   ├── glide.yaml
│   └── main.go
└── lib
    └── lib.go

The code at app/main.go imports github.com/myorg/lib.
The glide.yaml looks like this:

package: github.com/myorg/app
ignore:
- github.com/myorg/lib
import:
- package: github.com/Sirupsen/logrus

Running glide up within the app folder, yields the following glide.lock file:

hash: c48ff98414e4591f66688724450e9c1893ed5d5281b5c6c0cbf6422386d76040
updated: 2016-06-06T18:18:35.766520479+03:00
imports:
- name: github.com/myorg/lib
  version: ""
- name: github.com/Sirupsen/logrus
  version: f3cfb454f4c209e6668c95216c4744b8fddb2356
- name: golang.org/x/sys
  version: 076b546753157f758b316e59bcb51e6807c04057
  subpackages:
  - unix
devImports: []

Notably, the github.com/myorg/lib package is listed as an import.

P.S., I'm using glide 0.10.2, but also recreated this with 0.11.0-dev.

@zcahana
Copy link
Author

zcahana commented Jun 6, 2016

Attaching the example referenced above: glide-ignore-example.zip

To use, just unzip into $GOPATH/src, and run glide up within myorg/app folder.

@mattfarina mattfarina added the bug label Jun 7, 2016
@mattfarina
Copy link
Member

I was able to reproduce this in my own local testing. Thanks for filing the bug.

@mattfarina mattfarina added this to the 0.11 milestone Jun 7, 2016
@mattfarina
Copy link
Member

@zcahana can you test #460? I think this fixes it.

@zcahana
Copy link
Author

zcahana commented Jun 7, 2016

@mattfarina indeed seems to be fixed - ignored package doesn't get into the lock file.
I tested with both the app/lib example above, as well as the real repo I've seen this happen in.

Thanks for the prompt reply!

mattfarina added a commit that referenced this issue Jun 7, 2016
Fixed #460: Fixed some ignored deps getting into lock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants