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

patch: cmd/dist: stamp git commit into runtime.Version value #49

Open
bradfitz opened this issue Feb 9, 2023 · 2 comments
Open

patch: cmd/dist: stamp git commit into runtime.Version value #49

bradfitz opened this issue Feb 9, 2023 · 2 comments
Labels

Comments

@bradfitz
Copy link
Member

bradfitz commented Feb 9, 2023

Summary: stamp the tailscale/go git commit into the toolchain
Upstream status: not applicable, probably. Haven't asked.
Importance: important for Tailscale to debug how binaries were built
Example prior commit: 26292c0 + 6a17f14 (the latter adds a thing for NixOS we should either merge into the former or just drop)

cc @danderson

@bradfitz
Copy link
Member Author

Latest commit in our fork is b3dc9ccd7a5

But I don't see us using this anymore.

@danderson, @raggi, I saw it got removed in https://github.com/tailscale/corp/commit/ec4addf43a630d495cd842d0ed31bf97c3c91374

Do we still need this?

It might still be nice to ask a Tailscale-built binary exactly which git rev of https://github.com/tailscale/go it was built from, but we don't have that property today. We only know that it's e.g. "1.23.1" but not more granular than that.

@raggi
Copy link
Member

raggi commented Sep 13, 2024

I don't have a strong opininion either way. Certainly being able to identify it sounds nice, though I'd also quite like it if this actually worked:

% ~/.cache/tailscale-go/bin/go version -m ~/.cache/tailscale-go/bin/go
/Users/raggi/.cache/tailscale-go/bin/go: go1.23.1
        path    cmd/go
        build   -buildmode=exe
        build   -compiler=gc
        build   -gcflags=cmd/...=-dwarf=false
        build   -trimpath=true
        build   DefaultGODEBUG=asynctimerchan=1,gotypesalias=0,httplaxcontentlength=1,httpmuxgo121=1,httpservecontentkeepheaders=1,netedns0=0,panicnil=1,tls10server=1,tls3des=1,tlskyber=0,tlsrsakex=1,tlsunsafeekm=1,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1
        build   CGO_ENABLED=0
        build   GOARCH=arm64
        build   GOOS=darwin
        build   GOARM64=v8.0

Maybe something to raise with upstream.

In the meantime, is there a way to persuade the go build to include a .dSYM? I just realized I'm not even too sure how to match up the binaries without one.

bradfitz added a commit that referenced this issue Sep 19, 2024
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 <[email protected]>
bradfitz added a commit that referenced this issue Sep 19, 2024
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 <[email protected]>
bradfitz added a commit that referenced this issue Sep 19, 2024
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 <[email protected]>
bradfitz added a commit that referenced this issue Sep 19, 2024
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 a new "tailscale.toolchain.rev"
runtime/debug.BuildInfo Setting.

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

Updates #49

Signed-off-by: Brad Fitzpatrick <[email protected]>
bradfitz added a commit that referenced this issue Sep 19, 2024
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 a new "tailscale.toolchain.rev"
runtime/debug.BuildInfo Setting.

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

Updates #49

Signed-off-by: Brad Fitzpatrick <[email protected]>
bradfitz added a commit that referenced this issue Sep 19, 2024
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 a new "tailscale.toolchain.rev"
runtime/debug.BuildInfo Setting.

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

Updates #49

Signed-off-by: Brad Fitzpatrick <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants