version.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Package version provides the version that the binary was built at.
  5. package version
  6. import (
  7. "strings"
  8. tailscaleroot "tailscale.com"
  9. )
  10. // Long is a full version number for this build, of the form
  11. // "x.y.z-commithash", or "date.yyyymmdd" if no actual version was
  12. // provided.
  13. var Long = "date.20211101"
  14. // Short is a short version number for this build, of the form
  15. // "x.y.z", or "date.yyyymmdd" if no actual version was provided.
  16. var Short = ""
  17. func init() {
  18. // If it hasn't been link-stamped with -X (via build_dist.sh or similar),
  19. // then use the VERSION.txt file in the root and the date in the Long
  20. // variable above which we occasionally bump by hand.
  21. if Short == "" {
  22. Long = strings.TrimSpace(tailscaleroot.Version) + "-" + Long
  23. Short = Long
  24. }
  25. }
  26. // GitCommit, if non-empty, is the git commit of the
  27. // github.com/tailscale/tailscale repository at which Tailscale was
  28. // built. Its format is the one returned by `git describe --always
  29. // --exclude "*" --dirty --abbrev=200`.
  30. var GitCommit = ""
  31. // ExtraGitCommit, if non-empty, is the git commit of a "supplemental"
  32. // repository at which Tailscale was built. Its format is the same as
  33. // gitCommit.
  34. //
  35. // ExtraGitCommit is used to track the source revision when the main
  36. // Tailscale repository is integrated into and built from another
  37. // repository (for example, Tailscale's proprietary code, or the
  38. // Android OSS repository). Together, GitCommit and ExtraGitCommit
  39. // exactly describe what repositories and commits were used in a
  40. // build.
  41. var ExtraGitCommit = ""