From 242aea93c69d0e9a5c0bb738aa740d9b81703821 Mon Sep 17 00:00:00 2001 From: Kyle Bayes Date: Wed, 12 Jul 2023 06:37:24 -0700 Subject: [PATCH] Bump oldest supported MacOS to version 11. PiperOrigin-RevId: 547479684 Change-Id: Idb6a432af0e7872ca087a0c571aafa72e9528818 --- cmake/MujocoMacOS.cmake | 7 +++++-- doc/changelog.rst | 1 + sample/cmake/MujocoMacOS.cmake | 7 +++++-- simulate/cmake/MujocoMacOS.cmake | 7 +++++-- src/engine/engine_plugin.cc | 15 --------------- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/cmake/MujocoMacOS.cmake b/cmake/MujocoMacOS.cmake index d2f378f6..8ff7cd30 100644 --- a/cmake/MujocoMacOS.cmake +++ b/cmake/MujocoMacOS.cmake @@ -13,8 +13,11 @@ # limitations under the License. if(APPLE) - # 10.12 is the oldest version of macOS that supports C++17, launched 2016. - set(MUJOCO_MACOSX_VERSION_MIN 10.12) + # Target the oldest version of macOS that is still supported by Apple. + # We follow https://endoflife.date/macos, which considers a version to become + # unsupported the first time it is excluded from a macOS security update + # (e.g. https://github.com/endoflife-date/endoflife.date/issues/1602). + set(MUJOCO_MACOSX_VERSION_MIN 11) # We are setting the -mmacosx-version-min compiler flag directly rather than using the # CMAKE_OSX_DEPLOYMENT_TARGET variable since we do not want to affect choice of SDK, diff --git a/doc/changelog.rst b/doc/changelog.rst index 1b0ebc66..a562ea1e 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -13,6 +13,7 @@ General (rotation with an angular velocity). Derivatives are in the 3D tangent space. - Added :ref:`mjv_connector` which has identical functionality to :ref:`mjv_makeConnector`, but with more convenient "from-to" argument parametrization. :ref:`mjv_makeConnector` is now deprecated. +- Bump oldest supported MacOS from version 10.12 to 11. MacOS 11 is the oldest version still maintained by Apple. Version 2.3.6 (June 20, 2023) diff --git a/sample/cmake/MujocoMacOS.cmake b/sample/cmake/MujocoMacOS.cmake index d2f378f6..8ff7cd30 100644 --- a/sample/cmake/MujocoMacOS.cmake +++ b/sample/cmake/MujocoMacOS.cmake @@ -13,8 +13,11 @@ # limitations under the License. if(APPLE) - # 10.12 is the oldest version of macOS that supports C++17, launched 2016. - set(MUJOCO_MACOSX_VERSION_MIN 10.12) + # Target the oldest version of macOS that is still supported by Apple. + # We follow https://endoflife.date/macos, which considers a version to become + # unsupported the first time it is excluded from a macOS security update + # (e.g. https://github.com/endoflife-date/endoflife.date/issues/1602). + set(MUJOCO_MACOSX_VERSION_MIN 11) # We are setting the -mmacosx-version-min compiler flag directly rather than using the # CMAKE_OSX_DEPLOYMENT_TARGET variable since we do not want to affect choice of SDK, diff --git a/simulate/cmake/MujocoMacOS.cmake b/simulate/cmake/MujocoMacOS.cmake index d2f378f6..8ff7cd30 100644 --- a/simulate/cmake/MujocoMacOS.cmake +++ b/simulate/cmake/MujocoMacOS.cmake @@ -13,8 +13,11 @@ # limitations under the License. if(APPLE) - # 10.12 is the oldest version of macOS that supports C++17, launched 2016. - set(MUJOCO_MACOSX_VERSION_MIN 10.12) + # Target the oldest version of macOS that is still supported by Apple. + # We follow https://endoflife.date/macos, which considers a version to become + # unsupported the first time it is excluded from a macOS security update + # (e.g. https://github.com/endoflife-date/endoflife.date/issues/1602). + set(MUJOCO_MACOSX_VERSION_MIN 11) # We are setting the -mmacosx-version-min compiler flag directly rather than using the # CMAKE_OSX_DEPLOYMENT_TARGET variable since we do not want to affect choice of SDK, diff --git a/src/engine/engine_plugin.cc b/src/engine/engine_plugin.cc index 50379d12..075aacca 100644 --- a/src/engine/engine_plugin.cc +++ b/src/engine/engine_plugin.cc @@ -43,13 +43,6 @@ extern "C" { #endif } -#ifdef __APPLE__ -#include -#if !defined(MAC_OS_X_VERSION_MIN_REQUIRED) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) -#define MAC_OS_X_VERSION_MIN_REQUIRED __MAC_OS_X_VERSION_MIN_REQUIRED -#endif -#endif - #include #include "engine/engine_util_errmem.h" @@ -163,15 +156,7 @@ template PluginTable* AddNewTableBlock(PluginTable* table) { char err[512]; err[0] = '\0'; - -#if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14 - // aligned nothrow new is not available until macOS 10.14 - posix_memalign(reinterpret_cast(&table->next), - alignof(PluginTable), sizeof(PluginTable)); - if (table->next) new(table->next) PluginTable; -#else table->next = new(std::nothrow) PluginTable; -#endif if (!table->next) { std::snprintf(err, sizeof(err), "failed to allocate memory for the global plugin table"); return nullptr;