cmd/tailscale,feature/featuretags: make webbrowser and colorable deps omittable

Add new "webbrowser" and "colorable" feature tags so that the
github.com/toqueteos/webbrowser and mattn/go-colorable packages
can be excluded from minbox builds.

Updates #12614

Change-Id: Iabd38b242f5a56aa10ef2050113785283f4e1fe8
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2026-02-08 04:46:09 +00:00
committed by Brad Fitzpatrick
parent 5eaaf9786b
commit a3215f1f9d
12 changed files with 119 additions and 23 deletions
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_colorable
package buildfeatures
// HasColorable is whether the binary was built with support for modular feature "Colorized terminal output".
// Specifically, it's whether the binary was NOT built with the "ts_omit_colorable" build tag.
// It's a const so it can be used for dead code elimination.
const HasColorable = false
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_colorable
package buildfeatures
// HasColorable is whether the binary was built with support for modular feature "Colorized terminal output".
// Specifically, it's whether the binary was NOT built with the "ts_omit_colorable" build tag.
// It's a const so it can be used for dead code elimination.
const HasColorable = true
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_webbrowser
package buildfeatures
// HasWebBrowser is whether the binary was built with support for modular feature "Open URLs in the user's web browser".
// Specifically, it's whether the binary was NOT built with the "ts_omit_webbrowser" build tag.
// It's a const so it can be used for dead code elimination.
const HasWebBrowser = false
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_webbrowser
package buildfeatures
// HasWebBrowser is whether the binary was built with support for modular feature "Open URLs in the user's web browser".
// Specifically, it's whether the binary was NOT built with the "ts_omit_webbrowser" build tag.
// It's a const so it can be used for dead code elimination.
const HasWebBrowser = true
+7 -2
View File
@@ -84,7 +84,7 @@ type FeatureMeta struct {
Deps []FeatureTag // other features this feature requires
// ImplementationDetail is whether the feature is an internal implementation
// detail. That is, it's not something a user wuold care about having or not
// detail. That is, it's not something a user would care about having or not
// having, but we'd like to able to omit from builds if no other
// user-visible features depend on it.
ImplementationDetail bool
@@ -130,6 +130,7 @@ var Features = map[FeatureTag]FeatureMeta{
"captiveportal": {Sym: "CaptivePortal", Desc: "Captive portal detection"},
"capture": {Sym: "Capture", Desc: "Packet capture"},
"cli": {Sym: "CLI", Desc: "embed the CLI into the tailscaled binary"},
"colorable": {Sym: "Colorable", Desc: "Colorized terminal output"},
"cliconndiag": {Sym: "CLIConnDiag", Desc: "CLI connection error diagnostics"},
"clientmetrics": {Sym: "ClientMetrics", Desc: "Client metrics support"},
"clientupdate": {
@@ -256,7 +257,7 @@ var Features = map[FeatureTag]FeatureMeta{
"systray": {
Sym: "SysTray",
Desc: "Linux system tray",
Deps: []FeatureTag{"dbus"},
Deps: []FeatureTag{"dbus", "webbrowser"},
},
"taildrop": {
Sym: "Taildrop",
@@ -290,6 +291,10 @@ var Features = map[FeatureTag]FeatureMeta{
Desc: "Usermetrics (documented, stable) metrics support",
},
"wakeonlan": {Sym: "WakeOnLAN", Desc: "Wake-on-LAN support"},
"webbrowser": {
Sym: "WebBrowser",
Desc: "Open URLs in the user's web browser",
},
"webclient": {
Sym: "WebClient", Desc: "Web client support",
Deps: []FeatureTag{"serve"},