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

Consider using "go generate" to make Prometheus go-gettable #548

Closed
juliusv opened this Issue Feb 22, 2015 · 9 comments

Comments

Projects
None yet
7 participants
@juliusv
Copy link
Member

juliusv commented Feb 22, 2015

See http://blog.golang.org/generate and #547 (comment).

This could obviate the need for Makefiles and make Prometheus go-gettable.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Feb 22, 2015

But take into account that go generate is supposed to be run by developers and not by users, i.e. we have to check in the generated blob.go after all.

@juliusv

This comment has been minimized.

Copy link
Member Author

juliusv commented Feb 23, 2015

Oh. Right, we could check in files.go (which you meant by blob.go), as we already check in protobufs and lexer/parser files.

So the only things really standing in the way of go get without any subsequent manual build steps are now:

  • build.go (it should be user-generated by design, as otherwise it won't contain the correct build information)
  • ensuring an up-to-date Go version

I think the latter is probably fine to ignore, because we already use the new range syntax which will at least fail for people still on Go <1.4. But what about build.go? Weighing the useful information it provides against go-gettability. Hmm...

@matthiasr

This comment has been minimized.

Copy link
Contributor

matthiasr commented Feb 23, 2015

Maybe include a generated build.go with some bogus (empty?) revision, but use a release process for official binaries that updates it?

@vtolstov

This comment has been minimized.

Copy link

vtolstov commented Feb 23, 2015

usually software have step make dist, that pregenerates all needed files, so i think in release build.go can have released version...

@grobie

This comment has been minimized.

Copy link
Member

grobie commented Feb 27, 2015

So, reading the go generate documentation, I understand the concept that any program can be called. You could just call make, no? :D

//go:generate make build.go
@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Feb 27, 2015

On Fri, Feb 27, 2015 at 5:48 AM, Tobias Schmidt
notifications@github.com wrote:

So, reading the go generate documentation, I understand the concept that any
program can be called. You could just call make, no? :D

//go:generate make generate build.go

Yes, that's called the 'toilet paper principle'. :)

Björn Rabenstein, Engineer
http://soundcloud.com/brabenstein

SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany
Managing Director: Alexander Ljung | Incorporated in England & Wales
with Company No. 6343600 | Local Branch Office | AG Charlottenburg |
HRB 110657B

@discordianfish

This comment has been minimized.

Copy link
Member

discordianfish commented May 5, 2015

It would be great to consent around how we do this, so we can make sure other prometheus projects do the same? The only concern with commiting the files.go is that it blows up the git history. Since we commit the protobuf generated code and Godeps anyways, I think it's fine to commit the files.go as well.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Dec 16, 2015

Our binary data is checked in now, so this is resolved.

@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.