From 1da78d871816387d21003f621b81ef507ae0c673 Mon Sep 17 00:00:00 2001 From: Andrew Lytvynov Date: Wed, 9 Apr 2025 14:33:52 -0700 Subject: [PATCH] build_dist.sh: allow settings custom build tags (#15589) Default tags to `$TAGS` if set, so that people can choose arbitrary subsets of features. Updates #12614 Signed-off-by: Andrew Lytvynov --- build_dist.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build_dist.sh b/build_dist.sh index ccd4ac8b1..c01670398 100755 --- a/build_dist.sh +++ b/build_dist.sh @@ -28,18 +28,26 @@ EOF exit 0 fi -tags="" +tags="${TAGS:-}" ldflags="-X tailscale.com/version.longStamp=${VERSION_LONG} -X tailscale.com/version.shortStamp=${VERSION_SHORT}" # build_dist.sh arguments must precede go build arguments. while [ "$#" -gt 1 ]; do case "$1" in --extra-small) + if [ ! -z "${TAGS:-}" ]; then + echo "set either --extra-small or \$TAGS, but not both" + exit 1 + fi shift ldflags="$ldflags -w -s" tags="${tags:+$tags,}ts_omit_aws,ts_omit_bird,ts_omit_tap,ts_omit_kube,ts_omit_completion,ts_omit_ssh,ts_omit_wakeonlan,ts_omit_capture" ;; --box) + if [ ! -z "${TAGS:-}" ]; then + echo "set either --box or \$TAGS, but not both" + exit 1 + fi shift tags="${tags:+$tags,}ts_include_cli" ;;