robfig / glock

MIT License
230 stars 27 forks source link

save: use x/tools/refactor/importgraph instead of go list #33

Closed tamird closed 8 years ago

tamird commented 8 years ago

Also ignore all build tags, getting the maximal set of dependencies.

Fixes #29.

cc @bdarnell

tamird commented 8 years ago

@robfig OK, I tweaked this a bunch (sorry about that, there's no test coverage for commands, so I had to run it against CockroachDB a bunch of times).

Please take a look.

tamird commented 8 years ago

Green.

robfig commented 8 years ago

Thank you!!

robfig commented 8 years ago

Hm, looks like this caused issues; after a clean glock sync, glock save complains about dependencies that can not be found. I guess the solution is to manually find all of the new dependencies that need to go into the Glockfile as part of the upgrade step.

robfig commented 8 years ago

Yuck, got stuck on import "./testdata": import relative to unknown directory

from github.com/golang/protobuf/proto/all_test.go and friends

tamird commented 8 years ago

Hm, looks like this caused issues; after a clean glock sync, glock save complains about dependencies that can not be found. I guess the solution is to manually find all of the new dependencies that need to go into the Glockfile as part of the upgrade step.

Yeah, so this is somewhat expected since go get only fetches dependencies needed by the build tags specified in that go get invocation, while this change made glock save ignore build tags for the purpose of computing dependencies.

Yuck, got stuck on import "./testdata": import relative to unknown directory

from github.com/golang/protobuf/proto/all_test.go and friends

Hm, I don't see any relative imports in that file?

robfig commented 8 years ago

Ah, excellent it's fixed at head. I'm pinned at https://github.com/golang/protobuf/blob/380d2d0c0fb62b1360d2eaed75a31a74c6c08ccb/proto/all_test.go