summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2022-06-23 19:50:22 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-06-23 20:41:26 +0000
commit536da1a22b8ca5cc1caaade7328404144bf44be6 (patch)
tree4220adaecb4bebfcb58f32a07d518ac8ff254d4f
parent1b1d8538d0dab776ecccadcecc64f6d7eaebb5e7 (diff)
downloadmongo-536da1a22b8ca5cc1caaade7328404144bf44be6.tar.gz
SERVER-63616 added check to make sure macos version supports link-model dynamic
-rw-r--r--SConstruct31
1 files changed, 31 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 387397f26d2..4f0981ed9e0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -6,6 +6,7 @@ import errno
import json
import os
import re
+import platform
import shlex
import shutil
import stat
@@ -737,6 +738,13 @@ add_option(
type='choice',
)
+add_option(
+ 'force-macos-dynamic-link',
+ default=False,
+ action='store_true',
+ help='Bypass link-model=dynamic check for macos versions <12.',
+)
+
try:
with open("version.json", "r") as version_fp:
version_data = json.load(version_fp)
@@ -1858,6 +1866,29 @@ if link_model.startswith('dynamic') and get_option('install-action') == 'symlink
f"Options '--link-model={link_model}' not supported with '--install-action={get_option('install-action')}'."
)
+if link_model.startswith('dynamic') and env.TargetOSIs(
+ 'darwin') and not get_option('force-macos-dynamic-link'):
+
+ macos_version_message = textwrap.dedent("""\
+ link-model=dynamic us only supported on macos version 12 or higher.
+ This is due to a 512 dylib limit on older macos. See this post for
+ more information: https://developer.apple.com/forums//thread/708366?login=true&page=1#717495022
+ Use '--force-macos-dynamic-link' to bypass this check.
+ """)
+
+ try:
+ macos_version_major = int(platform.mac_ver()[0].split('.')[0])
+ if macos_version_major < 12:
+ env.FatalError(
+ textwrap.dedent(f"""\
+ Macos version detected: {macos_version_major}
+ """) + macos_version_message)
+ except (IndexError, TypeError) as exc:
+ env.FatalError(
+ textwrap.dedent(f"""\
+ Failed to detect macos version: {exc}
+ """) + macos_version_message)
+
# libunwind configuration.
# In which the following globals are set and normalized to bool:
# - use_libunwind