From 74a5aefdd4a6c19e1579b0e011f1caf9ed38f07b Mon Sep 17 00:00:00 2001 From: Alan Morris Date: Fri, 4 Dec 2026 00:31:33 -0700 Subject: [PATCH] Use the Darwin kernel version for the macOS minimum check macOS reports its product version as "10.16" to any binary whose LC_BUILD_VERSION names an SDK older than 11. The release signing step restamps every binary with SDK 10.13, so the signed 6.8.0 and 6.8.1 Studio and shapeworks CLI refused to start on every Mac. Read kern.osrelease instead, which the compatibility shim does not touch, and map the Darwin version to the macOS major version. --- Libs/Common/ShapeworksUtils.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/Libs/Common/ShapeworksUtils.cpp b/Libs/Common/ShapeworksUtils.cpp index a5a677e300..c1979e4618 100644 --- a/Libs/Common/ShapeworksUtils.cpp +++ b/Libs/Common/ShapeworksUtils.cpp @@ -37,15 +37,29 @@ std::string ShapeWorksUtils::check_minimum_os_version() { #if defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) // e.g. 140000 for a build targeting macOS 14.0 const int required_major = __MAC_OS_X_VERSION_MIN_REQUIRED / 10000; - char version[32] = {}; - size_t size = sizeof(version); - if (sysctlbyname("kern.osproductversion", version, &size, nullptr, 0) != 0) { + // Use the Darwin kernel version rather than kern.osproductversion: macOS reports the product + // version as "10.16" to any binary whose LC_BUILD_VERSION names an SDK older than 11, so a + // binary restamped with an old SDK would refuse to run on every Mac. kern.osrelease is not + // affected by that compatibility shim. + char release[32] = {}; + size_t size = sizeof(release); + if (sysctlbyname("kern.osrelease", release, &size, nullptr, 0) != 0) { return ""; // can't tell, so don't block } - int major = std::atoi(version); - if (major > 0 && major < required_major) { + const int darwin_major = std::atoi(release); + if (darwin_major <= 0) { + return ""; + } + // Darwin 20-24 are macOS 11-15; from Darwin 25 macOS is numbered by year (macOS 26) + int major = 10; + if (darwin_major >= 25) { + major = darwin_major + 1; + } else if (darwin_major >= 20) { + major = darwin_major - 9; + } + if (major < required_major) { return "ShapeWorks requires macOS " + std::to_string(required_major) + " or later. This Mac is running macOS " + - std::string(version) + "."; + std::to_string(major) + "."; } #endif return "";