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

Copy from GOPATH interacts poorly with flatten! #155

Closed
ax-nathan opened this issue Dec 7, 2015 · 3 comments
Closed

Copy from GOPATH interacts poorly with flatten! #155

ax-nathan opened this issue Dec 7, 2015 · 3 comments
Labels
Milestone

Comments

@ax-nathan
Copy link

Took me quite some time to figure out why "flatten by default" wasn't (apparently) working!

Scenario

  • Packages A & B both exist in GOPATH.
  • Packages A & B both use glide.
  • Packages A & B both vendor package C in glide.yaml.
  • Package A vendors package B.
  • Package B DOES NOT have vendor/ in VCS.
  • Package B DOES have vendor/ on disk in GOPATH.

Result

  • glide up in Package A (with flatten enabled) copies Package B from GOPATH.
  • The copy of Package B includes the vendor/ directory from disk.
  • The resulting build includes A/vendor/C and A/vendor/B/vendor/C.
  • Bad Things(tm)

Proposal

  • --skip-gopath should default to true, or
  • "flatten by default" becomes aware of vendor/ directories copied from GOPATH, and prevents the copying of packages which should be flattened.
@mattfarina mattfarina added the bug label Dec 7, 2015
@mattfarina
Copy link
Member

I've been having issues with the gopath copying myself. we need to do something about that.

I'm considering:

  • opt-in to gopath copying.
  • making sure the gopath version isn't dirty. But, this won't find anything being ignored.
  • trying to introspect what's ignored or not along with dirtyness to figure out what to copy or skip. This would be complex.

Caching and reuse are hard.

@ax-nathan
Copy link
Author

I'd vote for "opt-in to go path copying" as a quick, safe fix. Seems like the current method is an overly aggressive performance optimization, but results in "surprising" behavior for the development use case. At a minimum, perhaps the README needs a "Gotchas" section where things like this are called out?

mattfarina added a commit that referenced this issue Dec 9, 2015
There can be issues copying from the GOPATH. Because of this
copying from the GOPATH should be opt-in.
@mattfarina
Copy link
Member

8615f59 made the copying from the GOPATH opt-in. This will be in the next release.

@mattfarina mattfarina added this to the 0.8.0 milestone Dec 9, 2015
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