From ef25b53717db9fb45a9007b3013b5e336c17d3c8 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Mon, 28 Oct 2024 15:00:17 +1100 Subject: [PATCH] phase out allow_deprecated_macos_before_12 --- pants.toml | 2 +- src/python/pants/bin/pants_runner.py | 24 +++++------------------ src/python/pants/option/global_options.py | 2 ++ 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/pants.toml b/pants.toml index e3921f6c985..7a8666d29ba 100644 --- a/pants.toml +++ b/pants.toml @@ -88,7 +88,7 @@ cache_content_behavior = "fetch" # Our current macOS 10.15 and 11 infrastructure is working okay, so for now (i.e. 2.24 dev # releases), we'll just keep building on them: -allow_deprecated_macos_before_12 = true +allow_deprecated_macos_versions = ["10", "11"] [DEFAULT] # Tell `scie-pants` to use our `./pants` bootstrap script. diff --git a/src/python/pants/bin/pants_runner.py b/src/python/pants/bin/pants_runner.py index 0481f28f0ae..5dcde696054 100644 --- a/src/python/pants/bin/pants_runner.py +++ b/src/python/pants/bin/pants_runner.py @@ -180,6 +180,11 @@ def _validate_macos_version(global_bootstrap_options: OptionValueContainer) -> N # Not macOS, no validation/deprecations required! return + if global_bootstrap_options.allow_deprecated_macos_before_12 and is_macos_before_12(): + # If someone has set this (deprecated) option, and the system is older than macOS 12, + # they'll don't want messages, so just skip. + return + arch_versions = _MACOS_VERSION_BECOMES_UNSUPPORTED_IN[get_normalized_arch_name()] unsupported_version = arch_versions.get(macos_version) @@ -208,22 +213,3 @@ def _validate_macos_version(global_bootstrap_options: OptionValueContainer) -> N """ ), ) - - # NB. this is the "old" style deprecation of 10.15 & 11, and can be torn out in favour of the - # above, once we replace [GLOBAL].allow_deprecated_macos_before_12 completely - if not global_bootstrap_options.allow_deprecated_macos_before_12 and is_macos_before_12(): - warn_or_error( - "2.24.0.dev0", - "using Pants on macOS 10.15 - 11", - softwrap( - f""" - Future versions of Pants will only run on macOS 12 and newer, but this machine - appears older ({platform.platform()}). - - You can temporarily silence this warning with the - `[GLOBAL].allow_deprecated_macos_before_12` option. If you have questions or - concerns about this, please reach out to us at - {doc_url("community/getting-help")}. - """ - ), - ) diff --git a/src/python/pants/option/global_options.py b/src/python/pants/option/global_options.py index c9d6808fe32..042859e9cb9 100644 --- a/src/python/pants/option/global_options.py +++ b/src/python/pants/option/global_options.py @@ -1805,6 +1805,8 @@ def file_downloads_max_attempts(self) -> int: {doc_url("community/getting-help")}. """ ), + removal_version="2.26.0.dev0", + removal_hint='Upgrade your operating system or write `allow_deprecated_macos_versions = ["10", "11"]` instead.', ) allow_deprecated_macos_versions = StrListOption(