Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

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

Closed
sdboyer opened this issue Apr 26, 2017 · 5 comments
Closed

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

sdboyer opened this issue Apr 26, 2017 · 5 comments

Comments

@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
Copy link
Member Author

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
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
Copy link
Member Author

sdboyer commented Apr 26, 2017

@zellyn that seems like a great place to start 😄

@mem
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
Copy link
Member Author

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants