summaryrefslogtreecommitdiffhomepage
path: root/tool
diff options
context:
space:
mode:
authorNick Khyl <nickk@tailscale.com>2024-12-05 13:16:48 -0600
committerNick Khyl <nickk@tailscale.com>2024-12-05 13:16:48 -0600
commit0267fe83b200f1702a2fa0a395442c02a053fadb (patch)
tree63654c55225eeb834de59a5a0bc8d19033c6145b /tool
parent87546a5edf6b6503a87eeb2d666baba57398a066 (diff)
downloadtailscale-1.78.0.tar.xz
tailscale-1.78.0.zip
VERSION.txt: this is v1.78.0v1.78.0
Signed-off-by: Nick Khyl <nickk@tailscale.com>
Diffstat (limited to 'tool')
-rw-r--r--tool/binaryen.rev2
-rwxr-xr-xtool/go14
-rw-r--r--tool/gocross/env.go262
-rw-r--r--tool/gocross/env_test.go198
-rw-r--r--tool/gocross/exec_other.go40
-rw-r--r--tool/gocross/exec_unix.go24
-rwxr-xr-xtool/helm138
-rw-r--r--tool/helm.rev2
-rwxr-xr-xtool/node130
-rwxr-xr-xtool/wasm-opt148
-rwxr-xr-xtool/yarn86
-rw-r--r--tool/yarn.rev2
12 files changed, 523 insertions, 523 deletions
diff --git a/tool/binaryen.rev b/tool/binaryen.rev
index 58c9bdf9d..e0d03ab88 100644
--- a/tool/binaryen.rev
+++ b/tool/binaryen.rev
@@ -1 +1 @@
-111
+111
diff --git a/tool/go b/tool/go
index 1c53683d5..3c99f3e2f 100755
--- a/tool/go
+++ b/tool/go
@@ -1,7 +1,7 @@
-#!/bin/sh
-#
-# This script acts like the "go" command, but uses Tailscale's
-# currently-desired version from https://github.com/tailscale/go,
-# downloading it first if necessary.
-
-exec "$(dirname "$0")/../tool/gocross/gocross-wrapper.sh" "$@"
+#!/bin/sh
+#
+# This script acts like the "go" command, but uses Tailscale's
+# currently-desired version from https://github.com/tailscale/go,
+# downloading it first if necessary.
+
+exec "$(dirname "$0")/../tool/gocross/gocross-wrapper.sh" "$@"
diff --git a/tool/gocross/env.go b/tool/gocross/env.go
index 9d8a4f1b3..249476dc1 100644
--- a/tool/gocross/env.go
+++ b/tool/gocross/env.go
@@ -1,131 +1,131 @@
-// Copyright (c) Tailscale Inc & AUTHORS
-// SPDX-License-Identifier: BSD-3-Clause
-
-package main
-
-import (
- "fmt"
- "os"
- "sort"
- "strings"
-)
-
-// Environment starts from an initial set of environment variables, and tracks
-// mutations to the environment. It can then apply those mutations to the
-// environment, or produce debugging output that illustrates the changes it
-// would make.
-type Environment struct {
- init map[string]string
- set map[string]string
- unset map[string]bool
-
- setenv func(string, string) error
- unsetenv func(string) error
-}
-
-// NewEnvironment returns an Environment initialized from os.Environ.
-func NewEnvironment() *Environment {
- init := map[string]string{}
- for _, env := range os.Environ() {
- fs := strings.SplitN(env, "=", 2)
- if len(fs) != 2 {
- panic("bad environ provided")
- }
- init[fs[0]] = fs[1]
- }
-
- return newEnvironmentForTest(init, os.Setenv, os.Unsetenv)
-}
-
-func newEnvironmentForTest(init map[string]string, setenv func(string, string) error, unsetenv func(string) error) *Environment {
- return &Environment{
- init: init,
- set: map[string]string{},
- unset: map[string]bool{},
- setenv: setenv,
- unsetenv: unsetenv,
- }
-}
-
-// Set sets the environment variable k to v.
-func (e *Environment) Set(k, v string) {
- e.set[k] = v
- delete(e.unset, k)
-}
-
-// Unset removes the environment variable k.
-func (e *Environment) Unset(k string) {
- delete(e.set, k)
- e.unset[k] = true
-}
-
-// IsSet reports whether the environment variable k is set.
-func (e *Environment) IsSet(k string) bool {
- if e.unset[k] {
- return false
- }
- if _, ok := e.init[k]; ok {
- return true
- }
- if _, ok := e.set[k]; ok {
- return true
- }
- return false
-}
-
-// Get returns the value of the environment variable k, or defaultVal if it is
-// not set.
-func (e *Environment) Get(k, defaultVal string) string {
- if e.unset[k] {
- return defaultVal
- }
- if v, ok := e.set[k]; ok {
- return v
- }
- if v, ok := e.init[k]; ok {
- return v
- }
- return defaultVal
-}
-
-// Apply applies all pending mutations to the environment.
-func (e *Environment) Apply() error {
- for k, v := range e.set {
- if err := e.setenv(k, v); err != nil {
- return fmt.Errorf("setting %q: %v", k, err)
- }
- e.init[k] = v
- delete(e.set, k)
- }
- for k := range e.unset {
- if err := e.unsetenv(k); err != nil {
- return fmt.Errorf("unsetting %q: %v", k, err)
- }
- delete(e.init, k)
- delete(e.unset, k)
- }
- return nil
-}
-
-// Diff returns a string describing the pending mutations to the environment.
-func (e *Environment) Diff() string {
- lines := make([]string, 0, len(e.set)+len(e.unset))
- for k, v := range e.set {
- old, ok := e.init[k]
- if ok {
- lines = append(lines, fmt.Sprintf("%s=%s (was %s)", k, v, old))
- } else {
- lines = append(lines, fmt.Sprintf("%s=%s (was <nil>)", k, v))
- }
- }
- for k := range e.unset {
- old, ok := e.init[k]
- if ok {
- lines = append(lines, fmt.Sprintf("%s=<nil> (was %s)", k, old))
- } else {
- lines = append(lines, fmt.Sprintf("%s=<nil> (was <nil>)", k))
- }
- }
- sort.Strings(lines)
- return strings.Join(lines, "\n")
-}
+// Copyright (c) Tailscale Inc & AUTHORS
+// SPDX-License-Identifier: BSD-3-Clause
+
+package main
+
+import (
+ "fmt"
+ "os"
+ "sort"
+ "strings"
+)
+
+// Environment starts from an initial set of environment variables, and tracks
+// mutations to the environment. It can then apply those mutations to the
+// environment, or produce debugging output that illustrates the changes it
+// would make.
+type Environment struct {
+ init map[string]string
+ set map[string]string
+ unset map[string]bool
+
+ setenv func(string, string) error
+ unsetenv func(string) error
+}
+
+// NewEnvironment returns an Environment initialized from os.Environ.
+func NewEnvironment() *Environment {
+ init := map[string]string{}
+ for _, env := range os.Environ() {
+ fs := strings.SplitN(env, "=", 2)
+ if len(fs) != 2 {
+ panic("bad environ provided")
+ }
+ init[fs[0]] = fs[1]
+ }
+
+ return newEnvironmentForTest(init, os.Setenv, os.Unsetenv)
+}
+
+func newEnvironmentForTest(init map[string]string, setenv func(string, string) error, unsetenv func(string) error) *Environment {
+ return &Environment{
+ init: init,
+ set: map[string]string{},
+ unset: map[string]bool{},
+ setenv: setenv,
+ unsetenv: unsetenv,
+ }
+}
+
+// Set sets the environment variable k to v.
+func (e *Environment) Set(k, v string) {
+ e.set[k] = v
+ delete(e.unset, k)
+}
+
+// Unset removes the environment variable k.
+func (e *Environment) Unset(k string) {
+ delete(e.set, k)
+ e.unset[k] = true
+}
+
+// IsSet reports whether the environment variable k is set.
+func (e *Environment) IsSet(k string) bool {
+ if e.unset[k] {
+ return false
+ }
+ if _, ok := e.init[k]; ok {
+ return true
+ }
+ if _, ok := e.set[k]; ok {
+ return true
+ }
+ return false
+}
+
+// Get returns the value of the environment variable k, or defaultVal if it is
+// not set.
+func (e *Environment) Get(k, defaultVal string) string {
+ if e.unset[k] {
+ return defaultVal
+ }
+ if v, ok := e.set[k]; ok {
+ return v
+ }
+ if v, ok := e.init[k]; ok {
+ return v
+ }
+ return defaultVal
+}
+
+// Apply applies all pending mutations to the environment.
+func (e *Environment) Apply() error {
+ for k, v := range e.set {
+ if err := e.setenv(k, v); err != nil {
+ return fmt.Errorf("setting %q: %v", k, err)
+ }
+ e.init[k] = v
+ delete(e.set, k)
+ }
+ for k := range e.unset {
+ if err := e.unsetenv(k); err != nil {
+ return fmt.Errorf("unsetting %q: %v", k, err)
+ }
+ delete(e.init, k)
+ delete(e.unset, k)
+ }
+ return nil
+}
+
+// Diff returns a string describing the pending mutations to the environment.
+func (e *Environment) Diff() string {
+ lines := make([]string, 0, len(e.set)+len(e.unset))
+ for k, v := range e.set {
+ old, ok := e.init[k]
+ if ok {
+ lines = append(lines, fmt.Sprintf("%s=%s (was %s)", k, v, old))
+ } else {
+ lines = append(lines, fmt.Sprintf("%s=%s (was <nil>)", k, v))
+ }
+ }
+ for k := range e.unset {
+ old, ok := e.init[k]
+ if ok {
+ lines = append(lines, fmt.Sprintf("%s=<nil> (was %s)", k, old))
+ } else {
+ lines = append(lines, fmt.Sprintf("%s=<nil> (was <nil>)", k))
+ }
+ }
+ sort.Strings(lines)
+ return strings.Join(lines, "\n")
+}
diff --git a/tool/gocross/env_test.go b/tool/gocross/env_test.go
index 001487bb8..9a797530d 100644
--- a/tool/gocross/env_test.go
+++ b/tool/gocross/env_test.go
@@ -1,99 +1,99 @@
-// Copyright (c) Tailscale Inc & AUTHORS
-// SPDX-License-Identifier: BSD-3-Clause
-
-package main
-
-import (
- "testing"
-
- "github.com/google/go-cmp/cmp"
-)
-
-func TestEnv(t *testing.T) {
-
- var (
- init = map[string]string{
- "FOO": "bar",
- }
-
- wasSet = map[string]string{}
- wasUnset = map[string]bool{}
-
- setenv = func(k, v string) error {
- wasSet[k] = v
- return nil
- }
- unsetenv = func(k string) error {
- wasUnset[k] = true
- return nil
- }
- )
-
- env := newEnvironmentForTest(init, setenv, unsetenv)
-
- if got, want := env.Get("FOO", ""), "bar"; got != want {
- t.Errorf(`env.Get("FOO") = %q, want %q`, got, want)
- }
- if got, want := env.IsSet("FOO"), true; got != want {
- t.Errorf(`env.IsSet("FOO") = %v, want %v`, got, want)
- }
-
- if got, want := env.Get("BAR", "defaultVal"), "defaultVal"; got != want {
- t.Errorf(`env.Get("BAR") = %q, want %q`, got, want)
- }
- if got, want := env.IsSet("BAR"), false; got != want {
- t.Errorf(`env.IsSet("BAR") = %v, want %v`, got, want)
- }
-
- env.Set("BAR", "quux")
- if got, want := env.Get("BAR", ""), "quux"; got != want {
- t.Errorf(`env.Get("BAR") = %q, want %q`, got, want)
- }
- if got, want := env.IsSet("BAR"), true; got != want {
- t.Errorf(`env.IsSet("BAR") = %v, want %v`, got, want)
- }
- diff := "BAR=quux (was <nil>)"
- if got := env.Diff(); got != diff {
- t.Errorf("env.Diff() = %q, want %q", got, diff)
- }
-
- env.Set("FOO", "foo2")
- if got, want := env.Get("FOO", ""), "foo2"; got != want {
- t.Errorf(`env.Get("FOO") = %q, want %q`, got, want)
- }
- if got, want := env.IsSet("FOO"), true; got != want {
- t.Errorf(`env.IsSet("FOO") = %v, want %v`, got, want)
- }
- diff = `BAR=quux (was <nil>)
-FOO=foo2 (was bar)`
- if got := env.Diff(); got != diff {
- t.Errorf("env.Diff() = %q, want %q", got, diff)
- }
-
- env.Unset("FOO")
- if got, want := env.Get("FOO", "default"), "default"; got != want {
- t.Errorf(`env.Get("FOO") = %q, want %q`, got, want)
- }
- if got, want := env.IsSet("FOO"), false; got != want {
- t.Errorf(`env.IsSet("FOO") = %v, want %v`, got, want)
- }
- diff = `BAR=quux (was <nil>)
-FOO=<nil> (was bar)`
- if got := env.Diff(); got != diff {
- t.Errorf("env.Diff() = %q, want %q", got, diff)
- }
-
- if err := env.Apply(); err != nil {
- t.Fatalf("env.Apply() failed: %v", err)
- }
-
- wantSet := map[string]string{"BAR": "quux"}
- wantUnset := map[string]bool{"FOO": true}
-
- if diff := cmp.Diff(wasSet, wantSet); diff != "" {
- t.Errorf("env.Apply didn't set as expected (-got+want):\n%s", diff)
- }
- if diff := cmp.Diff(wasUnset, wantUnset); diff != "" {
- t.Errorf("env.Apply didn't unset as expected (-got+want):\n%s", diff)
- }
-}
+// Copyright (c) Tailscale Inc & AUTHORS
+// SPDX-License-Identifier: BSD-3-Clause
+
+package main
+
+import (
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+)
+
+func TestEnv(t *testing.T) {
+
+ var (
+ init = map[string]string{
+ "FOO": "bar",
+ }
+
+ wasSet = map[string]string{}
+ wasUnset = map[string]bool{}
+
+ setenv = func(k, v string) error {
+ wasSet[k] = v
+ return nil
+ }
+ unsetenv = func(k string) error {
+ wasUnset[k] = true
+ return nil
+ }
+ )
+
+ env := newEnvironmentForTest(init, setenv, unsetenv)
+
+ if got, want := env.Get("FOO", ""), "bar"; got != want {
+ t.Errorf(`env.Get("FOO") = %q, want %q`, got, want)
+ }
+ if got, want := env.IsSet("FOO"), true; got != want {
+ t.Errorf(`env.IsSet("FOO") = %v, want %v`, got, want)
+ }
+
+ if got, want := env.Get("BAR", "defaultVal"), "defaultVal"; got != want {
+ t.Errorf(`env.Get("BAR") = %q, want %q`, got, want)
+ }
+ if got, want := env.IsSet("BAR"), false; got != want {
+ t.Errorf(`env.IsSet("BAR") = %v, want %v`, got, want)
+ }
+
+ env.Set("BAR", "quux")
+ if got, want := env.Get("BAR", ""), "quux"; got != want {
+ t.Errorf(`env.Get("BAR") = %q, want %q`, got, want)
+ }
+ if got, want := env.IsSet("BAR"), true; got != want {
+ t.Errorf(`env.IsSet("BAR") = %v, want %v`, got, want)
+ }
+ diff := "BAR=quux (was <nil>)"
+ if got := env.Diff(); got != diff {
+ t.Errorf("env.Diff() = %q, want %q", got, diff)
+ }
+
+ env.Set("FOO", "foo2")
+ if got, want := env.Get("FOO", ""), "foo2"; got != want {
+ t.Errorf(`env.Get("FOO") = %q, want %q`, got, want)
+ }
+ if got, want := env.IsSet("FOO"), true; got != want {
+ t.Errorf(`env.IsSet("FOO") = %v, want %v`, got, want)
+ }
+ diff = `BAR=quux (was <nil>)
+FOO=foo2 (was bar)`
+ if got := env.Diff(); got != diff {
+ t.Errorf("env.Diff() = %q, want %q", got, diff)
+ }
+
+ env.Unset("FOO")
+ if got, want := env.Get("FOO", "default"), "default"; got != want {
+ t.Errorf(`env.Get("FOO") = %q, want %q`, got, want)
+ }
+ if got, want := env.IsSet("FOO"), false; got != want {
+ t.Errorf(`env.IsSet("FOO") = %v, want %v`, got, want)
+ }
+ diff = `BAR=quux (was <nil>)
+FOO=<nil> (was bar)`
+ if got := env.Diff(); got != diff {
+ t.Errorf("env.Diff() = %q, want %q", got, diff)
+ }
+
+ if err := env.Apply(); err != nil {
+ t.Fatalf("env.Apply() failed: %v", err)
+ }
+
+ wantSet := map[string]string{"BAR": "quux"}
+ wantUnset := map[string]bool{"FOO": true}
+
+ if diff := cmp.Diff(wasSet, wantSet); diff != "" {
+ t.Errorf("env.Apply didn't set as expected (-got+want):\n%s", diff)
+ }
+ if diff := cmp.Diff(wasUnset, wantUnset); diff != "" {
+ t.Errorf("env.Apply didn't unset as expected (-got+want):\n%s", diff)
+ }
+}
diff --git a/tool/gocross/exec_other.go b/tool/gocross/exec_other.go
index 8d4df0db3..ec9663df7 100644
--- a/tool/gocross/exec_other.go
+++ b/tool/gocross/exec_other.go
@@ -1,20 +1,20 @@
-// Copyright (c) Tailscale Inc & AUTHORS
-// SPDX-License-Identifier: BSD-3-Clause
-
-//go:build !unix
-
-package main
-
-import (
- "os"
- "os/exec"
-)
-
-func doExec(cmd string, args []string, env []string) error {
- c := exec.Command(cmd, args...)
- c.Env = env
- c.Stdin = os.Stdin
- c.Stdout = os.Stdout
- c.Stderr = os.Stderr
- return c.Run()
-}
+// Copyright (c) Tailscale Inc & AUTHORS
+// SPDX-License-Identifier: BSD-3-Clause
+
+//go:build !unix
+
+package main
+
+import (
+ "os"
+ "os/exec"
+)
+
+func doExec(cmd string, args []string, env []string) error {
+ c := exec.Command(cmd, args...)
+ c.Env = env
+ c.Stdin = os.Stdin
+ c.Stdout = os.Stdout
+ c.Stderr = os.Stderr
+ return c.Run()
+}
diff --git a/tool/gocross/exec_unix.go b/tool/gocross/exec_unix.go
index 79cbf764a..eeffd5f93 100644
--- a/tool/gocross/exec_unix.go
+++ b/tool/gocross/exec_unix.go
@@ -1,12 +1,12 @@
-// Copyright (c) Tailscale Inc & AUTHORS
-// SPDX-License-Identifier: BSD-3-Clause
-
-//go:build unix
-
-package main
-
-import "golang.org/x/sys/unix"
-
-func doExec(cmd string, args []string, env []string) error {
- return unix.Exec(cmd, args, env)
-}
+// Copyright (c) Tailscale Inc & AUTHORS
+// SPDX-License-Identifier: BSD-3-Clause
+
+//go:build unix
+
+package main
+
+import "golang.org/x/sys/unix"
+
+func doExec(cmd string, args []string, env []string) error {
+ return unix.Exec(cmd, args, env)
+}
diff --git a/tool/helm b/tool/helm
index 3f9a9dfd5..8cbc2f206 100755
--- a/tool/helm
+++ b/tool/helm
@@ -1,69 +1,69 @@
-#!/usr/bin/env bash
-
-# installs $(cat ./helm.rev) version of helm as $HOME/.cache/tailscale-helm
-
-set -euo pipefail
-
-if [[ "${CI:-}" == "true" ]]; then
- set -x
-fi
-
-(
- if [[ "${CI:-}" == "true" ]]; then
- set -x
- fi
-
- repo_root="${BASH_SOURCE%/*}/../"
- cd "$repo_root"
-
- cachedir="$HOME/.cache/tailscale-helm"
- tarball="${cachedir}.tar.gz"
-
- read -r want_rev < "$(dirname "$0")/helm.rev"
-
- got_rev=""
- if [[ -x "${cachedir}/helm" ]]; then
- got_rev=$("${cachedir}/helm" version --short)
- got_rev="${got_rev#v}" # trim the leading 'v'
- got_rev="${got_rev%+*}" # trim the trailing '+" followed by a commit SHA'
-
-
- fi
-
- if [[ "$want_rev" != "$got_rev" ]]; then
- rm -rf "$cachedir" "$tarball"
- if [[ -n "${IN_NIX_SHELL:-}" ]]; then
- nix_helm="$(which -a helm | grep /nix/store | head -1)"
- nix_helm="${nix_helm%/helm}"
- nix_helm_rev="${nix_helm##*-}"
- if [[ "$nix_helm_rev" != "$want_rev" ]]; then
- echo "Wrong helm version in Nix, got $nix_helm_rev want $want_rev" >&2
- exit 1
- fi
- ln -sf "$nix_helm" "$cachedir"
- else
- # works for linux and darwin
- # https://github.com/helm/helm/releases
- OS=$(uname -s | tr A-Z a-z)
- ARCH=$(uname -m)
- if [ "$ARCH" = "x86_64" ]; then
- ARCH="amd64"
- fi
- if [ "$ARCH" = "aarch64" ]; then
- ARCH="arm64"
- fi
- mkdir -p "$cachedir"
- # When running on GitHub in CI, the below curl sometimes fails with
- # INTERNAL_ERROR after finishing the download. The most common cause
- # of INTERNAL_ERROR is glitches in intermediate hosts handling of
- # HTTP/2 forwarding, so forcing HTTP 1.1 often fixes the issue. See
- # https://github.com/tailscale/tailscale/issues/8988
- curl -f -L --http1.1 -o "$tarball" -sSL "https://get.helm.sh/helm-v${want_rev}-${OS}-${ARCH}.tar.gz"
- (cd "$cachedir" && tar --strip-components=1 -xf "$tarball")
- rm -f "$tarball"
- fi
- fi
-)
-
-export PATH="$HOME/.cache/tailscale-helm:$PATH"
-exec "$HOME/.cache/tailscale-helm/helm" "$@"
+#!/usr/bin/env bash
+
+# installs $(cat ./helm.rev) version of helm as $HOME/.cache/tailscale-helm
+
+set -euo pipefail
+
+if [[ "${CI:-}" == "true" ]]; then
+ set -x
+fi
+
+(
+ if [[ "${CI:-}" == "true" ]]; then
+ set -x
+ fi
+
+ repo_root="${BASH_SOURCE%/*}/../"
+ cd "$repo_root"
+
+ cachedir="$HOME/.cache/tailscale-helm"
+ tarball="${cachedir}.tar.gz"
+
+ read -r want_rev < "$(dirname "$0")/helm.rev"
+
+ got_rev=""
+ if [[ -x "${cachedir}/helm" ]]; then
+ got_rev=$("${cachedir}/helm" version --short)
+ got_rev="${got_rev#v}" # trim the leading 'v'
+ got_rev="${got_rev%+*}" # trim the trailing '+" followed by a commit SHA'
+
+
+ fi
+
+ if [[ "$want_rev" != "$got_rev" ]]; then
+ rm -rf "$cachedir" "$tarball"
+ if [[ -n "${IN_NIX_SHELL:-}" ]]; then
+ nix_helm="$(which -a helm | grep /nix/store | head -1)"
+ nix_helm="${nix_helm%/helm}"
+ nix_helm_rev="${nix_helm##*-}"
+ if [[ "$nix_helm_rev" != "$want_rev" ]]; then
+ echo "Wrong helm version in Nix, got $nix_helm_rev want $want_rev" >&2
+ exit 1
+ fi
+ ln -sf "$nix_helm" "$cachedir"
+ else
+ # works for linux and darwin
+ # https://github.com/helm/helm/releases
+ OS=$(uname -s | tr A-Z a-z)
+ ARCH=$(uname -m)
+ if [ "$ARCH" = "x86_64" ]; then
+ ARCH="amd64"
+ fi
+ if [ "$ARCH" = "aarch64" ]; then
+ ARCH="arm64"
+ fi
+ mkdir -p "$cachedir"
+ # When running on GitHub in CI, the below curl sometimes fails with
+ # INTERNAL_ERROR after finishing the download. The most common cause
+ # of INTERNAL_ERROR is glitches in intermediate hosts handling of
+ # HTTP/2 forwarding, so forcing HTTP 1.1 often fixes the issue. See
+ # https://github.com/tailscale/tailscale/issues/8988
+ curl -f -L --http1.1 -o "$tarball" -sSL "https://get.helm.sh/helm-v${want_rev}-${OS}-${ARCH}.tar.gz"
+ (cd "$cachedir" && tar --strip-components=1 -xf "$tarball")
+ rm -f "$tarball"
+ fi
+ fi
+)
+
+export PATH="$HOME/.cache/tailscale-helm:$PATH"
+exec "$HOME/.cache/tailscale-helm/helm" "$@"
diff --git a/tool/helm.rev b/tool/helm.rev
index c10780c62..0d0e48dd0 100644
--- a/tool/helm.rev
+++ b/tool/helm.rev
@@ -1 +1 @@
-3.13.1
+3.13.1
diff --git a/tool/node b/tool/node
index 310140ae5..7e96826f3 100755
--- a/tool/node
+++ b/tool/node
@@ -1,65 +1,65 @@
-#!/usr/bin/env bash
-# Run a command with our local node install, rather than any globally installed
-# instance.
-
-set -euo pipefail
-
-if [[ "${CI:-}" == "true" ]]; then
- set -x
-fi
-
-(
- if [[ "${CI:-}" == "true" ]]; then
- set -x
- fi
-
- repo_root="${BASH_SOURCE%/*}/../"
- cd "$repo_root"
-
- cachedir="$HOME/.cache/tailscale-node"
- tarball="${cachedir}.tar.gz"
-
- read -r want_rev < "$(dirname "$0")/node.rev"
-
- got_rev=""
- if [[ -x "${cachedir}/bin/node" ]]; then
- got_rev=$("${cachedir}/bin/node" --version)
- got_rev="${got_rev#v}" # trim the leading 'v'
- fi
-
- if [[ "$want_rev" != "$got_rev" ]]; then
- rm -rf "$cachedir" "$tarball"
- if [[ -n "${IN_NIX_SHELL:-}" ]]; then
- nix_node="$(which -a node | grep /nix/store | head -1)"
- nix_node="${nix_node%/bin/node}"
- nix_node_rev="${nix_node##*-}"
- if [[ "$nix_node_rev" != "$want_rev" ]]; then
- echo "Wrong node version in Nix, got $nix_node_rev want $want_rev" >&2
- exit 1
- fi
- ln -sf "$nix_node" "$cachedir"
- else
- # works for "linux" and "darwin"
- OS=$(uname -s | tr A-Z a-z)
- ARCH=$(uname -m)
- if [ "$ARCH" = "x86_64" ]; then
- ARCH="x64"
- fi
- if [ "$ARCH" = "aarch64" ]; then
- ARCH="arm64"
- fi
- mkdir -p "$cachedir"
- # When running on GitHub in CI, the below curl sometimes fails with
- # INTERNAL_ERROR after finishing the download. The most common cause
- # of INTERNAL_ERROR is glitches in intermediate hosts handling of
- # HTTP/2 forwarding, so forcing HTTP 1.1 often fixes the issue. See
- # https://github.com/tailscale/tailscale/issues/8988
- curl -f -L --http1.1 -o "$tarball" "https://nodejs.org/dist/v${want_rev}/node-v${want_rev}-${OS}-${ARCH}.tar.gz"
- (cd "$cachedir" && tar --strip-components=1 -xf "$tarball")
- rm -f "$tarball"
- fi
- fi
-)
-
-export PATH="$HOME/.cache/tailscale-node/bin:$PATH"
-exec "$HOME/.cache/tailscale-node/bin/node" "$@"
+#!/usr/bin/env bash
+# Run a command with our local node install, rather than any globally installed
+# instance.
+
+set -euo pipefail
+
+if [[ "${CI:-}" == "true" ]]; then
+ set -x
+fi
+
+(
+ if [[ "${CI:-}" == "true" ]]; then
+ set -x
+ fi
+
+ repo_root="${BASH_SOURCE%/*}/../"
+ cd "$repo_root"
+
+ cachedir="$HOME/.cache/tailscale-node"
+ tarball="${cachedir}.tar.gz"
+
+ read -r want_rev < "$(dirname "$0")/node.rev"
+
+ got_rev=""
+ if [[ -x "${cachedir}/bin/node" ]]; then
+ got_rev=$("${cachedir}/bin/node" --version)
+ got_rev="${got_rev#v}" # trim the leading 'v'
+ fi
+
+ if [[ "$want_rev" != "$got_rev" ]]; then
+ rm -rf "$cachedir" "$tarball"
+ if [[ -n "${IN_NIX_SHELL:-}" ]]; then
+ nix_node="$(which -a node | grep /nix/store | head -1)"
+ nix_node="${nix_node%/bin/node}"
+ nix_node_rev="${nix_node##*-}"
+ if [[ "$nix_node_rev" != "$want_rev" ]]; then
+ echo "Wrong node version in Nix, got $nix_node_rev want $want_rev" >&2
+ exit 1
+ fi
+ ln -sf "$nix_node" "$cachedir"
+ else
+ # works for "linux" and "darwin"
+ OS=$(uname -s | tr A-Z a-z)
+ ARCH=$(uname -m)
+ if [ "$ARCH" = "x86_64" ]; then
+ ARCH="x64"
+ fi
+ if [ "$ARCH" = "aarch64" ]; then
+ ARCH="arm64"
+ fi
+ mkdir -p "$cachedir"
+ # When running on GitHub in CI, the below curl sometimes fails with
+ # INTERNAL_ERROR after finishing the download. The most common cause
+ # of INTERNAL_ERROR is glitches in intermediate hosts handling of
+ # HTTP/2 forwarding, so forcing HTTP 1.1 often fixes the issue. See
+ # https://github.com/tailscale/tailscale/issues/8988
+ curl -f -L --http1.1 -o "$tarball" "https://nodejs.org/dist/v${want_rev}/node-v${want_rev}-${OS}-${ARCH}.tar.gz"
+ (cd "$cachedir" && tar --strip-components=1 -xf "$tarball")
+ rm -f "$tarball"
+ fi
+ fi
+)
+
+export PATH="$HOME/.cache/tailscale-node/bin:$PATH"
+exec "$HOME/.cache/tailscale-node/bin/node" "$@"
diff --git a/tool/wasm-opt b/tool/wasm-opt
index 08f3e5bfb..88d332f0b 100755
--- a/tool/wasm-opt
+++ b/tool/wasm-opt
@@ -1,74 +1,74 @@
-#!/bin/sh
-#
-# This script acts like the "wasm-opt" command from the Binaryen toolchain, but
-# uses Tailscale's currently-desired version, downloading it first if necessary.
-
-set -eu
-
-BINARYEN_DIR="$HOME/.cache/tailscale-binaryen"
-read -r BINARYEN_REV < "$(dirname "$0")/binaryen.rev"
-# This works for Linux and Darwin, which is sufficient
-# (we do not build for other targets).
-OS=$(uname -s | tr A-Z a-z)
-if [ "$OS" = "darwin" ]; then
- # Binaryen uses the name "macos".
- OS="macos"
-fi
-ARCH="$(uname -m)"
-if [ "$ARCH" = "aarch64" ]; then
- # Binaryen uses the name "arm64".
- ARCH="arm64"
-fi
-
-install_binaryen() {
- BINARYEN_URL="https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_REV}/binaryen-version_${BINARYEN_REV}-${ARCH}-${OS}.tar.gz"
- install_tool "wasm-opt" $BINARYEN_REV $BINARYEN_DIR $BINARYEN_URL
-}
-
-install_tool() {
- TOOL=$1
- REV=$2
- TOOLCHAIN=$3
- URL=$4
-
- archive="$TOOLCHAIN-$REV.tar.gz"
- mark="$TOOLCHAIN.extracted"
- extracted=
- [ ! -e "$mark" ] || read -r extracted junk <$mark
-
- if [ "$extracted" = "$REV" ] && [ -e "$TOOLCHAIN/bin/$TOOL" ]; then
- # Already extracted, continue silently
- return 0
- fi
- echo ""
-
- rm -f "$archive.new" "$TOOLCHAIN.extracted"
- if [ ! -e "$archive" ]; then
- log "Need to download $TOOL '$REV' from $URL."
- curl -f -L -o "$archive.new" $URL
- rm -f "$archive"
- mv "$archive.new" "$archive"
- fi
-
- log "Extracting $TOOL '$REV' into '$TOOLCHAIN'." >&2
- rm -rf "$TOOLCHAIN"
- mkdir -p "$TOOLCHAIN"
- (cd "$TOOLCHAIN" && tar --strip-components=1 -xf "$archive")
- echo "$REV" >$mark
-}
-
-log() {
- echo "$@" >&2
-}
-
-if [ "${BINARYEN_DIR}" = "SKIP" ] ||
- [ "${OS}" != "macos" -a "${OS}" != "linux" ] ||
- [ "${ARCH}" != "x86_64" -a "${ARCH}" != "arm64" ]; then
- log "Unsupported OS (${OS}) and architecture (${ARCH}) combination."
- log "Using existing wasm-opt (`which wasm-opt`)."
- exec wasm-opt "$@"
-fi
-
-install_binaryen
-
-"$BINARYEN_DIR/bin/wasm-opt" "$@"
+#!/bin/sh
+#
+# This script acts like the "wasm-opt" command from the Binaryen toolchain, but
+# uses Tailscale's currently-desired version, downloading it first if necessary.
+
+set -eu
+
+BINARYEN_DIR="$HOME/.cache/tailscale-binaryen"
+read -r BINARYEN_REV < "$(dirname "$0")/binaryen.rev"
+# This works for Linux and Darwin, which is sufficient
+# (we do not build for other targets).
+OS=$(uname -s | tr A-Z a-z)
+if [ "$OS" = "darwin" ]; then
+ # Binaryen uses the name "macos".
+ OS="macos"
+fi
+ARCH="$(uname -m)"
+if [ "$ARCH" = "aarch64" ]; then
+ # Binaryen uses the name "arm64".
+ ARCH="arm64"
+fi
+
+install_binaryen() {
+ BINARYEN_URL="https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_REV}/binaryen-version_${BINARYEN_REV}-${ARCH}-${OS}.tar.gz"
+ install_tool "wasm-opt" $BINARYEN_REV $BINARYEN_DIR $BINARYEN_URL
+}
+
+install_tool() {
+ TOOL=$1
+ REV=$2
+ TOOLCHAIN=$3
+ URL=$4
+
+ archive="$TOOLCHAIN-$REV.tar.gz"
+ mark="$TOOLCHAIN.extracted"
+ extracted=
+ [ ! -e "$mark" ] || read -r extracted junk <$mark
+
+ if [ "$extracted" = "$REV" ] && [ -e "$TOOLCHAIN/bin/$TOOL" ]; then
+ # Already extracted, continue silently
+ return 0
+ fi
+ echo ""
+
+ rm -f "$archive.new" "$TOOLCHAIN.extracted"
+ if [ ! -e "$archive" ]; then
+ log "Need to download $TOOL '$REV' from $URL."
+ curl -f -L -o "$archive.new" $URL
+ rm -f "$archive"
+ mv "$archive.new" "$archive"
+ fi
+
+ log "Extracting $TOOL '$REV' into '$TOOLCHAIN'." >&2
+ rm -rf "$TOOLCHAIN"
+ mkdir -p "$TOOLCHAIN"
+ (cd "$TOOLCHAIN" && tar --strip-components=1 -xf "$archive")
+ echo "$REV" >$mark
+}
+
+log() {
+ echo "$@" >&2
+}
+
+if [ "${BINARYEN_DIR}" = "SKIP" ] ||
+ [ "${OS}" != "macos" -a "${OS}" != "linux" ] ||
+ [ "${ARCH}" != "x86_64" -a "${ARCH}" != "arm64" ]; then
+ log "Unsupported OS (${OS}) and architecture (${ARCH}) combination."
+ log "Using existing wasm-opt (`which wasm-opt`)."
+ exec wasm-opt "$@"
+fi
+
+install_binaryen
+
+"$BINARYEN_DIR/bin/wasm-opt" "$@"
diff --git a/tool/yarn b/tool/yarn
index 6357beda6..6bb01d2f2 100755
--- a/tool/yarn
+++ b/tool/yarn
@@ -1,43 +1,43 @@
-#!/usr/bin/env bash
-# Run a command with our local yarn install, rather than any globally installed
-# instance.
-
-set -euo pipefail
-
-if [[ "${CI:-}" == "true" ]]; then
- set -x
-fi
-
-(
- if [[ "${CI:-}" == "true" ]]; then
- set -x
- fi
-
- repo_root="${BASH_SOURCE%/*}/../"
- cd "$repo_root"
-
- ./tool/node --version >/dev/null # Ensure node is unpacked and ready
-
- cachedir="$HOME/.cache/tailscale-yarn"
- tarball="${cachedir}.tar.gz"
-
- read -r want_rev < "./tool/yarn.rev"
-
- got_rev=""
- if [[ -x "${cachedir}/bin/yarn" ]]; then
- got_rev=$(PATH="$HOME/.cache/tailscale-node/bin:$PATH" "${cachedir}/bin/yarn" --version)
- fi
-
- if [[ "$want_rev" != "$got_rev" ]]; then
- rm -rf "$cachedir" "$tarball"
- mkdir -p "$cachedir"
- curl -f -L -o "$tarball" "https://github.com/yarnpkg/yarn/releases/download/v${want_rev}/yarn-v${want_rev}.tar.gz"
- (cd "$cachedir" && tar --strip-components=1 -xf "$tarball")
- rm -f "$tarball"
- fi
-)
-
-# Deliberately not using cachedir here, to keep the environment
-# completely pristine for execution of yarn.
-export PATH="$HOME/.cache/tailscale-node/bin:$HOME/.cache/tailscale-yarn/bin:$PATH"
-exec "$HOME/.cache/tailscale-yarn/bin/yarn" "$@"
+#!/usr/bin/env bash
+# Run a command with our local yarn install, rather than any globally installed
+# instance.
+
+set -euo pipefail
+
+if [[ "${CI:-}" == "true" ]]; then
+ set -x
+fi
+
+(
+ if [[ "${CI:-}" == "true" ]]; then
+ set -x
+ fi
+
+ repo_root="${BASH_SOURCE%/*}/../"
+ cd "$repo_root"
+
+ ./tool/node --version >/dev/null # Ensure node is unpacked and ready
+
+ cachedir="$HOME/.cache/tailscale-yarn"
+ tarball="${cachedir}.tar.gz"
+
+ read -r want_rev < "./tool/yarn.rev"
+
+ got_rev=""
+ if [[ -x "${cachedir}/bin/yarn" ]]; then
+ got_rev=$(PATH="$HOME/.cache/tailscale-node/bin:$PATH" "${cachedir}/bin/yarn" --version)
+ fi
+
+ if [[ "$want_rev" != "$got_rev" ]]; then
+ rm -rf "$cachedir" "$tarball"
+ mkdir -p "$cachedir"
+ curl -f -L -o "$tarball" "https://github.com/yarnpkg/yarn/releases/download/v${want_rev}/yarn-v${want_rev}.tar.gz"
+ (cd "$cachedir" && tar --strip-components=1 -xf "$tarball")
+ rm -f "$tarball"
+ fi
+)
+
+# Deliberately not using cachedir here, to keep the environment
+# completely pristine for execution of yarn.
+export PATH="$HOME/.cache/tailscale-node/bin:$HOME/.cache/tailscale-yarn/bin:$PATH"
+exec "$HOME/.cache/tailscale-yarn/bin/yarn" "$@"
diff --git a/tool/yarn.rev b/tool/yarn.rev
index de5856e86..736c4acbd 100644
--- a/tool/yarn.rev
+++ b/tool/yarn.rev
@@ -1 +1 @@
-1.22.19
+1.22.19