Skip to content

Commit

Permalink
phase out allow_deprecated_macos_before_12
Browse files Browse the repository at this point in the history
  • Loading branch information
huonw committed Oct 28, 2024
1 parent e7021be commit ef25b53
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 5 additions & 19 deletions src/python/pants/bin/pants_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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")}.
"""
),
)
2 changes: 2 additions & 0 deletions src/python/pants/option/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ef25b53

Please sign in to comment.