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

Bring Makefile in line with the Makefile used in other repos. #888

Closed
cfedersp opened this Issue Jul 12, 2015 · 10 comments

Comments

Projects
None yet
5 participants
@cfedersp
Copy link

cfedersp commented Jul 12, 2015

I have go lang 1.4.2 installed and in my PATH.
I am trying out prometheus and its now downloaded go-lang-1.4.2 twice already - once to compile prometheus (I'm running on OSX, so no dist is provided) and once for golang_client examples.

@cfedersp

This comment has been minimized.

Copy link
Author

cfedersp commented Jul 12, 2015

prometheus:
charliesmac:prometheus charliefederspiel$ make
curl -o /Users/charliefederspiel/projects/examples/prometheus/.build/cache/go1.4.2.darwin-amd64-osx10.8.tar.gz -L https://golang.org/dl/go1.4.2.darwin-amd64-osx10.8.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 96 100 96 0 0 50 0 0:00:01 0:00:01 --:--:-- 50
100 58.7M 100 58.7M 0 0 41737 0 0:24:37 0:24:37 --:--:-- 35438

client_golang:

charliesmac:client_golang charliefederspiel$ make example_random
[ -d "/Users/charliefederspiel/projects/examples/client_golang/.build/root/gopath/src/github.com/prometheus/client_golang" ] || { mkdir -vp /Users/charliefederspiel/projects/examples/client_golang/.build/root/gopath/src/github.com/prometheus ; ln -s "/Users/charliefederspiel/projects/examples/client_golang" "/Users/charliefederspiel/projects/examples/client_golang/.build/root/gopath/src/github.com/prometheus/client_golang" ; }
[ -d "/Users/charliefederspiel/projects/examples/client_golang/.build/root/gopath/src/github.com/prometheus/client_golang" ]
mkdir -vp /Users/charliefederspiel/projects/examples/client_golang/.build/cache
curl -o /Users/charliefederspiel/projects/examples/client_golang/.build/cache/go1.4.2.darwin-amd64-osx10.8.tar.gz -L https://golang.org/dl/go1.4.2.darwin-amd64-osx10.8.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 96 100 96 0 0 199 0 --:--:-- --:--:-- --:--:-- 200
100 58.7M 100 58.7M 0 0 264k 0 0:03:47 0:03:47 --:--:-- 239k
tar -C /Users/charliefederspiel/projects/examples/client_golang/.build/root -xzf /Users/charliefederspiel/projects/examples/client_golang/.build/cache/go1.4.2.darwin-amd64-osx10.8.tar.gz

@grobie

This comment has been minimized.

Copy link
Member

grobie commented Jul 12, 2015

One of prometheus' guidelines has been to allow for easy building of projects on standard linux/darwin environments. As go is not a standard tool, the simplest solution is to vendor everything ourselves, including installing the desired go version. There are a few other benefits as well.

At least for the go installation itself this is actually quite wasteful in time and storage resources. This has been admitted in the Makefile.COMMON, which is the base for most of the smaller prometheus component projects already. Neither the client's nor the server's build process have been updated to use these common make targets, nor do I know if that is actually feasible. If not the check for an existing go version could be backported to these two projects.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 12, 2015

I find it rather unusual as well and since the project has pre-built binaries with every release now, I think this can be dropped eventually. Building Prometheus manually should be only required for people experimenting with unreleased versions or developers – both groups can be expected to setup a Go environment, which is very simple.

@sdurrheimer

This comment has been minimized.

Copy link
Member

sdurrheimer commented Jul 12, 2015

This can't be dropped, Docker images depend on this.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 12, 2015

The Docker images need a Go version - doesn't mean it has to come from the Makefile that is used for the manual build process. That said, this will only happen if anyone is willing to take the time to do it right.

Regarding client_golang – this is a library. It shouldn't have a Makefile or Godeps at all. (I know there are claims that this is necessary for testing, which I disagree with.)

@sdurrheimer

This comment has been minimized.

Copy link
Member

sdurrheimer commented Jul 12, 2015

I think the the download step in the Makefile is fine and quite useful. The simpler way to fix this is to add the GO detection in PATH like @grobie said. https://github.com/prometheus/utils/blob/master/Makefile.COMMON#L56-L67

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 12, 2015

I'd prefer removing it completely, but would be fine with either.
To me, it's simply not the job of the Makefile to download and install a compiler environment – at least not for an open source project.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Jul 15, 2015

I filed prometheus/client_golang#144 for client_golang and will change the title of this to match what we have to do in prometheus/prometheus.

@beorn7 beorn7 changed the title why do prometheus and golang_client download Go when its already installed? Bring Makefile in line with the Makefile used in other repos. Jul 15, 2015

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Jul 15, 2015

We actually had an issue for that already: #476

Marking this as duplicate.

@beorn7 beorn7 closed this Jul 15, 2015

@beorn7 beorn7 added the duplicate label Jul 15, 2015

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.