When building with redo, also include the git commit hash
from the proprietary repo, so that we have a precise commit
that identifies all build info (including Go toolchain version).
Add a top-level build script demonstrating to downstream distros
how to burn the right information into builds.
Adjust `tailscale version` to print commit hashes when available.
Fixes#841.
Signed-off-by: David Anderson <danderson@tailscale.com>
pull/871/head
David Anderson4 years agocommitted byDave Anderson
@ -12,6 +12,7 @@ package main // import "tailscale.com/cmd/tailscaled"
import(
"context"
"flag"
"fmt"
"log"
"net/http"
"net/http/pprof"
@ -29,6 +30,7 @@ import (
"tailscale.com/paths"
"tailscale.com/types/flagtype"
"tailscale.com/types/logger"
"tailscale.com/version"
"tailscale.com/wgengine"
"tailscale.com/wgengine/magicsock"
"tailscale.com/wgengine/router"
@ -73,6 +75,7 @@ func main() {
debug.SetGCPercent(10)
}
printVersion:=false
flag.BoolVar(&args.cleanup,"cleanup",false,"clean up system state and exit")
flag.BoolVar(&args.fake,"fake",false,"use userspace fake tunnel+routing instead of kernel TUN interface")
flag.StringVar(&args.debug,"debug","","listen address ([ip]:port) of optional debug server")
@ -80,6 +83,7 @@ func main() {
flag.Var(flagtype.PortValue(&args.port,magicsock.DefaultPort),"port","UDP port to listen on for WireGuard and peer-to-peer traffic; 0 means automatically select")
flag.StringVar(&args.statepath,"state",paths.DefaultTailscaledStateFile(),"path of state file")
flag.StringVar(&args.socketpath,"socket",paths.DefaultTailscaledSocket(),"path of the service unix socket")
flag.BoolVar(&printVersion,"version",false,"print version information and exit")
err:=fixconsole.FixConsoleIfNeeded()
iferr!=nil{
@ -91,6 +95,11 @@ func main() {
log.Fatalf("tailscaled does not take non-flag arguments: %q",flag.Args())