Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make build error: missing ziphash #32

Open
onethirdzero opened this issue Dec 3, 2020 · 6 comments
Open

make build error: missing ziphash #32

onethirdzero opened this issue Dec 3, 2020 · 6 comments

Comments

@onethirdzero
Copy link

Hi, I'm having trouble building from source. I'm using Go 1.15.6.

$ go mod download
$ make build
k8s.io/api v0.18.6: missing ziphash: open /home/jsiaw/go/pkg/mod/cache/download/k8s.io/api/@v/v0.18.6.ziphash: no such file or directory
k8s.io/apimachinery v0.18.6: missing ziphash: open /home/jsiaw/go/pkg/mod/cache/download/k8s.io/apimachinery/@v/v0.18.6.ziphash: no such file or directory
k8s.io/klog v1.0.0: missing ziphash: open /home/jsiaw/go/pkg/mod/cache/download/k8s.io/klog/@v/v1.0.0.ziphash: no such file or directory
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a: missing ziphash: open /home/jsiaw/go/pkg/mod/cache/download/k8s.io/kube-openapi/@v/v0.0.0-20191107075043-30be4d16710a.ziphash: no such file or directory
make: *** [Makefile:82: deps] Error 1

I've tried clearing the module cache (~/go/pkg/mod/cache) and doing go mod download && make build. No dice. I get the same errors.

The only related discussion I could find on ziphashes was this Stack Overflow question, which seems to suggest that something happened in these dependencies that's causing the ziphash not to be created. Or maybe it's a bug in the Go tooling.

I'm currently working around this by removing the deps dependency in the build target. That allows the build to succeed.

@sharath-sri-chellappa
Copy link

Hi @onethirdzero . I am facing the same issue but I am not sure what is the workaround you carried out. Can you describe what you did for the workaround

@onethirdzero
Copy link
Author

Hey @sharath-sri-chellappa, here's the exact diff of what I did:

$ g --no-pager diff
diff --git a/Makefile b/Makefile
index 49e108e..ad5c928 100644
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,7 @@ endef
 all: format build

 .PHONY: build
-build: check-git deps $(PROMU)
+build: check-git  $(PROMU)
        @echo ">> building binaries $(GOBIN)"
        @$(PROMU) build --prefix $(PREFIX)

Then:

$ make build
>> building binaries /home/foo/go/bin
 >   thanosbench

## Success!

@sharath-sri-chellappa
Copy link

sharath-sri-chellappa commented Mar 1, 2021

Oh Thank you. However I find the following issues now -
go: github.com/prometheus/[email protected]: missing go.sum entry; to add it: go mod download github.com/prometheus/promu make: *** [/root/go/bin/promu-v0.5.0] Error 1
Any ideas on how to get past these. When I try
[thanosbench]# go mod download github.com/prometheus/promu go mod download: module github.com/prometheus/promu: not a known dependency

@onethirdzero
Copy link
Author

That looks like a Go tooling issue. Which version of Go are you using?

$ go version
go version go1.15.6 linux/amd64

It also looks like you're trying to run go as root. Try go mod download and building with your regular user.

@arinzeakubue
Copy link

arinzeakubue commented Mar 2, 2022

That looks like a Go tooling issue. Which version of Go are you using?

$ go version
go version go1.15.6 linux/amd64

It also looks like you're trying to run go as root. Try go mod download and building with your regular user.

This workaround did not work in my case. See the ugly workaround I used.

@robert-zaremba
Copy link

I have the same error when converting the module to go workspace. It seams the go workspace is not mature enough. My guess is that it requires the tool to be compiled with go workspace in order to use it with other go workspace projects. Findings: umee-network/umee#1056

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants