Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Don't fetch recursive dependencies from files with +build ignore tag #84

Closed
alexedwards opened this issue Dec 9, 2016 · 1 comment
Closed

Comments

@alexedwards
Copy link

alexedwards commented Dec 9, 2016

Currently gvt fetches recursive dependencies that are listed in files which have the // +build ignore tag. This seems to go against the expectation (as mentioned in the the README) that only files relevant to the Go compiler are fetched.

A real-life example of where this is a problem is when vendoring github.com/mattn/go-sqlite3. This package contains a tool directory with some helpers which don't form part of the core package. All files in the tool directory use the // +build ignore tag.

$ gvt fetch github.com/mattn/go-sqlite3
2016/12/08 16:00:03 Fetching: github.com/mattn/go-sqlite3
2016/12/08 16:00:10 · Fetching recursive dependency: golang.org/x/net/context
2016/12/08 16:00:14 · Fetching recursive dependency: github.com/PuerkitoBio/goquery
2016/12/08 16:00:21 ·· Fetching recursive dependency: golang.org/x/net/html
2016/12/08 16:00:21 ··· Fetching recursive dependency: golang.org/x/text/encoding/htmlindex
2016/12/08 16:00:40 ···· Fetching recursive dependency: golang.org/x/text/encoding/charmap
2016/12/08 16:00:40 ····· Fetching recursive dependency: golang.org/x/text/encoding
2016/12/08 16:00:40 ······ Fetching recursive dependency: golang.org/x/text/transform
2016/12/08 16:00:40 ······ Fetching recursive dependency: golang.org/x/text/runes
2016/12/08 16:00:40 ······ Fetching recursive dependency: golang.org/x/text/internal/utf8internal
2016/12/08 16:00:40 ······ Fetching recursive dependency: golang.org/x/text/language
2016/12/08 16:00:40 ······· Fetching recursive dependency: golang.org/x/text/internal/gen
2016/12/08 16:00:40 ········ Fetching recursive dependency: golang.org/x/text/unicode/cldr
2016/12/08 16:00:40 ······· Fetching recursive dependency: golang.org/x/text/internal/tag
2016/12/08 16:00:40 ·· Fetching recursive dependency: github.com/andybalholm/cascadia

Because gvt doesn't ignore the files in the tool directory, github.com/PuerkitoBio/goquery (and subsequently, all it's dependencies) get vendored, even though they will never be used in the compiled application.

@alexedwards alexedwards changed the title Don't fetch recurisve dependencies from files with +build ignore tag Don't fetch recursive dependencies from files with +build ignore tag Dec 11, 2016
@alexedwards
Copy link
Author

With go mod due to be shipping in 1.11 as the official tool for managing versions I'm not sure that fixing this would be a good use of anyone's time. Closing.

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

1 participant