mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-20 00:31:17 -08:00
tool,release/dist: remove yarn (#22469)
The web client and tsconnect now use tool/pnpm, so nothing uses yarn. Remove tool/yarn, tool/yarn.rev, the deprecated dist.Build.Yarn field and yarn from the flake dev shell. Updates tailscale/corp#51439 Change-Id: Ic27506cc77c1ada96c40a2978903204418d82d3d Signed-off-by: Jim Wright <[email protected]>
This commit is contained in:
1 parent
5528c3d1ba
commit
9a785b98df
4 files changed
-53
No files matched your search
@@ -154,7 +154,6 @@
|
||||
graphviz
|
||||
perl
|
||||
go_1_27
|
||||
yarn
|
||||
|
||||
# qemu and e2fsprogs are needed for natlab
|
||||
qemu
|
||||
|
||||
Vendored
-8
@@ -68,11 +68,6 @@ type Build struct {
|
||||
// web client assets. If empty, BuildWebClientAssets looks for tool/pnpm in
|
||||
// Repo, then pnpm in $PATH.
|
||||
Pnpm string
|
||||
// Yarn is the path to the yarn binary, if one is available.
|
||||
//
|
||||
// Deprecated: the web client is built with Pnpm. Yarn is no longer used by
|
||||
// this package and will be removed along with tool/yarn.
|
||||
Yarn string
|
||||
// Version is the version info of the build.
|
||||
Version mkversion.VersionInfo
|
||||
// Time is the timestamp of the build.
|
||||
@@ -115,14 +110,11 @@ func NewBuild(repo, out string) (*Build, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("finding go binary: %w", err)
|
||||
}
|
||||
// Best effort: Yarn is deprecated and only populated for existing callers.
|
||||
yarnTool, _ := findTool(repo, "yarn")
|
||||
b := &Build{
|
||||
Repo: repo,
|
||||
Tmp: tmp,
|
||||
Out: out,
|
||||
Go: goTool,
|
||||
Yarn: yarnTool,
|
||||
Version: mkversion.Info(),
|
||||
Time: time.Now().UTC(),
|
||||
extra: map[any]any{},
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/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" "$@"
|
||||
@@ -1 +0,0 @@
|
||||
1.22.19
|
||||
Reference in new issue
Block a user