From a538c2c740b33f94ea35ccbcda3404d68999de90 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 30 Nov 2026 07:49:35 +0000 Subject: [PATCH] cmd/tailcat: build on Plan 9 execSSH was only defined for unix and Windows, so the CLI didn't build for Plan 9 even though the library does. Use the Windows run-and-wait version on all non-unix platforms, and add plan9/386 to the CI cross job so it keeps building. Tested on a Plan 9 (386) VM as both a server and a client. --- .github/workflows/test.yml | 16 ++++++++++------ .../{ssh_exec_windows.go => ssh_exec_notunix.go} | 7 ++++--- 2 files changed, 14 insertions(+), 9 deletions(-) rename cmd/tailcat/{ssh_exec_windows.go => ssh_exec_notunix.go} (74%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 74f81bd9b..2dd5eea95 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -104,7 +104,10 @@ jobs: strategy: fail-fast: false matrix: - goos: [freebsd, openbsd] + include: + - {goos: freebsd, goarch: amd64} + - {goos: openbsd, goarch: amd64} + - {goos: plan9, goarch: '386'} runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -112,17 +115,18 @@ jobs: with: go-version-file: go.mod # README's install table lists the BSDs as supported by building - # from source, so check that they at least keep cross-compiling: - # everything untagged (the go install path), and cmd/tailcat with - # the release build tags that INSTALL.md recommends to packagers. + # from source, so check that they (and Plan 9) at least keep + # cross-compiling: everything untagged (the go install path), and + # cmd/tailcat with the release build tags that INSTALL.md + # recommends to packagers. - run: go build ./... env: GOOS: ${{ matrix.goos }} - GOARCH: amd64 + GOARCH: ${{ matrix.goarch }} - run: go build -o /dev/null -tags "$(cat build-tags.txt)" ./cmd/tailcat env: GOOS: ${{ matrix.goos }} - GOARCH: amd64 + GOARCH: ${{ matrix.goarch }} wasm: runs-on: ubuntu-latest steps: diff --git a/cmd/tailcat/ssh_exec_windows.go b/cmd/tailcat/ssh_exec_notunix.go similarity index 74% rename from cmd/tailcat/ssh_exec_windows.go rename to cmd/tailcat/ssh_exec_notunix.go index 8d7d93e2f..7a342daaa 100644 --- a/cmd/tailcat/ssh_exec_windows.go +++ b/cmd/tailcat/ssh_exec_notunix.go @@ -1,7 +1,7 @@ // Copyright (c) Tailscale Inc & contributors // SPDX-License-Identifier: BSD-3-Clause -//go:build windows && !ts_omit_ssh +//go:build !unix && !ts_omit_ssh package main @@ -12,8 +12,9 @@ import ( ) // execSSH runs the ssh client as a child process with inherited stdio, -// since Windows has no exec. On success it exits the whole process with -// ssh's exit status; it only returns on failure to run ssh at all. +// since Windows and Plan 9 have no exec. On success it exits the whole +// process with ssh's exit status; it only returns on failure to run ssh +// at all. func execSSH(sshExe string, argv []string) error { cmd := exec.Command(sshExe, argv[1:]...) cmd.Stdin = os.Stdin