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

Create a list of build tags with known special meanings #463

Open
sdboyer opened this Issue Apr 26, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@sdboyer
Copy link
Member

sdboyer commented Apr 26, 2017

While the course for #291 isn't yet decided, it seems quite likely that we're going to need a list of the build tags (not OS/Arch) that have a generally well-understood public definition. I think the canonical example of this would either be appengine or ignore; however, it's also worth raising something like a debug tag, that (AFAIK) doesn't have widespread adoption, but which might be useful to give a definition to.

Please provide a build tag and a brief description of its use, similar to the following:

  • appengine - the source file should be included when compiling a binary to be run on Google's App Engine.
  • ignore - designates that the file should be ignored by the compiler unless explicitly instructed otherwise. Its use is purely conventional, acting more as a signal to humans, as any build tag would have the same effect.

@sdboyer sdboyer added the help wanted label Apr 26, 2017

@sdboyer

This comment has been minimized.

Copy link
Member

sdboyer commented Apr 26, 2017

I'll aim to keep the list in the OP up-to-date with suggestions other folks make in comments.

@zellyn

This comment has been minimized.

Copy link
Contributor

zellyn commented Apr 26, 2017

One of the googlers with access to the full github bigquery corpus should be able to give you all build tags used anywhere, plus counts. @spf13?

@sdboyer

This comment has been minimized.

Copy link
Member

sdboyer commented Apr 26, 2017

@zellyn that seems like a great place to start 😄

@mem

This comment has been minimized.

Copy link
Contributor

mem commented Apr 27, 2017

I had some free quota left, ran some queries against the github corpus, extracted all the lines looking like "// +build", split the line at blanks, grouped and counted. This is the result:

https://docs.google.com/spreadsheets/d/1aImkrXmG1asZ7IgaJxe6HpaEPI8vjUU6Xd1KX-JomFU/edit?usp=sharing

@sdboyer

This comment has been minimized.

Copy link
Member

sdboyer commented Apr 27, 2017

@mem that's awesome, thank you!

OK so, filtering out the os, arch, and go version tags, here's a sampling of a few that show up high on the list:

  • integration
  • no-etcd
  • OMIT
  • appengine
  • acceptance
  • experimental
  • host
  • src
  • unit
  • cgo
  • kvm
  • all
  • race
  • debug
  • gofuzz

I'm not sure exactly what I want to do with these yet, but I'm putting them in as a comment here just to record the bit of musing I've done already.

(Obligatory note - this is frequency of appearance of these tags, but information about how frequently these packages are imported is not incorporated. That is, naturally, a relevant metric for our purposes.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment