tailscale/cmd
Brad Fitzpatrick 82cfea90ca
Some checks are pending
checklocks / checklocks (push) Waiting to run
CodeQL / Analyze (go) (push) Waiting to run
Dockerfile build / deploy (push) Waiting to run
test installer.sh / test (curl ca-certificates, kalilinux/kali-dev) (push) Waiting to run
test installer.sh / test (curl ca-certificates, kalilinux/kali-rolling) (push) Waiting to run
test installer.sh / test (curl, alpine:3.21) (push) Waiting to run
test installer.sh / test (curl, alpine:edge) (push) Waiting to run
test installer.sh / test (curl, alpine:latest) (push) Waiting to run
test installer.sh / test (curl, amazonlinux:latest) (push) Waiting to run
test installer.sh / test (curl, archlinux:latest) (push) Waiting to run
test installer.sh / test (curl, debian:oldstable-slim) (push) Waiting to run
test installer.sh / test (curl, debian:sid-slim) (push) Waiting to run
test installer.sh / test (curl, debian:stable-slim, 1.80.0) (push) Waiting to run
test installer.sh / test (curl, debian:testing-slim) (push) Waiting to run
test installer.sh / test (curl, elementary/docker:stable) (push) Waiting to run
test installer.sh / test (curl, elementary/docker:unstable) (push) Waiting to run
test installer.sh / test (curl, fedora:latest, 1.80.0) (push) Waiting to run
test installer.sh / test (curl, opensuse/leap:latest) (push) Waiting to run
test installer.sh / test (curl, opensuse/tumbleweed:latest) (push) Waiting to run
test installer.sh / test (curl, oraclelinux:8) (push) Waiting to run
test installer.sh / test (curl, oraclelinux:9) (push) Waiting to run
test installer.sh / test (curl, parrotsec/core:latest) (push) Waiting to run
test installer.sh / test (curl, rockylinux:8.7) (push) Waiting to run
test installer.sh / test (curl, rockylinux:9) (push) Waiting to run
test installer.sh / test (curl, ubuntu:20.04) (push) Waiting to run
test installer.sh / test (curl, ubuntu:22.04) (push) Waiting to run
test installer.sh / test (curl, ubuntu:24.04, 1.80.0) (push) Waiting to run
test installer.sh / test (wget, debian:oldstable-slim) (push) Waiting to run
test installer.sh / test (wget, debian:sid-slim) (push) Waiting to run
test installer.sh / notify-slack (push) Blocked by required conditions
natlab-basic / EasyEasy (push) Waiting to run
CI / gomod-cache (push) Waiting to run
CI / race-root-integration (1/4) (push) Blocked by required conditions
CI / race-root-integration (2/4) (push) Blocked by required conditions
CI / race-root-integration (3/4) (push) Blocked by required conditions
CI / race-root-integration (4/4) (push) Blocked by required conditions
CI / test (-race, amd64, 1/3) (push) Blocked by required conditions
CI / test (-race, amd64, 2/3) (push) Blocked by required conditions
CI / test (-race, amd64, 3/3) (push) Blocked by required conditions
CI / test (386) (push) Blocked by required conditions
CI / test (amd64) (push) Blocked by required conditions
CI / Windows (${{ matrix.name || matrix.shard}}) (win-bench, benchmarks) (push) Blocked by required conditions
CI / Windows (${{ matrix.name || matrix.shard}}) (win-shard-1-2, 1/2) (push) Blocked by required conditions
CI / Windows (${{ matrix.name || matrix.shard}}) (win-shard-2-2, 2/2) (push) Blocked by required conditions
CI / macos (push) Blocked by required conditions
CI / privileged (push) Blocked by required conditions
CI / cross (386, linux) (push) Blocked by required conditions
CI / cross (amd64, darwin) (push) Blocked by required conditions
CI / cross (amd64, freebsd) (push) Blocked by required conditions
CI / cross (amd64, openbsd) (push) Blocked by required conditions
CI / cross (amd64, windows) (push) Blocked by required conditions
CI / cross (arm, 5, linux) (push) Blocked by required conditions
CI / cross (arm, 7, linux) (push) Blocked by required conditions
CI / cross (arm64, darwin) (push) Blocked by required conditions
CI / cross (arm64, linux) (push) Blocked by required conditions
CI / cross (arm64, windows) (push) Blocked by required conditions
CI / cross (loong64, linux) (push) Blocked by required conditions
CI / ios (push) Blocked by required conditions
CI / crossmin (amd64, illumos) (push) Blocked by required conditions
CI / crossmin (amd64, plan9) (push) Blocked by required conditions
CI / crossmin (amd64, solaris) (push) Blocked by required conditions
CI / crossmin (ppc64, aix) (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / tailscale_go (push) Blocked by required conditions
CI / fuzz (push) Waiting to run
CI / depaware (push) Blocked by required conditions
CI / go_generate (push) Blocked by required conditions
CI / make_tidy (push) Blocked by required conditions
CI / licenses (push) Blocked by required conditions
CI / staticcheck (${{ matrix.name }}) (--with-tags-all=darwin, arm64, darwin, macOS) (push) Blocked by required conditions
CI / staticcheck (${{ matrix.name }}) (--with-tags-all=linux, amd64, linux, Linux) (push) Blocked by required conditions
CI / staticcheck (${{ matrix.name }}) (--with-tags-all=windows, amd64, windows, Windows) (push) Blocked by required conditions
CI / staticcheck (${{ matrix.name }}) (--without-tags-any=windows,darwin,linux --shard=1/4, amd64, linux, Portable (1/4)) (push) Blocked by required conditions
CI / staticcheck (${{ matrix.name }}) (--without-tags-any=windows,darwin,linux --shard=2/4, amd64, linux, Portable (2/4)) (push) Blocked by required conditions
CI / staticcheck (${{ matrix.name }}) (--without-tags-any=windows,darwin,linux --shard=3/4, amd64, linux, Portable (3/4)) (push) Blocked by required conditions
CI / staticcheck (${{ matrix.name }}) (--without-tags-any=windows,darwin,linux --shard=4/4, amd64, linux, Portable (4/4)) (push) Blocked by required conditions
CI / notify_slack (push) Blocked by required conditions
CI / merge_blocker (push) Blocked by required conditions
CI / check_mergeability_strict (push) Blocked by required conditions
CI / check_mergeability (push) Blocked by required conditions
tailscale.com/cmd/vet / vet (push) Waiting to run
all: fix JSON serialization under Go 1.27's finalized encoding/json/v2
Go 1.27 enables GOEXPERIMENT=jsonv2 by default: encoding/json is now
backed by the json/v2 machinery, and github.com/go-json-experiment/json
compiles as a thin alias of the standard library's encoding/json/v2.
Several tag options and behaviors we relied on did not make the cut for
the final Go 1.27 API, breaking tailscaled at runtime and four packages'
tests. This change adapts to the final API while keeping the wire format
byte-for-byte identical on all Go versions.

First, the `format` tag option was demoted to experimental. Its mere
presence in a struct tag now makes marshaling and unmarshaling fail at
runtime. tailcfg.SSHAction.SessionDuration had `format:nano` (added in
a2dc517d7 to pin the v1 representation), so on Go 1.27 any netmap
containing an SSH policy failed to decode, breaking every PollNetMap.
Remove the option here and in net/speedtest; time.Duration still
marshals as int64 nanoseconds under encoding/json on all Go versions
(Go 1.27's v1 mode sets FormatDurationAsNano by default), so old
clients and servers are unaffected. Add a regression test locking in
the exact wire format.

Consequently, invert the cmd/vet jsontags rule: it previously required
an explicit `format` tag on time.Duration fields, which is now exactly
wrong. It now rejects any `format` tag option, which would have caught
this bug in CI.

Second, the `inline` tag option was renamed to `embed`. The standard
library silently ignores `inline`, while the pinned go-json-experiment
module (used on Go 1.26) only knows `inline`. Specify both options in
types/prefs and logtail; each implementation ignores the option it does
not know, producing identical output. Drop `inline` once we require
Go 1.27.

Third, encoding/json (v1) now dispatches to MarshalJSONTo and
UnmarshalJSONFrom methods and its v1 options flow into nested
jsonv2.MarshalEncode calls. Types whose v1 methods deliberately
routed through jsonv2 for v2 semantics (types/opt.Value, the
types/prefs preference types) would silently change wire format
(e.g. nil slices becoming null). Pin jsonv2.DefaultOptionsV2 in
their jsonv2 methods so the representation is the same regardless
of the entry point.

Finally, json.Marshal costs one more allocation under Go 1.27,
tripping the types/logger.AsJSON alloc test. Switch its fmt.Formatter
to jsonv2.MarshalWrite with explicit v1 options, which writes directly
to the fmt.State: one allocation on both toolchains with unchanged
output. Depaware files pick up the go-json-experiment/json/v1 options
shim as a new dependency of types/logger.

With this change, go test ./... passes with both Go 1.26.5 and
go1.27rc2.

Updates #20220
Fixes #20528
Fixes #20254

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I694c7d57fd81e55a579c579e9be10032bca569d4
2026-07-19 09:58:50 -07:00
..
addlicense all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
build-webclient all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
checkmetrics all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
cigocacher cmd/cigocacher: make --stats flag best-effort (#18761) 2026-02-19 16:06:12 +00:00
cloner cmd: apply go fix 2026-07-10 14:26:11 -07:00
connector-gen all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
containerboot util/def,cmd/containerboot: add LookupEnv, simplify env parsing (#20277) 2026-07-17 18:32:52 -07:00
derper all: fix JSON serialization under Go 1.27's finalized encoding/json/v2 2026-07-19 09:58:50 -07:00
derpprobe all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
dist all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
distsign all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
fbstatus cmd/tailscale: add 'configure pve-appliance' to make Proxmox VM of appliance 2026-07-07 13:12:13 -07:00
featuretags all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
get-authkey all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
gitops-pusher tsnet: make workload identity federation opt-in 2026-05-06 18:43:45 -07:00
hello cmd/hello: split css and js into separate files (#19771) 2026-05-15 09:37:22 -07:00
jsonimports all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
k8s-nameserver all: don't repeat the the word "the" unnecessarily 2026-06-18 16:32:08 +01:00
k8s-operator all: fix JSON serialization under Go 1.27's finalized encoding/json/v2 2026-07-19 09:58:50 -07:00
k8s-proxy cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
mkmanifest all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
mkpkg all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
mkversion all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
nardump tool/updateflakes, cmd/nardump: replace update-flake.sh with Go tool 2026-04-28 10:18:32 -07:00
natc cmd: apply go fix 2026-07-10 14:26:11 -07:00
netlogfmt cmd/tailscale/cli: fix time in tailscale routecheck (#19956) 2026-06-01 16:12:08 -07:00
nginx-auth all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
omitsize all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
pgproxy cmd/pgproxy: fix client TLS handshake timeout 2026-05-11 11:12:11 -07:00
printdep cmd/printdep: add --next flag to use rc Go build hash instead 2026-01-27 14:49:56 -08:00
proxy-test-server all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
proxy-to-grafana all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
sniproxy all: migrate code off Notify.NetMap to Notify.SelfChange 2026-05-01 06:51:40 -07:00
speedtest all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
ssh-auth-none-demo cmd/ssh-auth-none-demo: update SSH demo a bit 2026-06-03 19:36:19 -07:00
stunc all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
stund all: fix JSON serialization under Go 1.27's finalized encoding/json/v2 2026-07-19 09:58:50 -07:00
stunstamp all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
sync-containers all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
systray client/systray: support several different color themes 2026-04-27 18:54:14 -07:00
tailscale all: fix JSON serialization under Go 1.27's finalized encoding/json/v2 2026-07-19 09:58:50 -07:00
tailscaled all: fix JSON serialization under Go 1.27's finalized encoding/json/v2 2026-07-19 09:58:50 -07:00
testcontrol all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
testwrapper cmd/testwrapper: add a max retry time across all failures (#20453) 2026-07-14 13:44:21 +01:00
tl-longchain all: rename NetworkLock functions/types to TailnetLock 2026-06-08 13:14:28 +01:00
tsconnect cmd/tsconnect/wasm: don't return non-nil net.Conn interface on dial error 2026-07-19 06:48:06 -07:00
tsidp all: fix JSON serialization under Go 1.27's finalized encoding/json/v2 2026-07-19 09:58:50 -07:00
tsnet-proxy cmd/tsnet-proxy: add tsnet-based port proxy tool (#19468) 2026-04-22 13:34:18 -04:00
tsp cmd: apply go fix 2026-07-10 14:26:11 -07:00
tsshd all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
tta tstest, cmd/tta: add Tailscale SSH end-to-end VM test 2026-07-13 15:04:51 -07:00
vet all: fix JSON serialization under Go 1.27's finalized encoding/json/v2 2026-07-19 09:58:50 -07:00
viewer cmd: apply go fix 2026-07-10 14:26:11 -07:00
vnet gokrazy, tstest, cmd/vnet: switch amd64 kernel to gokrazy/kernel.amd64 2026-07-15 11:45:02 -04:00
xdpderper all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00