Skip to content

Commit

Permalink
[tailscale] runtime/debug: embed Tailscale toolchain git rev
Browse files Browse the repository at this point in the history
This is another take on #49 (which we stopped using?), and less
intrusive, and also always on.

This puts puts the the Tailscale Go toolchain's git rev in
the binary, accessible as runtime/debug.TailscaleGitRev.

Caller code will have to access it guarded by the "tailscale_go" build
tag.

Updates #49

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
  • Loading branch information
bradfitz committed Sep 19, 2024
1 parent 4771bca commit d035b5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.ref || github.ref }}
- name: set runtime/debug.TailscaleGitRev
run: sed -i "s/TAILSCALE_GIT_REV_TO_BE_REPLACED_AT_BUILD_TIME/${{ github.sha }}/" src/runtime/debug/tailscale-git-rev.txt
- name: build
run: cd src && ./make.bash
env:
Expand Down
2 changes: 2 additions & 0 deletions src/runtime/debug/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"strings"
)

const TailscaleGitRev = `TAILSCALE_GIT_REV_TO_BE_REPLACED_AT_BUILD_TIME`

// exported from runtime.
func modinfo() string

Expand Down

0 comments on commit d035b5e

Please sign in to comment.