Open jianchen2580 opened 7 years ago
Having what I believe is the same problem, during glide get
and glide up
:
[INFO] Found Godeps.json file in /Users/alex/.glide/cache/src/https-github.com-stretchr-testify
[INFO] --> Parsing Godeps metadata...
[INFO] --> Fetching updates for github.com/stretchr/objx.
[INFO] --> Setting version for github.com/stretchr/objx to cbeaeb16a013161a98496fad62933b1d21786672.
[INFO] --> Fetching updates for github.com/pmezard/go-difflib.
[INFO] --> Setting version for github.com/pmezard/go-difflib to d8ed2627bdf02c080bf22230dbb337003b7aba2d.
[INFO] --> Fetching updates for github.com/lann/builder.
[INFO] --> Fetching google/protobuf.
[WARN] Unable to checkout google/protobuf
[ERROR] Error looking for google/protobuf: Cannot detect VCS
Where does google/protobuf
come from?
I boiled it down to some Go files in my repo (generated by Protobuf). If I stash them, glide
works again. I can reproduce this consistently. They contain these imports:
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api"
import google_protobuf "google/protobuf"
import google_protobuf2 "google/protobuf"
Now, obviously the last two imports aren't correct, but why on earth is Glide reading them?
also seeing the same error as @atombender with the import statements in generated proto go files
glide reads imports to determine what dependencies are actually required. The problem is those import paths.
You can always set an ignore
in glide.yaml
for google/protobuf
- that should address that issue, at least.
The OP's issue is stranger - are you, perhaps, running that on a machine without a GOROOT set up, somehow? (not the env var, i mean literally no stdlib)
Cannot detect VCS
[ERROR] Failed to set version on golang.org/x/net/http2 to : Cannot detect VCS [ERROR] Failed to set references: Cannot detect VCS (Skip to cleanup)
The OP's issue is stranger - are you, perhaps, running that on a machine without a GOROOT set up, somehow? (not the env var, i mean literally no stdlib)
This was a good pointer for me. For me, glide tried to download the standard Go libs (as fmt, log, database/sql, ...) when I glided in a terminal hosted by GoLand. When I did the same via the Windows console, it actually worked as expected. Looks like GoLand has set some ENV vars, which glide wasn't really understanding.
glide version v0.12.3