go-graphite / carbonzipper

proxy to transparently merge graphite carbon backends
Other
104 stars 29 forks source link

dep not working #38

Closed StephenPCG closed 7 years ago

StephenPCG commented 7 years ago

problem 1

dep has switched to use toml for manifest and lock file, right after carbonzipper and carbonapi started using dep.

From a clean env (dep not installed), make would fail:

$ make
/go/bin/dep
dep ensure
could not find project Gopkg.toml, use dep init to initiate a manifest
Makefile:21: recipe for target 'dep' failed
make: *** [dep] Error 1

If I install an old version of dep (e.g. 4105d3a), dep won't complain on this. Maybe you should update your local dep and re-dep init.

problem 2

In a clean env, dep ensure would fail with the following error:

$ dep ensure
solve error: No versions of github.com/gogo/protobuf met constraints:
    master: failed to create repository cache for https://github.com/gogo/protobuf with err:
unable to get repository: Cloning into '/go/pkg/dep/sources/https---github.com-gogo-protobuf'...

    v0.4: Could not introduce github.com/gogo/protobuf@v0.4, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    v0.3: Could not introduce github.com/gogo/protobuf@v0.3, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    v0.2: Could not introduce github.com/gogo/protobuf@v0.2, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    v0.1: Could not introduce github.com/gogo/protobuf@v0.1, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    master: failed to create repository cache for https://github.com/gogo/protobuf with err:
unable to get repository: fatal: destination path '/go/pkg/dep/sources/https---github.com-gogo-protobuf' already exists and is not an empty directory.

    bigendian: Could not introduce github.com/gogo/protobuf@bigendian, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    bigskip: Could not introduce github.com/gogo/protobuf@bigskip, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    gopherjs: Could not introduce github.com/gogo/protobuf@gopherjs, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    moretests: Could not introduce github.com/gogo/protobuf@moretests, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    proto3.2.0: Could not introduce github.com/gogo/protobuf@proto3.2.0, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    ptypes: Could not introduce github.com/gogo/protobuf@ptypes, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    revert-271-issue-222: Could not introduce github.com/gogo/protobuf@revert-271-issue-222, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    std: Could not introduce github.com/gogo/protobuf@std, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    wkt: Could not introduce github.com/gogo/protobuf@wkt, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
ensure Solve(): No versions of github.com/gogo/protobuf met constraints:
    master: failed to create repository cache for https://github.com/gogo/protobuf with err:
unable to get repository: Cloning into '/go/pkg/dep/sources/https---github.com-gogo-protobuf'...

    v0.4: Could not introduce github.com/gogo/protobuf@v0.4, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    v0.3: Could not introduce github.com/gogo/protobuf@v0.3, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    v0.2: Could not introduce github.com/gogo/protobuf@v0.2, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    v0.1: Could not introduce github.com/gogo/protobuf@v0.1, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    master: failed to create repository cache for https://github.com/gogo/protobuf with err:
unable to get repository: fatal: destination path '/go/pkg/dep/sources/https---github.com-gogo-protobuf' already exists and is not an empty directory.

    bigendian: Could not introduce github.com/gogo/protobuf@bigendian, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    bigskip: Could not introduce github.com/gogo/protobuf@bigskip, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    gopherjs: Could not introduce github.com/gogo/protobuf@gopherjs, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    moretests: Could not introduce github.com/gogo/protobuf@moretests, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    proto3.2.0: Could not introduce github.com/gogo/protobuf@proto3.2.0, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    ptypes: Could not introduce github.com/gogo/protobuf@ptypes, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    revert-271-issue-222: Could not introduce github.com/gogo/protobuf@revert-271-issue-222, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    std: Could not introduce github.com/gogo/protobuf@std, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.
    wkt: Could not introduce github.com/gogo/protobuf@wkt, as it is not allowed by constraint master from project github.com/go-graphite/carbonzipper.

I'm not familiar with dep, I don't know what's going wrong...

dgryski commented 7 years ago

Yes, we noticed this today when a travis build failed. @Civil will patch this.

Civil commented 7 years ago

Please check if master now works for you

StephenPCG commented 7 years ago

It works now!

Civil commented 7 years ago

Glad to hear!

As dep is still in Alpha phase and it's format stabilization is planed for May, this may happen in future. So please open a new issue if you'll spot that sooner than we do. But I hope there won't be a lot of that issues in future.

StephenPCG commented 7 years ago

It's not working again here, dep ensure complains solve error: No versions of github.com/gogo/protobuf met constraints (full output is pasted above).

With carbonzipper, a second dep ensure will succeed, but with carbonapi, dep ensure just keeps complaining.

I don't know too much about dep, what does dep ensure do? Does it recursively ensure all downloaded dependencies? Or should it be possible that it just fails due to my slow network?

BTW, github.com/gogo/protobuf is too large, it's about 21MB to clone, my network speed to github is just about 60KB/s, it's painful long running dep ensure everytime (I'm building docker images, so env is always clean each time). Are there any better ways to same this time?

Civil commented 7 years ago

I'll remove gogo/protobuf dependency, it's now obsolete.

But I think that won't fully solve your problem. Currently most of vendoring types relies on fetching everything from git on each clean build. If that bothers you, I suggest you to find a way to cache GOPATH and preserve it between builds.

StephenPCG commented 7 years ago

Maybe it's really due to the poor network in my company. I tried several times at home hours ago, and always succeeded. I guess there maybe a timeout while dep ensure cloneing repositories. If network is really the problem, I'm sure going to find a way to cache GOPATH.

Civil commented 7 years ago

Ok, I've checked and actually I can't remove gogo/protobuf from the dependeices, as carbonzipperpb3 imports it. Sorry, but the only option is to cache GOPATH. This will also significantly speedup 'dep ensure'.