Masterminds / glide

Package Management for Golang
https://glide.sh
Other
8.15k stars 541 forks source link

Unable to retrieve local repo information: exit status 1 and Unable to retrieve checked out version: exit status 128 #947

Closed wallacewy closed 6 years ago

wallacewy commented 6 years ago

My glide.yaml is below:

package: xxx.com/xxx/resource-proxy import:

When I run glide install or glide up (OS: Win10, go version go1.8.1 windows/amd64), next errors occur:

[INFO] Downloading dependencies. Please wait... [INFO] --> Fetching updates for github.com/emicklei/go-restful [INFO] --> Fetching updates for github.com/ulule/deepcopier [INFO] --> Fetching updates for github.com/robfig/cron [INFO] --> Fetching updates for github.com/kubernetes/apimachinery [INFO] --> Fetching updates for github.com/kubernetes/apiextensions-apiserver [INFO] --> Fetching updates for k8s.io/api [INFO] --> Fetching updates for github.com/kubernetes/client-go [INFO] --> Fetching updates for github.com/Sirupsen/logrus [INFO] --> Fetching updates for github.com/satori/go.uuid [INFO] --> Fetching updates for github.com/kubernetes/api [ERROR] Update failed for github.com/kubernetes/client-go: Unable to retrieve local repo information: exit status 1 [ERROR] Update failed for github.com/kubernetes/api: Unable to retrieve checked out version: exit status 128 [ERROR] Update failed for github.com/kubernetes/apiextensions-apiserver: Unable to retrieve checked out version: exit status 128 [ERROR] Update failed for k8s.io/api: Unable to retrieve checked out version: exit status 128 [ERROR] Failed to do initial checkout of config: Unable to retrieve local repo information: exit status 1 Unable to retrieve checked out version: exit status 128 Unable to retrieve checked out version: exit status 128 Unable to retrieve checked out version: exit status 128

wallacewy commented 6 years ago

From git.go

func (s *GitRepo) Version() (string, error) { out, err := s.RunFromDir("git", "rev-parse", "HEAD") if err != nil { return "", NewLocalError("Unable to retrieve checked out version", err, string(out)) }

return strings.TrimSpace(string(out)), nil

}

Because these folders exist but aren't git repo, solve it by rm -rf these folder

wallacewy commented 6 years ago

Another issue in win10 x64: Unable to export dependencies to vendor directory: Error moving files: exit status 1. output: Access is denied.

Solution:

In

github.com/Masterminds/glide/path/winbug.go

function "func CustomRename(o, n string) error" replace the following line

cmd := exec.Command("cmd.exe", "/c", "copy", o, n)

to

cmd := exec.Command("robocopy.exe", o, n, "/e")

That solved the problem.

Refer to: https://github.com/Masterminds/glide/issues/873