Skip to content

Commit

Permalink
hack around for editable not working on new macs
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Jun 28, 2024
1 parent 1d5103e commit 8a2d806
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ def is_development_mode():
return 'develop' in sys.argv


def get_xcode_major_version():
"""Return major version of xcode present on the system"""
try:
output = subprocess.check_output(
['xcodebuild', '-version'], text=True)
version_line = output.split('\n')[0]
version = version_line.split(' ')[-1]
return int(version.split('.')[0])
except:
return 0

def run_cmd(args):
print('>', subprocess.list2cmdline(args))
subprocess.check_call(args)
Expand Down Expand Up @@ -61,7 +72,6 @@ def determine_cross_compile_args():
return ['-DCMAKE_C_FLAGS=-m32']
return []


def determine_generator_args():
if sys.platform == 'win32':
try:
Expand Down Expand Up @@ -368,6 +378,17 @@ def awscrt_ext():
if not is_macos_universal2():
if sys.platform == 'darwin':
extra_link_args += ['-Wl,-fatal_warnings']
# xcode 15 introduced a new linker that generates a warning
# when it sees duplicate libs or rpath during bundling.
# pyenv installed from homebrew put duplicate rpath entries
# into sysconfig, and setuptools happily passes them along
# to xcode, resulting in a warning
# (which is fatal in this branch).
# ex. https://github.com/pyenv/pyenv/issues/2890
# lets revert back to old linker on xcode >= 15 until one of
# the involved parties fixes the issue.
if get_xcode_major_version() >= 15:
extra_link_args += ['-Wl,-ld_classic']
elif 'bsd' in sys.platform:
extra_link_args += ['-Wl,-fatal-warnings']
else:
Expand Down

0 comments on commit 8a2d806

Please sign in to comment.