diff --git a/tool/gocross/autoflags.go b/tool/gocross/autoflags.go index f0984c943..0fd46c4fa 100644 --- a/tool/gocross/autoflags.go +++ b/tool/gocross/autoflags.go @@ -102,6 +102,10 @@ func autoflagsForTest(argv []string, env *Environment, goroot, nativeGOOS, nativ cgo = nativeGOOS == "darwin" tags = append(tags, "omitidna", "omitpemdecrypt") if env.IsSet("XCODE_VERSION_ACTUAL") { + // If we're building via Xcode, we must be making the extension + // version (as opposed to tailscaled on Mac). + tags = append(tags, "ts_macext") + var xcodeFlags []string // Minimum OS version being targeted, results in // e.g. -mmacosx-version-min=11.3, -miphoneos-version-min=15.0 diff --git a/tool/gocross/autoflags_test.go b/tool/gocross/autoflags_test.go index 3ed1fa7ea..c8007c40d 100644 --- a/tool/gocross/autoflags_test.go +++ b/tool/gocross/autoflags_test.go @@ -301,7 +301,7 @@ func TestAutoflags(t *testing.T) { wantArgv: []string{ "gocross", "build", "-trimpath", - "-tags=tailscale_go,omitidna,omitpemdecrypt", + "-tags=tailscale_go,omitidna,omitpemdecrypt,ts_macext", "-ldflags", "-X tailscale.com/version.longStamp=1.2.3-long -X tailscale.com/version.shortStamp=1.2.3 -X tailscale.com/version.gitCommitStamp=abcd -X tailscale.com/version.extraGitCommitStamp=defg -w", "./cmd/tailcontrol", }, @@ -333,7 +333,7 @@ func TestAutoflags(t *testing.T) { wantArgv: []string{ "gocross", "build", "-trimpath", - "-tags=tailscale_go,omitidna,omitpemdecrypt", + "-tags=tailscale_go,omitidna,omitpemdecrypt,ts_macext", "-ldflags", "-X tailscale.com/version.longStamp=1.2.3-long -X tailscale.com/version.shortStamp=1.2.3 -X tailscale.com/version.gitCommitStamp=abcd -X tailscale.com/version.extraGitCommitStamp=defg -w", "./cmd/tailcontrol", },