net/dns, feature/featuretags: make NetworkManager, systemd-resolved, and DBus modular

Saves 360 KB (19951800 => 19591352 on linux/amd64 --extra-small --box binary)

Updates #12614
Updates #17206

Change-Id: Iafd5b2536dd735111b447546cba335a7a64379ed
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-09-23 14:11:04 -07:00
committed by Brad Fitzpatrick
parent b54cdf9f38
commit b3e9a128af
12 changed files with 284 additions and 113 deletions
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_dbus
package buildfeatures
// HasDBus is whether the binary was built with support for modular feature "Linux DBus support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_dbus" build tag.
// It's a const so it can be used for dead code elimination.
const HasDBus = false
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_dbus
package buildfeatures
// HasDBus is whether the binary was built with support for modular feature "Linux DBus support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_dbus" build tag.
// It's a const so it can be used for dead code elimination.
const HasDBus = true
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_networkmanager
package buildfeatures
// HasNetworkManager is whether the binary was built with support for modular feature "Linux NetworkManager integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_networkmanager" build tag.
// It's a const so it can be used for dead code elimination.
const HasNetworkManager = false
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_networkmanager
package buildfeatures
// HasNetworkManager is whether the binary was built with support for modular feature "Linux NetworkManager integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_networkmanager" build tag.
// It's a const so it can be used for dead code elimination.
const HasNetworkManager = true
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_resolved
package buildfeatures
// HasResolved is whether the binary was built with support for modular feature "Linux systemd-resolved integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_resolved" build tag.
// It's a const so it can be used for dead code elimination.
const HasResolved = false
@@ -0,0 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_resolved
package buildfeatures
// HasResolved is whether the binary was built with support for modular feature "Linux systemd-resolved integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_resolved" build tag.
// It's a const so it can be used for dead code elimination.
const HasResolved = true
+20 -5
View File
@@ -97,6 +97,7 @@ var Features = map[FeatureTag]FeatureMeta{
"capture": {"Capture", "Packet capture", nil},
"cli": {"CLI", "embed the CLI into the tailscaled binary", nil},
"completion": {"Completion", "CLI shell completion", nil},
"dbus": {"DBus", "Linux DBus support", nil},
"debugeventbus": {"DebugEventBus", "eventbus debug support", nil},
"debugportmapper": {
Sym: "DebugPortMapper",
@@ -113,9 +114,19 @@ var Features = map[FeatureTag]FeatureMeta{
Desc: "Outbound localhost HTTP/SOCK5 proxy support",
Deps: []FeatureTag{"netstack"},
},
"portmapper": {"PortMapper", "NAT-PMP/PCP/UPnP port mapping support", nil},
"netstack": {"Netstack", "gVisor netstack (userspace networking) support (TODO; not yet omittable)", nil},
"portmapper": {"PortMapper", "NAT-PMP/PCP/UPnP port mapping support", nil},
"netstack": {"Netstack", "gVisor netstack (userspace networking) support (TODO; not yet omittable)", nil},
"networkmanager": {
Sym: "NetworkManager",
Desc: "Linux NetworkManager integration",
Deps: []FeatureTag{"dbus"},
},
"relayserver": {"RelayServer", "Relay server", nil},
"resolved": {
Sym: "Resolved",
Desc: "Linux systemd-resolved integration",
Deps: []FeatureTag{"dbus"},
},
"serve": {
Sym: "Serve",
Desc: "Serve and Funnel support",
@@ -124,10 +135,14 @@ var Features = map[FeatureTag]FeatureMeta{
"ssh": {
Sym: "SSH",
Desc: "Tailscale SSH support",
Deps: []FeatureTag{"netstack"},
Deps: []FeatureTag{"dbus", "netstack"},
},
"syspolicy": {"SystemPolicy", "System policy configuration (MDM) support", nil},
"systray": {
Sym: "SysTray",
Desc: "Linux system tray",
Deps: []FeatureTag{"dbus"},
},
"syspolicy": {"SystemPolicy", "System policy configuration (MDM) support", nil},
"systray": {"SysTray", "Linux system tray", nil},
"taildrop": {"Taildrop", "Taildrop (file sending) support", nil},
"tailnetlock": {"TailnetLock", "Tailnet Lock support", nil},
"tap": {"Tap", "Experimental Layer 2 (ethernet) support", nil},