criteo / graphite-remote-adapter

Fully featured graphite remote adapter for Prometheus
Apache License 2.0
38 stars 25 forks source link

Unable to complie #71

Closed TheHolm closed 3 years ago

TheHolm commented 4 years ago

Compiling with 'export GO111MODULE="on"'

>> formatting code
go: finding github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
go: finding github.com/gogo/protobuf v1.3.0
......
go: github.com/coreos/go-systemd@v0.0.0-20200109085637-d657f9650837: go.mod has post-v0 module path "github.com/coreos/go-systemd/v22" at revision d657f9650837
go: finding github.com/influxdata/influxdb1-client latest
go: finding github.com/op/go-logging latest
go get: error loading module requirements
make: *** [Makefile:74: promu] Error 1

I'm not sure what it fail to find. "github.com/op/go-logging" - is live. go version go1.11.6 linux/amd64

commit 7b02e4f3543cf3ff43d4249f30ab5e3daeccba17 (HEAD -> master, tag: v0.3.1, origin/master, origin/HEAD)
Author: Martin Conraux <m.conraux@criteo.com>
Date:   Wed Oct 23 13:22:10 2019 +0200

    Cancel write if they are already on a cancelled http request

UPD: I was able to complie previous version of code on same system: "git checkout -b test 515cb3c6b3b48c9eb00a5e1f7276eb29b9d07f84" It seems modules is pulling something not compliable.

mycroft commented 4 years ago

In order to build graphite-remote-adapter, the prometheus' promu tool is used, and this one is not compatible with go 1.11. Building promu is the problem here (it builds using fsnotify as a dependency, and this one doesn't interacts well in this environment:

go: gopkg.in/fsnotify.v1@v1.4.9: go.mod has non-....v1 module path "github.com/fsnotify/fsnotify" at revision v1.4.9

However, I was able to compile the project with the following patch:

diff --git a/Makefile b/Makefile
index 0f1c887..eb5f160 100644
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@ assets:
 promu:
        @GOOS=$(shell uname -s | tr A-Z a-z) \
        GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
-       $(GO) get -u github.com/prometheus/promu
+       GO111MODULE=off $(GO) get -u github.com/prometheus/promu

 clean:
        [ -f ui/bindata.go ] && rm ui/bindata.go