summaryrefslogtreecommitdiffhomepage
path: root/tool
AgeCommit message (Collapse)AuthorFilesLines
2026-01-27tool/gocross, pull-toolchain.sh: support a "next" Go toolchainBrad Fitzpatrick1-3/+9
When TS_GO_NEXT=1 is set, update/use the go.toolchain.next.{branch,rev} files instead. This lets us do test deploys of Go release candidates on some backends, without affecting all backends. Updates tailscale/corp#36382 Change-Id: I00dbde87b219b720be5ea142325c4711f101a364 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-01-23all: remove AUTHORS file and references to itWill Norris15-15/+15
This file was never truly necessary and has never actually been used in the history of Tailscale's open source releases. A Brief History of AUTHORS files --- The AUTHORS file was a pattern developed at Google, originally for Chromium, then adopted by Go and a bunch of other projects. The problem was that Chromium originally had a copyright line only recognizing Google as the copyright holder. Because Google (and most open source projects) do not require copyright assignemnt for contributions, each contributor maintains their copyright. Some large corporate contributors then tried to add their own name to the copyright line in the LICENSE file or in file headers. This quickly becomes unwieldy, and puts a tremendous burden on anyone building on top of Chromium, since the license requires that they keep all copyright lines intact. The compromise was to create an AUTHORS file that would list all of the copyright holders. The LICENSE file and source file headers would then include that list by reference, listing the copyright holder as "The Chromium Authors". This also become cumbersome to simply keep the file up to date with a high rate of new contributors. Plus it's not always obvious who the copyright holder is. Sometimes it is the individual making the contribution, but many times it may be their employer. There is no way for the proejct maintainer to know. Eventually, Google changed their policy to no longer recommend trying to keep the AUTHORS file up to date proactively, and instead to only add to it when requested: https://opensource.google/docs/releasing/authors. They are also clear that: > Adding contributors to the AUTHORS file is entirely within the > project's discretion and has no implications for copyright ownership. It was primarily added to appease a small number of large contributors that insisted that they be recognized as copyright holders (which was entirely their right to do). But it's not truly necessary, and not even the most accurate way of identifying contributors and/or copyright holders. In practice, we've never added anyone to our AUTHORS file. It only lists Tailscale, so it's not really serving any purpose. It also causes confusion because Tailscalars put the "Tailscale Inc & AUTHORS" header in other open source repos which don't actually have an AUTHORS file, so it's ambiguous what that means. Instead, we just acknowledge that the contributors to Tailscale (whoever they are) are copyright holders for their individual contributions. We also have the benefit of using the DCO (developercertificate.org) which provides some additional certification of their right to make the contribution. The source file changes were purely mechanical with: git ls-files | xargs sed -i -e 's/\(Tailscale Inc &\) AUTHORS/\1 contributors/g' Updates #cleanup Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris <will@tailscale.com>
2026-01-15tool/gocross: update gocross-wrapper.ps1 to use absolute path for resolving tarAaron Klotz1-1/+6
gocross-wrapper.ps1 is written to use the version of tar that ships with Windows; we want to avoid conflicts with any other tar on the PATH, such ones installed by MSYS and/or Cygwin. Updates https://github.com/tailscale/corp/issues/29940 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2025-12-02tool: bump binaryen wasm optimiser version 111 -> 125Tom Proctor1-1/+1
111 is 3 years old, and there have been a lot of speed improvements since then. We run wasm-opt twice as part of the CI wasm job, and it currently takes about 3 minutes each time. With 125, it takes ~40 seconds, a 4.5x speed-up. Updates #cleanup Change-Id: I671ae6cefa3997a23cdcab6871896b6b03e83a4f Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
2025-09-15tool/gocross: ensure child process error codes are propagated on non-UnixAaron Klotz2-2/+16
The Unix implementation of doExec propagates error codes by virtue of the fact that it does an execve; the replacement binary will return the exit code. On non-Unix, we need to simulate these semantics by checking for an ExitError and, when present, passing that value on to os.Exit. We also add error handling to the doExec call for the benefit of handling any errors where doExec fails before being able to execute the desired binary. Updates https://github.com/tailscale/corp/issues/29940 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2025-08-18tool/gocross: fix environment variable clearing in gocross-wrapper.ps1Aaron Klotz1-5/+11
The -Environment argument to Start-Process is essentially being treated as a delta; removing a particular variable from the argument's hash table does not indicate to delete. Instead we must set the value of each unwanted variable to $null. Updates https://github.com/tailscale/corp/issues/29940 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2025-08-18tool/gocross: don't set executable bits on PowerShell scriptAaron Klotz1-1/+1
Updates https://github.com/tailscale/corp/issues/29940 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2025-08-18tool, tool/gocross: update gocross to support building natively on Windows ↵Aaron Klotz8-7/+309
and add a PowerShell Core wrapper script gocross-wrapper.ps1 is a PowerShell core script that is essentially a straight port of gocross-wrapper.sh. It requires PowerShell 7.4, which is the latest LTS release of PSCore. Why use PowerShell Core instead of Windows PowerShell? Essentially because the former is much better to script with and is the edition that is currently maintained. Because we're using PowerShell Core, but many people will be running scripts from a machine that only has Windows PowerShell, go.cmd has been updated to prompt the user for PowerShell core installation if necessary. gocross-wrapper.sh has also been updated to utilize the PSCore script when running under cygwin or msys. gocross itself required a couple of updates: We update gocross to output the PowerShell Core wrapper alongside the bash wrapper, which will propagate the revised scripts to other repos as necessary. We also fix a couple of things in gocross that didn't work on Windows: we change the toolchain resolution code to use os.UserHomeDir instead of directly referencing the HOME environment variable, and we fix a bug in the way arguments were being passed into exec.Command on non-Unix systems. Updates https://github.com/tailscale/corp/issues/29940 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2025-06-26tool/gocross: remove GOROOT to ensure correct toolchain useJames Tucker1-0/+6
go(1) repsects GOROOT if set, but tool/go / gocross-wrapper.sh are explicitly intending to use our toolchain. We don't need to set GOROOT, just unset it, and then go(1) handles the rest. Updates tailscale/corp#26717 Signed-off-by: James Tucker <james@tailscale.com>
2025-06-22tool: rename go.ps1 to go-win.ps1 for cmd.exe+Powershell compatBrad Fitzpatrick2-1/+1
This tweaks the just-added ./tool/go.{cmd,ps1} port of ./tool/go for Windows. Otherwise in Windows Terminal in Powershell, running just ".\tool\go" picks up go.ps1 before go.cmd, which means execution gets denied without the cmd script's -ExecutionPolicy Bypass part letting it work. This makes it work in both cmd.exe and in Powershell. Updates tailscale/corp#28679 Change-Id: Iaf628a9fd6cb95670633b2dbdb635dfb8afaa006 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-20tool: add go toolchain wrapper for WindowsBrad Fitzpatrick2-0/+66
go.cmd lets you run just "./tool/go" on Windows the same as Linux/Darwin. The batch script (go.md) then just invokes PowerShell which is more powerful than batch. I wanted this while debugging Windows CI performance by reproducing slow tests on my local Windows laptop. Updates tailscale/corp#28679 Change-Id: I6e520968da3cef3032091c1c4f4237f663cefcab Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-17tool/gocross: put the synthetic GOROOTs outside of the tsgo directoryBrad Fitzpatrick2-1/+2
We aim to make the tsgo directories be read-only mounts on builders. But gocross was previously writing within the ~/.cache/tsgo/$HASH/ directories to make the synthetic GOROOT directories. This moves them to ~/.cache/tsgoroot/$HASH/ instead. Updates tailscale/corp#28679 Updates tailscale/corp#26717 Change-Id: I0d17730bbdce3d6374e79d49486826575d4690af Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-17.github/workflows: remove redundant work between staticcheck jobsBrad Fitzpatrick1-0/+206
Make the OS-specific staticcheck jobs only test stuff that's specialized for that OS. Do that using a new ./tool/listpkgs program that's a fancy 'go list' with more filtering flags. Updates tailscale/corp#28679 Change-Id: I790be2e3a0b42b105bd39f68c4b20e217a26de60 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-16tool/gocross: make gocross opt-in instead of opt-outBrad Fitzpatrick2-4/+34
gocross is not needed like it used to be, now that Go does version stamping itself. We keep it for the xcode and Windows builds for now. This simplifies things in the build, especially with upcoming build system updates. Updates tailscale/corp#28679 Updates tailscale/corp#26717 Change-Id: Ib4bebe6f50f3b9c3d6cd27323fca603e3dfb43cc Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-04-29tool/gocross: break circular dependency on tailcfg (#15829)Andrew Lytvynov2-7/+37
Instead of using the version package (which depends on tailcfg.CurrentCapabilityVersion) to get the git commit hash, do it directly using debug.BuildInfo. This way, when changing struct fields in tailcfg, we can successfully `go generate` it without compiler errors. Updates #9634 Updates https://github.com/tailscale/corp/issues/26717 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-04-15node.rev: bump to latest 22.x LTS release (#15652)Mario Minardi1-1/+1
Bump to latest 22.x LTS release for node as the 18.x line is going EOL this month. Updates https://github.com/tailscale/corp/issues/27737 Signed-off-by: Mario Minardi <mario@tailscale.com>
2024-10-28tool/gocross: remove trimpath from test buildsJames Tucker2-2/+5
trimpath can be inconvenient for IDEs and LSPs that do not always correctly handle module relative paths, and can also contribute to caching bugs taking effect. We rarely have a real need for trimpath of test produced binaries, so avoiding it should be a net win. Updates #2988 Signed-off-by: James Tucker <james@tailscale.com>
2024-10-17tool/gocross: add support for tvOS Simulator (#13847)Andrea Gottardo1-1/+5
Updates ENG-5321 Allow gocross to build a static library for the Apple TV Simulator. Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
2024-10-07tool/gocross: fix argument order to findBrad Fitzpatrick1-1/+1
To avoid warning: find: warning: you have specified the global option -maxdepth after the argument -type, but global options are not positional, i.e., -maxdepth affects tests specified before it as well as those specified after it. Please specify global options before other arguments. Fixes tailscale/corp#23689 Change-Id: I91ee260b295c552c0a029883d5e406733e081478 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-09-24tool/gocross: make gocross-wrapper.sh keep multiple Go toolchains aroundBrad Fitzpatrick2-35/+52
So it doesn't delete and re-pull when switching between branches. Updates tailscale/corp#17686 Change-Id: Iffb989781db42fcd673c5f03dbd0ce95972ede0f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-07-18{tool,client}: bump node version (#12840)Mario Minardi1-1/+1
Bump node version to latest lts on the 18.x line which is 18.20.4 at the time of writing. Updates https://github.com/tailscale/corp/issues/21741 Signed-off-by: Mario Minardi <mario@tailscale.com>
2024-07-10all: add test for package comments, fix, add comments as neededBrad Fitzpatrick1-1/+0
Updates #cleanup Change-Id: Ic4304e909d2131a95a38b26911f49e7b1729aaef Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-07-01tool/gocross: fix regression detecting when gocross needs rebuildBrad Fitzpatrick2-1/+28
Fix regression from #8108 (Mar 2023). Since that change, gocross has always been rebuilt on each run of ./tool/go (gocross-wrapper.sh), adding ~100ms. (Well, not totally rebuilt; cmd/go's caching still ends up working fine.) The problem was $gocross_path was just "gocross", which isn't in my path (and "." isn't in my $PATH, as it shouldn't be), so this line was always evaluating to the empty string: gotver="$($gocross_path gocross-version 2>/dev/null || echo '')" The ./gocross is fine because of the earlier `cd "$repo_root"` Updates tailscale/corp#21262 Updates tailscale/corp#21263 Change-Id: I80d25446097a3bb3423490c164352f0b569add5f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-05-22tool/gocross: add debug data to CGO buildsJames Tucker2-21/+21
We don't build a lot of tools with CGO, but we do build some, and it's extremely valuable for production services in particular to have symbols included - for perf and so on. I tested various other builds that could be affected negatively, in particular macOS/iOS, but those use split-dwarf already as part of their build path, and Android which does not currently use gocross. One binary which is normally 120mb only grew to 123mb, so the trade-off is definitely worthwhile in context. Updates tailscale/corp#20296 Signed-off-by: James Tucker <james@tailscale.com>
2024-05-16tool/gocross: treat empty GOOS/GOARCH as native GOOS/GOARCHJames Tucker2-2/+61
Tracking down the side effect can otherwise be a pain, for example on Darwin an empty GOOS resulted in CGO being implicitly disabled. The user intended for `export GOOS=` to act like unset, and while this is a misunderstanding, the main toolchain would treat it this way. Fixes tailscale/corp#20059 Signed-off-by: James Tucker <james@tailscale.com>
2024-03-19tool/gocross: add android autoflags (#11465)James Tucker2-0/+61
Updates tailscale/corp#18202 Signed-off-by: James Tucker <james@tailscale.com>
2024-02-16tool/gocross: pass flags for visionOS and visionOS Simulator (#11127)Andrea Gottardo1-0/+6
Adds logic in gocross to detect environment variables and pass the right flags so that the backend can be built with the visionOS SDK. Signed-off-by: Andrea Gottardo <andrea@tailscale.com> Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
2024-01-19tool/gocross: force use of our custom toolchainDavid Anderson2-0/+45
The new 'toolchain' directive in go.mod can sometimes force the use of an upstream toolchain against our wishes. Concurrently, some of our dependencies have added the 'toolchain' directive, which transitively adds it to our own go.mod. Force all uses of gocross to ignore that directive and stick to our customized toolchain. Updates #cleanup Signed-off-by: David Anderson <danderson@tailscale.com>
2023-12-20all: cleanup unused code, part 1 (#10661)Andrew Lytvynov1-25/+0
Run `staticcheck` with `U1000` to find unused code. This cleans up about a half of it. I'll do the other half separately to keep PRs manageable. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-12-19tool/gocross: make all Windows DLLs build with static libgccNick Khyl1-0/+1
In this commit, we have updated the build process for our Windows DLLs to link statically with libgcc, ensuring our Windows DLLs are self-contained. Updates #10617 Signed-off-by: Nick Khyl <nickk@tailscale.com>
2023-11-21ci: report test coverage to coveralls.ioPercy Wegmann1-1/+1
This records test coverage for the amd64 no race tests and uploads the results to coveralls.io. Updates #cleanup Signed-off-by: Ox Cart <ox.to.a.cart@gmail.com>
2023-10-30tool: download helm CLI (#9981)Irbe Krumina2-0/+70
Updates tailscale/tailscale#9222 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2023-10-10tool/gocross: handle VERSION file not foundMaisem Ali1-1/+4
Fixes #9734 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2023-10-05tool/gocross: don't absorb --tags flags passed to subcommandDavid Anderson2-5/+56
Fixes tailscale/corp#15117 Signed-off-by: David Anderson <danderson@tailscale.com>
2023-10-03Revert "tool/gocross: disable Linux static linking if GOCROSS_STATIC=0"Brad Fitzpatrick1-4/+0
This reverts commit 2c0f0ee759cc571db06b4615c900fc2e905498b1. Fixed by efac2cb8d672670b7 Updates tailscale/corp#15058 Updates tailscale/corp#13113
2023-10-03tool/gocross: merge user's build tags and implicitly added build tags togetherBrad Fitzpatrick2-1/+102
Fixes tailscale/corp#15058 Change-Id: I7e539b3324153077597f30385a2cb540846e8bdc Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-09-28tool/gocross: disable Linux static linking if GOCROSS_STATIC=0Brad Fitzpatrick1-0/+4
So we can experiment with disabling static linking for tests in CI to make GitHub Actions output less spammy. Updates tailscale/corp#13113 Signed-off-by: Brad Fitzpatrick <brad@danga.com>
2023-09-21release/dist, tool/gocross: add fake "windowsdll" GOOS to gocrossAaron Klotz1-1/+18
We're going to need to build a DLL containing custom actions for the installer. This patch adds the foundations of that capability to dist and gocross. Updates https://github.com/tailscale/corp/issues/13998 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2023-08-22release/dist: run yarn build before building CLIWill Norris1-1/+1
This builds the assets for the new web client as part of our release process. The path to the web client source is specified by the -web-client-root flag. This allows corp builds to first vendor the tailscale.com module, and then build the web client assets in the vendor directory. The default value for the -web-client-root flag is empty, so no assets are built by default. This is an update of the previously reverted 0fb95ec Updates tailscale/corp#13775 Signed-off-by: Will Norris <will@tailscale.com>
2023-08-21Revert "release/dist: run yarn build before building CLI"Will Norris1-1/+1
This caused breakages on the build server: synology/dsm7/x86_64: chdir /home/ubuntu/builds/2023-08-21T21-47-38Z-unstable-main-tagged-devices/0/client/web: no such file or directory synology/dsm7/i686: chdir /home/ubuntu/builds/2023-08-21T21-47-38Z-unstable-main-tagged-devices/0/client/web: no such file or directory synology/dsm7/armv8: chdir /home/ubuntu/builds/2023-08-21T21-47-38Z-unstable-main-tagged-devices/0/client/web: no such file or directory ... Reverting while I investigate. This reverts commit 0fb95ec07daa81d2a30a44af7d969249cec5bdc8. Signed-off-by: Will Norris <will@tailscale.com>
2023-08-21release/dist: run yarn build before building CLIWill Norris1-1/+1
This builds the assets for the new web client as part of our release process. These assets will soon be embedded into the cmd/tailscale binary, but are not actually done so yet. Updates tailscale/corp#13775 Signed-off-by: Will Norris <will@tailscale.com>
2023-08-21tool: force HTTP/1.1 in curl to prevent hang behind load balancerVal1-1/+6
When running in our github CI environment, curl sometimes hangs while closing the download from the nodejs.org server and fails with INTERNAL_ERROR. This is likely caused by CI running behind some kind of load balancer or proxy that handles HTTP/2 incorrectly in some minor way, so force curl to use HTTP 1.1. Updates #8988 Signed-off-by: Val <valerie@tailscale.com>
2023-08-10tool/{node,yarn}: update node and yarn toolsSonia Appasamy3-68/+92
Syncing these up with what we've got in corp. Updates tailscale/corp#13775 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2023-06-23tool/gocross: make gocross behave with pre-release Go toolchainsDavid Anderson1-14/+19
Also switch the wrapper script to use bash not posix shell. We now depend on bash elsewhere for saner behavior in esoteric areas, so might as well use it everywhere for consistency. Fixes #8425 Signed-off-by: David Anderson <danderson@tailscale.com>
2023-06-15tool/gocross: properly set simulator deployment target (#8355)Nick O'Neill1-1/+5
Fixes tailscale/corp#11876 Signed-off-by: Nick O'Neill <nick@tailscale.com>
2023-06-06tool/gocross: handle TVOS_DEPLOYMENT_TARGET (#8292)Andrea Gottardo1-0/+2
This is needed in order to build our network extension on tvOS. First step for #8282 Signed-off-by: Andrea Gottardo <andrea@tailscale.com> Co-authored-by: Andrea Gottardo <andrea@tailscale.com>
2023-05-29release/dist/synology: build synology packages with cmd/distDavid Anderson1-1/+3
Updates #8217 Signed-off-by: David Anderson <danderson@tailscale.com>
2023-05-09tool/gocross: fix incorrect relpath usage in bootstrap scriptDavid Anderson1-3/+3
The subshell in which gocross gets built cd's to the corp checkout dir near the top, so all future references to corp repository files should be simple relative paths, and not reference $repo_root. When $repo_root is an absolute path, it doesn't matter and everything works out, but on some OSes and shells and invocations, $repo_root is a completely relative path that is invalidated by the "cd". Fixes tailscale/corp#11183 Signed-off-by: David Anderson <danderson@tailscale.com>
2023-04-17various: add golangci-lint, fix issues (#7905)Andrew Dunham1-1/+1
This adds an initial and intentionally minimal configuration for golang-ci, fixes the issues reported, and adds a GitHub Action to check new pull requests against this linter configuration. Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I8f38fbc315836a19a094d0d3e986758b9313f163
2023-04-11tool/gocross: add ts_macext build tag for Xcode buildsMihai Parparita2-2/+6
It's used to control various opt-in functionality for the macOS and iOS apps, and was lost in the migration to gocross. Updates tailscale/tailscale#7769 Signed-off-by: Mihai Parparita <mihai@tailscale.com>