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

etcd no longer uses rewritten import paths #36

Merged
merged 2 commits into from
Apr 1, 2016
Merged

etcd no longer uses rewritten import paths #36

merged 2 commits into from
Apr 1, 2016

Conversation

peterbourgon
Copy link
Contributor

This means we can drop the wackycontext, wackygrpc, etc. import names. Unfortunately, etcd accomplishes this feat by leveraging the vendor dir, which is viral, i.e. anything that imports coreos/etcd must have its own vendor dir AND must flatten transitive dependencies from dependent packages into that base vendor dir.

See https://groups.google.com/forum/#!topic/golang-nuts/AnMr9NL6dtc

This means we can drop the wackycontext, wackygrpc, etc. import names.
Unfortunately, etcd accomplishes this feat by leveraging the vendor dir,
which is viral, i.e. anything that imports coreos/etcd must have its own
vendor dir AND must flatten transitive dependencies from dependent
packages into that base vendor dir.

See https://groups.google.com/forum/#!topic/golang-nuts/AnMr9NL6dtc
@peterbourgon
Copy link
Contributor Author

@peterbourgon
Copy link
Contributor Author

Running go build against metcd will not work by default. Ways to make it work:

  • Hack it: rm -rf $GOPATH/src/github.com/coreos/etcd/vendor — done in circle.yml for now
  • Fix upstream: see coreos/etcd#4913
  • Use a tool: e.g. govendor build, or glide
  • Flatten: vendor both metcd and etcd in another repo, and flatten all transitive vendored dependencies — doesn't solve anything for this repo, but solves it for downstream users, will try this approach in flux

Other ways to solve this problem in the general case:

  • Never expose external types in your API
    • Simply avoid it in the first place
    • Or make a separate copy of the dependency package in your repo
  • Leave the computer industry, become a carpenter
  • Others possible

@peterbourgon peterbourgon merged commit dc4e52d into master Apr 1, 2016
@peterbourgon peterbourgon deleted the unwacky branch April 1, 2016 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant