robfig / glock

MIT License
230 stars 27 forks source link

`glock save` gets confused by build tags #29

Closed tamird closed 8 years ago

tamird commented 8 years ago

If I have some conditional dependencies (i.e. ones that are defined in files that are build only on e.g. linux), and I run glock save on a system where those conditional dependencies are not required, my GLOCKFILE will not include all possible dependencies of my project.

This has implications when developing on OS X and running CI on linux.

A cursory look at the glock code reveals that we're currently shelling out to go list, which I don't think allows specifying build tags, but we should really be using the go/build package anyway, and specifying the union of (at least) all OS build tags when resolving dependencies.

bdarnell commented 8 years ago

go list does accept -tags', but since+build` directives can be both positive and negative simply specifying the union of all known build tags won't necessarily pick up everything (i'm not sure if it would work in the case we're running into; I haven't pulled on that thread to see where exactly the problematic dependency comes from)