truechain-consensus-core icon indicating copy to clipboard operation
truechain-consensus-core copied to clipboard

gvt fetch/update cycle review

Open arcolife opened this issue 6 years ago • 0 comments

here's the scenario, that is hurtful with gvt right now:

  1. Bob adds 2 packages which have N deps. Gets updated into vendor/manifest
  2. one of the packages from group N gets an update on its github. In this case it's testdata folder inside grpc library. So when Bob runs a test. It fails, because the update is missing from the git version.
[test]              /src:/src/..
[test]              src/vendor/google.golang.org/grpc/benchmark/worker/benchmark_client.go:38:2: cannot find package "google.golang.org/grpc/testdata" in any of:
[test]              	/src/src/vendor/google.golang.org/grpc/testdata (vendor tree)
[test]              	/src/src/vendor/google.golang.org/grpc/testdata
[test]              	/usr/local/go/src/google.golang.org/grpc/testdata (from $GOROOT)
[test]              	/src/src/google.golang.org/grpc/testdata (from $GOPATH)
[test]              	/src/google.golang.org/grpc/testdata
  1. . Bob performs a gvt update for that specific package. He sees a change reflected in manifest for grpc-go.
                        "vcs": "git",
-                       "revision": "b519e3d28d377e55a0d44c9b83e6aee4d02d731d",
+                       "revision": "445634bdcc9393d2681e504aafd3efc9b28c4bf2",
                        "branch": "master",
  1. And so determined that all that's needed is done, he performs another test with hmake test. But he still gets:
[test]              /src:/src/..
[test]              src/vendor/google.golang.org/grpc/benchmark/worker/benchmark_client.go:38:2: cannot find package "google.golang.org/grpc/testdata" in any of:
[test]              	/src/src/vendor/google.golang.org/grpc/testdata (vendor tree)
[test]              	/src/src/vendor/google.golang.org/grpc/testdata
[test]              	/usr/local/go/src/google.golang.org/grpc/testdata (from $GOROOT)
[test]              	/src/src/google.golang.org/grpc/testdata (from $GOPATH)
[test]              	/src/google.golang.org/grpc/testdata
  1. So he checks the folder for latest from https://github.com/grpc/grpc-go/tree/master/testdata
ls vendor/google.golang.org/grpc/testdata                        ✔  5579  18:43:36
ls: vendor/google.golang.org/grpc/testdata: No such file or directory
  1. So to solve this for now, Bob performs a go get -u google.golang.org/grpc and solves this with cp -r $GOPATH/src/google.golang.org/grpc/testdata src/vendor/google.golang.org/grpc/

But bob is guilty as charged.

And tired of this game of deps, he wants to get rid of this problem, along with this #39 and https://github.com/FiloSottile/gvt/issues/16 (gvt delete doesn't clear all deps, or does it?)

Also, if impossible, Bob would probably go for https://github.com/golang/dep/issues/679

arcolife avatar Jul 20 '18 04:07 arcolife