cmd/printdep: support printing the toolchain SRI hash.

Updates #6845.

Signed-off-by: David Anderson <danderson@tailscale.com>
pull/6848/head
David Anderson 2 years ago committed by Dave Anderson
parent d2beaea523
commit 7bfb9999ee

@ -19,6 +19,7 @@ import (
var ( var (
goToolchain = flag.Bool("go", false, "print the supported Go toolchain git hash (a github.com/tailscale/go commit)") goToolchain = flag.Bool("go", false, "print the supported Go toolchain git hash (a github.com/tailscale/go commit)")
goToolchainURL = flag.Bool("go-url", false, "print the URL to the tarball of the Tailscale Go toolchain") goToolchainURL = flag.Bool("go-url", false, "print the URL to the tarball of the Tailscale Go toolchain")
goToolchainSRI = flag.Bool("go-sri", false, "print the SRI hash of the Tailscale Go toolchain")
alpine = flag.Bool("alpine", false, "print the tag of alpine docker image") alpine = flag.Bool("alpine", false, "print the tag of alpine docker image")
) )
@ -48,4 +49,7 @@ func main() {
} }
fmt.Printf("https://github.com/tailscale/go/releases/download/build-%s/%s%s.tar.gz\n", strings.TrimSpace(ts.GoToolchainRev), runtime.GOOS, suffix) fmt.Printf("https://github.com/tailscale/go/releases/download/build-%s/%s%s.tar.gz\n", strings.TrimSpace(ts.GoToolchainRev), runtime.GOOS, suffix)
} }
if *goToolchainSRI {
fmt.Println(strings.TrimSpace(ts.GoToolchainSRI))
}
} }

@ -18,3 +18,9 @@ var AlpineDockerTag string
// //
//go:embed go.toolchain.rev //go:embed go.toolchain.rev
var GoToolchainRev string var GoToolchainRev string
// GoToolchainSRI is the Nix SRI hash of the Go toolchain identified
// by GoToolchainRev. It may end in a newline.
//
//go:embed go.toolchain.sri
var GoToolchainSRI string

Loading…
Cancel
Save