From 60266be29878ceba887ea9195c257fcc29593cfe Mon Sep 17 00:00:00 2001 From: Andrea Gottardo Date: Tue, 14 May 2024 12:15:13 -0700 Subject: [PATCH] version: fix macOS uploads by increasing build number prefix (#12134) Fixes tailscale/corp#19979 A build with version number 275 was uploaded to the App Store without bumping OSS first. The presence of that build is causing any 274.* build to be rejected. To address this, added -1 to the year component, which means new builds will use the 275.* prefix. Signed-off-by: Andrea Gottardo --- version/mkversion/mkversion.go | 5 ++++- version/mkversion/mkversion_test.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/version/mkversion/mkversion.go b/version/mkversion/mkversion.go index 49f97be53..7d0a0f5eb 100644 --- a/version/mkversion/mkversion.go +++ b/version/mkversion/mkversion.go @@ -291,7 +291,10 @@ func mkOutput(v verInfo) (VersionInfo, error) { // so that we we're still in the same range. This way if Apple goes back to // auto-incrementing the number for us, we can go back to it with // reasonable-looking numbers. - ret.XcodeMacOS = fmt.Sprintf("%d.%d.%d", otherTime.Year()-1750, otherTime.YearDay(), otherTime.Hour()*60*60+otherTime.Minute()*60+otherTime.Second()) + // In May 2024, a build with version number 275 was uploaded to the App Store + // by mistake, causing any 274.* build to be rejected. To address this, +1 was + // added, causing all builds to use the 275.* prefix. + ret.XcodeMacOS = fmt.Sprintf("%d.%d.%d", otherTime.Year()-1750+1, otherTime.YearDay(), otherTime.Hour()*60*60+otherTime.Minute()*60+otherTime.Second()) } return ret, nil diff --git a/version/mkversion/mkversion_test.go b/version/mkversion/mkversion_test.go index 1ae2372b5..210d3053a 100644 --- a/version/mkversion/mkversion_test.go +++ b/version/mkversion/mkversion_test.go @@ -81,7 +81,7 @@ func TestMkversion(t *testing.T) { VERSION_TRACK="unstable" VERSION_EXTRA_HASH="defghi" VERSION_XCODE="101.15.129" - VERSION_XCODE_MACOS="273.27.3723" + VERSION_XCODE_MACOS="274.27.3723" VERSION_WINRES="1,15,129,0" VERSION_MSIPRODUCT_AMD64="89C96952-1FB8-5A4D-B02E-16A8060C56AA" VERSION_MSIPRODUCT_ARM64="DB1A2E86-66C4-5CEC-8F4C-7DB805370F3A" @@ -104,7 +104,7 @@ func TestMkversion(t *testing.T) { VERSION_TRACK="unstable" VERSION_EXTRA_HASH="defghi" VERSION_XCODE="101.15.129" - VERSION_XCODE_MACOS="273.27.3723" + VERSION_XCODE_MACOS="274.27.3723" VERSION_WINRES="1,15,129,0" VERSION_MSIPRODUCT_AMD64="89C96952-1FB8-5A4D-B02E-16A8060C56AA" VERSION_MSIPRODUCT_ARM64="DB1A2E86-66C4-5CEC-8F4C-7DB805370F3A"