summaryrefslogtreecommitdiffhomepage
path: root/version
AgeCommit message (Collapse)AuthorFilesLines
2026-04-24version: use debug.ReadBuildInfo in CmdName on non-WindowsBrad Fitzpatrick2-0/+30
CmdName was re-opening the running executable and scanning it in 64KiB chunks for the Go modinfo markers on every call. The same modinfo is already parsed at startup and exposed via runtime/debug.ReadBuildInfo, so prefer that on non-Windows. Windows still takes the scanning path because its GUI-binary override keys off the on-disk executable name. benchstat of BenchmarkCmdName (Linux, before vs after): goos: linux goarch: amd64 pkg: tailscale.com/version cpu: Intel(R) Xeon(R) 6975P-C │ /tmp/old.txt │ /tmp/new.txt │ │ sec/op │ sec/op vs base │ CmdName-16 556045.5n ± 1% 825.6n ± 1% -99.85% (p=0.000 n=10) │ /tmp/old.txt │ /tmp/new.txt │ │ B/op │ B/op vs base │ CmdName-16 64.587Ki ± 0% 1.156Ki ± 0% -98.21% (p=0.000 n=10) │ /tmp/old.txt │ /tmp/new.txt │ │ allocs/op │ allocs/op vs base │ CmdName-16 8.000 ± 0% 7.000 ± 0% -12.50% (p=0.000 n=10) Fixes #19486 Change-Id: I925c5e28b64815a602459beb6c8dab8779339a6c Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-04-13version: show tailscale/go toolchain git hash in version outputBrad Fitzpatrick4-13/+69
When built with the Tailscale Go toolchain, include the toolchain's git revision in the version output. The non-JSON output shows the first 10 hex digits: go version: go1.26.2 (tailscale/go dfe2a5fd8e) The JSON output includes the full hash as "tailscaleGoGitHash", or omits the field when not using tsgo. The toolchain rev is read via a separate sync.OnceValue rather than piggybacking on getEmbeddedInfo, because that function discards all data when VCS fields are absent (e.g. in test binaries), while the tailscale.toolchain.rev setting is still present. Also add a CI-only test verifying tailscaleToolchainRev is non-empty when built with the tailscale_go build tag. Fixes #19374 Change-Id: Ied0b16d7aead5471d8c614c30cba8b0dcf80c691 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-04-02version: parse Void Linux version stringsAlex Chan2-0/+8
We have ~2.5k nodes running Void Linux, which report a version string like `1.96.2_1 (Void Linux)`. Previously these versions would fail to parse, because we only expect a hyphen and `extraCommits` after the major/minor/patch numbers. Fix the version parsing logic to handle this case. Updates #19148 Change-Id: Ica4f172d080af266af7f0d69bb31483a095cd199 Signed-off-by: Alex Chan <alexc@tailscale.com>
2026-04-01go.toolchain.rev, version: bump Tailscale Go, add IsTailscaleGoBrad Fitzpatrick3-0/+20
Reports whether the current binary was built with Tailscale's custom Go toolchain (the "tailscale_go" build tag). For https://github.com/tailscale/go/pull/165 Updates tailscale/corp#39430 Change-Id: Ica437582ddf55d7df48b1453bad03ce14b1c0949 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-03-06all: use Go 1.26 things, run most gofix modernizersBrad Fitzpatrick2-2/+2
I omitted a lot of the min/max modernizers because they didn't result in more clear code. Some of it's older "for x := range 123". Also: errors.AsType, any, fmt.Appendf, etc. Updates #18682 Change-Id: I83a451577f33877f962766a5b65ce86f7696471c Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-03-04go.toolchain.branch: switch to Go 1.26Brad Fitzpatrick1-1/+1
Updates #18682 Change-Id: I1eadfab950e55d004484af880a5d8df6893e85e8 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-01-23all: remove AUTHORS file and references to itWill Norris19-19/+19
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-20version: add support for reporting the mac variant from tailscale --version ↵Jonathan Nobels1-7/+74
(#18462) fixes tailscale/corp#27182 tailscale version --json now includes an osVariant field that will report one of macsys, appstore or darwin. We can extend this to other platforms where tailscaled can have multiple personalities. This also adds the concept of a platform-specific callback for querying an explicit application identifier. On Apple, we can use CFBundleGetIdentifier(mainBundle) to get the bundle identifier via cgo. This removes all the ambiguity and lets us remove other less direct methods (like env vars, locations, etc). Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
2025-10-10clientupdate, util/osshare, util/winutil, version: improve Windows GUI ↵Aaron Klotz4-7/+69
filename resolution and WinUI build awareness On Windows arm64 we are going to need to ship two different GUI builds; one for Win10 (GOARCH=386) and one for Win11 (GOARCH=amd64, tags += winui). Due to quirks in MSI packaging, they cannot both share the same filename. This requires some fixes in places where we have hardcoded "tailscale-ipn" as the GUI filename. We also do some cleanup in clientupdate to ensure that autoupdates will continue to work correctly with the temporary "-winui" package variant. Fixes #17480 Updates https://github.com/tailscale/corp/issues/29940 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2025-07-11cmd/tailscale/cli: add "configure jetkvm" subcommandBrad Fitzpatrick1-1/+10
To write the init script. And fix the JetKVM detection to work during early boot while the filesystem and modules are still being loaded; it wasn't being detected on early boot and then tailscaled was failing to start because it didn't know it was on JetKVM and didn't modprobe tun. Updates #16524 Change-Id: I0524ca3abd7ace68a69af96aab4175d32c07e116 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-07-10all: detect JetKVM and specialize a handful of things for itBrad Fitzpatrick1-0/+3
Updates #16524 Change-Id: I183428de8c65d7155d82979d2d33f031c22e3331 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-16tool/gocross: make gocross opt-in instead of opt-outBrad Fitzpatrick1-0/+1
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-03-11safesocket, version: fix safesocket_darwin behavior for cmd/tailscale (#15275)Jonathan Nobels1-16/+26
fixes tailscale/tailscale#15269 Fixes the various CLIs for all of the various flavors of tailscaled on darwin. The logic in version is updated so that we have methods that return true only for the actual GUI app (which can beCLI) and the order of the checks in localTCPPortAndTokenDarwin are corrected so that the logic works with all 5 combinations of CLI and tailscaled. Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
2025-01-12util/uniq,types/lazy,*: delete code that's now in Go stdBrad Fitzpatrick3-5/+6
sync.OnceValue and slices.Compact were both added in Go 1.21. cmp.Or was added in Go 1.22. Updates #8632 Updates #11058 Change-Id: I89ba4c404f40188e1f8a9566c8aaa049be377754 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-01-03wgengine/router: refactor udm-pro into broader ubnt supportJason Barnett1-46/+7
Fixes #14453 Signed-off-by: Jason Barnett <J@sonBarnett.com>
2024-12-21wgengine/router: add ip rules for unifi udm-proJason Barnett1-0/+46
Fixes: #4038 Signed-off-by: Jason Barnett <J@sonBarnett.com>
2024-11-19version: fix earlier test/wording mistakesBrad Fitzpatrick2-2/+1
Updates #14069 Change-Id: I1d2fd8a8ab6591af11bfb83748b94342a8ac718f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-11-19version: validate Long format on Android buildsBrad Fitzpatrick3-0/+85
Updates #14069 Change-Id: I134a90db561dacc4b1c1c66ccadac135b5d64cf3 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-11-05types/result, util/lineiter: add package for a result type, use itBrad Fitzpatrick1-10/+10
This adds a new generic result type (motivated by golang/go#70084) to try it out, and uses it in the new lineutil package (replacing the old lineread package), changing that package to return iterators: sometimes over []byte (when the input is all in memory), but sometimes iterators over results of []byte, if errors might happen at runtime. Updates #12912 Updates golang/go#70084 Change-Id: Iacdc1070e661b5fb163907b1e8b07ac7d51d3f83 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-09-24{release,version}: add DSM7.2 specific synology builds (#13405)Mario Minardi1-4/+5
Add separate builds for DSM7.2 for synology so that we can encode separate versioning information in the INFO file to distinguish between the two. Fixes https://github.com/tailscale/corp/issues/22908 Signed-off-by: Mario Minardi <mario@tailscale.com>
2024-07-01version/mkversion: allow env config of oss git cache dirBrad Fitzpatrick1-4/+7
Updates tailscale/corp#21262 Change-Id: I80bd880b53f6d851c15479f39fad62b25f1095f1 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-05-16version: add GitCommitTime to MetaMaisem Ali2-0/+6
Updates tailscale/corp#1297 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2024-05-16Revert "version: add Info func to expose EmbeddedInfo"Maisem Ali1-32/+21
This reverts commit e3dec086e63165221c21a59eb2a53dfa543e9ef5. Going to reuse Meta instead as that is already exported. Updates tailscale/corp#1297 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2024-05-15version: add Info func to expose EmbeddedInfoMaisem Ali1-21/+32
To be used to in a different repo. Updates tailscale/corp#1297 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2024-05-14version: fix macOS uploads by increasing build number prefix (#12134)Andrea Gottardo2-3/+6
Fixes tailscale/corp#19979 A build with version number 275 was uploaded to the App Store without bumping OSS first. The presence of that build is causing any 274.* build to be rejected. To address this, added -1 to the year component, which means new builds will use the 275.* prefix. Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
2024-04-16all: use Go 1.22 range-over-intBrad Fitzpatrick2-2/+2
Updates #11058 Change-Id: I35e7ef9b90e83cac04ca93fd964ad00ed5b48430 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-04-07net/tsdial: partially fix "tailscale nc" (UserDial) on macOSBrad Fitzpatrick1-0/+9
At least in the case of dialing a Tailscale IP. Updates #4529 Change-Id: I9fd667d088a14aec4a56e23aabc2b1ffddafa3fe Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-03-19version/prop: remove IsMacAppSandboxEnabled (#11461)Andrea Gottardo1-28/+5
Fixes tailscale/corp#18441 For a few days, IsMacAppStore() has been returning `false` on App Store builds (IPN-macOS target in Xcode). I regressed this in #11369 by introducing logic to detect the sandbox by checking for the APP_SANDBOX_CONTAINER_ID environment variable. I thought that was a more robust approach instead of checking the name of the executable. However, it appears that on recent macOS versions this environment variable is no longer getting set, so we should go back to the previous logic that checks for the executable path, or HOME containing references to macsys. This PR also adds additional checks to the logic by also checking XPC_SERVICE_NAME in addition to HOME where possible. That environment variable is set inside the network extension, either macos or macsys and is good to look at if for any reason HOME is not set.
2024-03-14version,cli,safesocket: detect non-sandboxed macOS GUI (#11369)Andrea Gottardo1-2/+48
Updates ENG-2848 We can safely disable the App Sandbox for our macsys GUI, allowing us to use `tailscale ssh` and do a few other things that we've wanted to do for a while. This PR: - allows Tailscale SSH to be used from the macsys GUI binary when called from a CLI - tweaks the detection of client variants in prop.go, with new functions `IsMacSys()`, `IsMacSysApp()` and `IsMacAppSandboxEnabled()` Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
2024-03-08version/mkversion: enforce synology versions within int32 rangeSonia Appasamy1-2/+7
Synology requires version numbers are within int32 range. This change updates the version logic to keep things closer within the range, and errors on building when the range is exceeded. Updates #cleanup Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2024-01-10version/mkversion: allow version override with $TS_VERSION_OVERRIDE (#10799)Andrew Lytvynov1-0/+7
This is useful to build local binaries with custom versions to test version-specific logic (like updates). Updates https://github.com/tailscale/corp/issues/16703 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-12-20all: cleanup unused code, part 1 (#10661)Andrew Lytvynov2-21/+13
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-10-24cmd/tailscale/cli: set Sparkle auto-update on macsys (#9952)Andrew Lytvynov1-0/+9
On `tailscale set --auto-update`, set the Sparkle plist option for it. Also make macsys report not supporting auto-updates over c2n, since they will be triggered by Sparkle locally. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-20clientupdate: change Mac App Store support (#9891)Andrew Lytvynov1-11/+16
In the sandboxed app from the app store, we cannot check `/Library/Preferences/com.apple.commerce.plist` or run `softwareupdate`. We can at most print a helpful message and open the app store page. Also, reenable macsys update function to mark it as supporting c2n updates. macsys support in `tailscale update` was fixed. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-07-24cmd/tailscale/cli,version/distro: update support for Alpine (#8701)Andrew Lytvynov1-0/+3
Similar to Arch support, use the latest version info from the official `apk` repo and don't offer explicit track or version switching. Add detection for Alpine Linux in version/distro along the way. Updates #6995 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-07-06version: fix tvOS network extension bundle identifier (#8545)Andrea Gottardo1-1/+1
Fixes #8544 and updates #8282. Signed-off-by: Andrea Gottardo <andrea@tailscale.com>
2023-06-07version: detect tvOS by checking XPC_SERVICE_NAME (#8295)Andrea Gottardo1-0/+16
Another change needed working towards #8282. Updates https://github.com/tailscale/tailscale/issues/8282 Signed-off-by: Andrea Gottardo <andrea@tailscale.com>
2023-05-29release/dist/synology: build synology packages with cmd/distDavid Anderson1-0/+8
Updates #8217 Signed-off-by: David Anderson <danderson@tailscale.com>
2023-05-07version: properly handle vcs.modified when it's "false"Chenyang Gao1-1/+1
Current code will set the "dirty" field of VersionInfo always "true" if vcs.modified flag is there. No matter whether the flag is "true" or "false". It will make sense to set this field due to vcs.modified value, not only the existence of the key. Signed-off-by: Chenyang Gao <gps949@outlook.com>
2023-05-04various: add detection and Taildrop for UnraidDerek Kaser1-0/+3
Updates tailscale/tailscale#8025 Signed-off-by: Derek Kaser <derek.kaser@gmail.com>
2023-03-14version/mkversion: don't break on tagged go.mod entriesDavid Anderson1-11/+13
I thought our versioning scheme would make go.mod include a commit hash even on stable builds. I was wrong. Fortunately, the rest of this code wants anything that 'git rev-parse' understands (to convert it into a full git hash), and tags qualify. Signed-off-by: David Anderson <danderson@tailscale.com>
2023-03-02version/distro,wgengine/router: raise WSL eth0 MTU when too lowJames Tucker1-0/+10
WSL has started to set the eth0 default route interface default to 1280 MTU, which is too low to carry 1280 byte packets from tailscale0 once wrapped in WireGuard. The change down to 1280 is very likely smaller than necessary for almost all users. We can not easily determine the ideal MTU, but if all the preconditions match, we raise the MTU to 1360, which is just enough for Tailscale traffic to work. Updates #4833 Updates #7346 Signed-off-by: James Tucker <james@tailscale.com>
2023-02-18version/mkversion: allow collecting version only from this repoDavid Anderson2-207/+123
With this change, you can collect version info from either a git checkout of the tailscale.com Go module (this repo), or a git checkout of a repo that imports the tailscale.com Go module. Signed-off-by: David Anderson <danderson@tailscale.com>
2023-02-18version/mkversion: add exports for major/minor/patchDavid Anderson2-0/+36
build_dist.sh needs the minor version by itself, for some reason. Signed-off-by: David Anderson <danderson@tailscale.com>
2023-02-18version/mkversion: add documentation, rename internal terminologyDavid Anderson2-98/+129
Signed-off-by: David Anderson <danderson@tailscale.com>
2023-02-18version/mkversion: open-source version generation logicDavid Anderson2-0/+632
In preparation for moving more of the release building here too. Signed-off-by: David Anderson <danderson@tailscale.com>
2023-02-11version: fix version output for "go run"David Anderson1-0/+5
Before (note attempted use of absent date and commit hash): "short": "1.37.0-dev", "long": "1.37.0-dev-t", After: "short": "1.37.0-ERR-BuildInfo", "long": "1.37.0-ERR-BuildInfo", Signed-off-by: David Anderson <danderson@tailscale.com>
2023-02-11version: make all exported funcs compile-time constant or lazyDavid Anderson5-182/+236
Signed-off-by: David Anderson <danderson@tailscale.com>
2023-02-11version: unexport all vars, turn Short/Long into funcsDavid Anderson3-27/+35
The other formerly exported values aren't used outside the package, so just unexport them. Signed-off-by: David Anderson <danderson@tailscale.com>
2023-02-10version: undo previous "optimization", do more work lazilyDavid Anderson2-119/+137
Commit 59c254579ea63c669ffb3b5031e51288422c5194 moved a lot of work from functions that could be eliminated at compile time (because tests against runtime.GOOS are compile-time constant), into code that must always run before main(). So, revert that, and instead optimize the package only by moving the remaining string processing code behind sync.Onces. Signed-off-by: David Anderson <danderson@tailscale.com>