Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Dep should ignore packages only imported in files with tools build tag #2112

Closed
johanbrandhorst opened this issue Feb 23, 2019 · 2 comments
Closed

Comments

@johanbrandhorst
Copy link
Member

johanbrandhorst commented Feb 23, 2019

Hi!

I recently tried migrating one of my repositories to go modules (sorry!). I had some tool dependencies and the current go modules way of declaring such are through a tools.go file with a tools build tag.

This works fine until you have someone using dep depending on a package that contains your tools.go file. It seems dep, when resolving the transitive dependencies of such a dependency, concludes that these tool dependencies are also part of the graph. I think this is incorrect behaviour.

I propose that dep should ignore files that use the build tag tools.

Related issue: #463.
My repo with the problematic transative import behaviour: johanbrandhorst/certify#48.

@johanbrandhorst johanbrandhorst changed the title Dep should ignore packages only imported in files with ignore build tag Dep should ignore packages only imported in files with tools build tag Feb 23, 2019
@johanbrandhorst
Copy link
Member Author

I made a mistake in the original post, I thought ignore was the build tag used, but it is not. The tag used is tools. I realize this greatly weakens the argument.

@kevinburke
Copy link
Collaborator

Thanks for the report! I think we are going to pass on this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants