brew: added TODO; revised README; added to formula caveats and test

Several tweaks:
  * added correct 'services start' msg via formula caveats method added
  * added 'tailscaled -version' to formula test block
  * added TODO file, extracted from author's private Tailscale brew TODO notes
  * added more brew notes to README

Signed-off-by: Mike Kramlich <groglogic@gmail.com>
This commit is contained in:
Mike Kramlich 2021-02-27 11:31:34 -07:00
parent 06116b566e
commit 9d3cb8780f
7 changed files with 91 additions and 5 deletions

35
TODO Normal file
View File

@ -0,0 +1,35 @@
TODO for Tailscale Mac Homebrew
This is a grab bag of ideas, issues, tasks, bugs and upgrades.
Ordered starting roughly with the most important or ideally next.
Not rigorous. Not limited to it. Subjective. Revised as we go.
-----------------------------------------------------------------
( ) in formula set version tag value properly
( ) in formula test block, assert versions reported by running installed tailscale{d} match expected
( ) in formula after built or installed, calc "shasum -a256" of the tailscale{d} and print it. helpful for security conscious folks afterward to ensure the binaries have not changed when unexpected (since they provide a VPN and run as root)
( ) for the tarball variants (most especially for tb-github), define the tarball's expected sha256 (the "want") in the proper way; dl-tarball-sha.sh uses only a placeholder technique for WIP
( ) correct or suppress this (default and automatic?) message by brew during install, because sudo required:
To have launchd start tailscale now and restart at login:
brew services start tailscale
( ) make scripts learn what tun value was picked by tailscaled (likely utun<NUM>)
(X) added correct message via formula caveat:
To have launchd start tailscale now and restart at boot:
sudo brew services start tailscale
( ) write/confirm test after reboot
( ) README: make it clear this is not an official/company Tailscale package
( ) retest the tarball versions, make sure they work right; esp the version stuff
( ) tailcfg Hostinfo.Package: control/controlclient/direct.go packageType(): either inject an ENVVAR, or have it decide by exe/path?
( ) fix that 1.5-vs-1.4.4 FIXME bug in the "global, tb-github" test case in install* (after log msg "checking exe location and diffs...")
( ) shrink the gap to ideal minimum (via refactors anywhere) between our formulae plists and Brad's daemon install plist, the latter being in: cmd/tailscaled/install_darwin.go
( ) ideally eliminate all TODOs from formula and scripts and README; or, just remove/satisfy as many as you can soon in upcoming sessions
( ) can pass extra args at brew install time, and inside your formula they are readable from ARGV.value. BEST/ONLY if they become stable/perm -- embedded in the installed-for-launchd-plist version
( ) print log location by formula when brew installed (ideally also the state file, sock and utun); via caveats method?
( ) discuss paths in README
( ) document or automate-away the $PWD path assumption deviance issue in make-test-source-tarball.sh
( ) stop script: TODO the installed plist is gone?
( ) stop script: TODO wipeout brew git checkout cache and/or add test for with-vs-without
( ) has the master-vs-main bug come back? since I twiddle the tag/branch/head stuff in formula to fix that other bug
( ) add test variants for other brew tool versions?
( ) in future: think about documenting the plist EnvironmentVariables key, as a way for user to set Tailscale-specific ENVVARS for tailscaled to read (like for debugging or testing)
( ) in future: maybe maybe play with the plist's ProcessType key, as a way to tune cpu/io and battery use

View File

@ -93,4 +93,10 @@ brew/serve-tarball.sh # ensure running in background; only needed for the local
brew/test.sh # this is very WIP, but generally the goal is if it exits 0 then the tests are green
```
A brew audit of a formula candidate can fail and its possible for it to 'brew install' and tailscale start successfully. A clean brew audit is only required (or strongly recommended) for submission to the Homebrew Core repository.
A "clean" brew doctor on the maintainer's host is not required, but its helpful to ensure no unnecessary problems arise with brew testing downstream. And helps ensure that no quirks of the maintainer's host cause the formula to "works on my box!" but then fail on other's machines. Majority of issues it reports will have no impact, but ideally it should be kept silent and exit 0.
A quirk of brew is that it likes to autoupdate under the hood, in reaction to (and not strictly needed to carry out) the user's express commands. This can cause unexpected delays (especially if bandwidth is your bottleneck) during package maintainer testing workflows. And makes it a challenge to achieve perfectly strict idempotency and deterministic installs. It appears to be a known trade-off call made by the Homebrew tool devs.
TODO(mkramlich): flesh out much further; topics: formula vs bottle, sudo vs not, prefix diffs, local vs public ts tap vs core, testing, submission and bumping

View File

@ -79,6 +79,14 @@ cat <<TEMPLATE4
(var/"lib/tailscale").mkpath
end
def caveats
<<~EOS
To have launchd start tailscale now and restart at boot:
sudo brew services start tailscale
NOTE: The caveat message below with 'restart at login' is incorrect, but we can't suppress it. Requires sudo.
EOS
end
plist_options manual: "sudo tailscaled --socket=#{HOMEBREW_PREFIX}/run/tailscale/tailscaled.sock --state=#{HOMEBREW_PREFIX}/lib/tailscale/tailscaled.state"
def plist
@ -116,7 +124,8 @@ cat <<TEMPLATE4
end
test do
system bin/"tailscale", "--version"
system bin/"tailscale", "version"
system bin/"tailscaled", "-version"
system bin/"tailscale", "netcheck"
end
end

View File

@ -58,6 +58,14 @@ class Tailscale < Formula
(var/"lib/tailscale").mkpath
end
def caveats
<<~EOS
To have launchd start tailscale now and restart at boot:
sudo brew services start tailscale
NOTE: The caveat message below with 'restart at login' is incorrect, but we can't suppress it. Requires sudo.
EOS
end
plist_options manual: "sudo tailscaled --socket=#{HOMEBREW_PREFIX}/run/tailscale/tailscaled.sock --state=#{HOMEBREW_PREFIX}/lib/tailscale/tailscaled.state"
def plist
@ -95,7 +103,8 @@ class Tailscale < Formula
end
test do
system bin/"tailscale", "--version"
system bin/"tailscale", "version"
system bin/"tailscaled", "-version"
system bin/"tailscale", "netcheck"
end
end

View File

@ -58,6 +58,14 @@ class Tailscale < Formula
(var/"lib/tailscale").mkpath
end
def caveats
<<~EOS
To have launchd start tailscale now and restart at boot:
sudo brew services start tailscale
NOTE: The caveat message below with 'restart at login' is incorrect, but we can't suppress it. Requires sudo.
EOS
end
plist_options manual: "sudo tailscaled --socket=#{HOMEBREW_PREFIX}/run/tailscale/tailscaled.sock --state=#{HOMEBREW_PREFIX}/lib/tailscale/tailscaled.state"
def plist
@ -95,7 +103,8 @@ class Tailscale < Formula
end
test do
system bin/"tailscale", "--version"
system bin/"tailscale", "version"
system bin/"tailscaled", "-version"
system bin/"tailscale", "netcheck"
end
end

View File

@ -57,6 +57,14 @@ class Tailscale < Formula
(var/"lib/tailscale").mkpath
end
def caveats
<<~EOS
To have launchd start tailscale now and restart at boot:
sudo brew services start tailscale
NOTE: The caveat message below with 'restart at login' is incorrect, but we can't suppress it. Requires sudo.
EOS
end
plist_options manual: "sudo tailscaled --socket=#{HOMEBREW_PREFIX}/run/tailscale/tailscaled.sock --state=#{HOMEBREW_PREFIX}/lib/tailscale/tailscaled.state"
def plist
@ -94,7 +102,8 @@ class Tailscale < Formula
end
test do
system bin/"tailscale", "--version"
system bin/"tailscale", "version"
system bin/"tailscaled", "-version"
system bin/"tailscale", "netcheck"
end
end

View File

@ -57,6 +57,14 @@ class Tailscale < Formula
(var/"lib/tailscale").mkpath
end
def caveats
<<~EOS
To have launchd start tailscale now and restart at boot:
sudo brew services start tailscale
NOTE: The caveat message below with 'restart at login' is incorrect, but we can't suppress it. Requires sudo.
EOS
end
plist_options manual: "sudo tailscaled --socket=#{HOMEBREW_PREFIX}/run/tailscale/tailscaled.sock --state=#{HOMEBREW_PREFIX}/lib/tailscale/tailscaled.state"
def plist
@ -94,7 +102,8 @@ class Tailscale < Formula
end
test do
system bin/"tailscale", "--version"
system bin/"tailscale", "version"
system bin/"tailscaled", "-version"
system bin/"tailscale", "netcheck"
end
end