Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.58k stars 12.33k forks source link

Python fails to build on macOS 10.13.6, with MacOSX10.14.sdk command line tools. #31679

Closed yunlingz closed 5 years ago

yunlingz commented 6 years ago

To help us debug your issue please explain:

READ THIS: https://docs.brew.sh/Troubleshooting

These open issues may also help: pipenv cannot easily manage multiple python versions https://github.com/Homebrew/homebrew-core/issues/31487 WeeChat fails to build --with-python https://github.com/Homebrew/homebrew-core/issues/30509 Jupyter notebook is launched with PYTHONPATH, modifies sys.path in Python kernels https://github.com/Homebrew/homebrew-core/issues/31325 vim fails to build from source with option --with-client-server when python is installed with '--with-tcl-tk' https://github.com/Homebrew/homebrew-core/issues/30949


- What you expected to happen
See if someone has same problem.
- Step-by-step reproduction instructions (by running `brew install` commands)
On macOS 10.13.6, with MacOSX10.14.sdk command line tools, just run `brew install python`
DomT4 commented 6 years ago

Can you provide a full brew gist-logs python rather than just the snippet? Thanks

yunlingz commented 6 years ago

@DomT4 Sorry for that. This issue has been updated with gist url.

yunlingz commented 6 years ago

@DomT4 The problem no longer exists after I downgrade MacOSX10.14.sdk to MacOSX10.13.sdk.

Dryblow commented 6 years ago

@Hyzeta how can I downgrade to MacOSX10.13.sdk?

yunlingz commented 6 years ago

@Dryblow If you are using macOS 10.13, just remove CommandLineTools folder under /Library/Developer, and type clang in terminal to install command line tools, it will be MacOSX10.13.sdk. If you are using macOS 10.14, reinstall command line tools will still be MacOSX10.14.sdk.

Dryblow commented 6 years ago

@Hyzeta I have macos 10.13.6 but I don't have MacOSX10.13.sdk to build with clang, where I can find it? I don't have a developer apple account. Thanks

yunlingz commented 6 years ago

@Dryblow You don't need a developer apple account, just delete the command line tools on your computer and reinstall it from the internet. It will be MacOSX10.13.sdk.


Updated on 2018.9.21: A few days ago, Apple has pushed the new XCode and Command Line Tools. Since then, reinstall Command Line Tools on macOS 10.13.6 will not work.

Dryblow commented 6 years ago

Oh your right, thanks @Hyzeta

vincentisambart commented 5 years ago

FWIW, I managed to build python with Xcode 10 by removing the following line from python.rb https://github.com/Homebrew/homebrew-core/blob/9a7270788f73e532a4841f3f0b5dc2642a9eaccf/Formula/python.rb#L107

It seems that with Xcode 10, -isysroot and -I/usr/include don't seem to go well together.

$ cat x.m 
#include <Foundation/Foundation.h>
$ clang -c x.m # OK
$ clang -I/usr/include -c x.m # OK
$ clang -isysroot /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -c x.m # OK
$ clang -isysroot /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/usr/include -c x.m # KO
In file included from x.m:1:
In file included from /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:87:
In file included from /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:17:
In file included from /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:24:
In file included from /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:29:
/Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h:597:165: error: 
      expected function body after function declarator
  ...AEEventID theAEEventID, Boolean askUserIfNeeded ) __OSX_AVAILABLE_STARTI...
tdd commented 5 years ago

FWIW I tried building with this line removed from the Python formula, and it didn't fix it.

SmithSamuelM commented 5 years ago

I have a similar problem. I can't get python3.7 to install with tcl-tk on macOS 10.13.6

$ brew install python3 --with-tcl-tk ......

/usr/bin/install -c -s ../python.exe "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python" sed -e "s!%bundleid%!org.python.python!g" \ -e "s!%version%!DYLD_FRAMEWORK_PATH=/private/tmp/python-20180920-93810-rk2qwr/Python-3.7.0 ../python.exe \ -c 'import platform; print(platform.python_version())'!g" \ < "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/Info.plist.in" \

"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/Info.plist" rm "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/Info.plist.in" cd PythonLauncher && make install DESTDIR= sed 's/%VERSION%/'"DYLD_FRAMEWORK_PATH=/private/tmp/python-20180920-93810-rk2qwr/Python-3.7.0 ../../python.exe -c 'import platform; print(platform.python_version())'"'/g' < ./Info.plist.in > Info.plist clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/usr/include -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -o FileSettings.o -c ./FileSettings.m In file included from ./FileSettings.m:9: In file included from ./FileSettings.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:87: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:17: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:24: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:29: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h:597:165: error: expected function body after function declarator extern OSStatus AEDeterminePermissionToAutomateTarget( const AEAddressDesc* target, AEEventClass theAEEventClass, AEEventID theAEEventID, Boolean askUserIfNeeded ) OSX_AVAILABLE_STARTING( MAC_10_14, __IPHONE_NA ); ^ /usr/include/Availability.h:216:50: note: expanded from macro '__OSX_AVAILABLE_STARTING'

define OSX_AVAILABLE_STARTING(_osx, _ios) AVAILABILITY_INTERNAL##_osx

^

:58:1: note: expanded from here __AVAILABILITY_INTERNAL__MAC_10_14 ^ In file included from ./FileSettings.m:9: In file included from ./FileSettings.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:179: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:21:27: error: expected a version of the form 'major[.minor[.subminor]]' } NS_DEPRECATED_MAC(10_8, API_TO_BE_DEPRECATED, "All NSUserNotifications API should be replaced with UserNotifications.frameworks API"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:23:25: error: expected a version of the form 'major[.minor[.subminor]]' NS_DEPRECATED_MAC(10_8, API_TO_BE_DEPRECATED, "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:102:26: error: expected a version of the form 'major[.minor[.subminor]]' NS_DEPRECATED_MAC(10_10, API_TO_BE_DEPRECATED, "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:115:95: error: expected a version of the form 'major[.minor[.subminor]]' FOUNDATION_EXPORT NSString * const NSUserNotificationDefaultSoundName NS_DEPRECATED_MAC(10_8, API_TO_BE_DEPRECATED, "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") API_UNAVAILABLE(ios, watchos, tvos); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:117:25: error: expected a version of the form 'major[.minor[.subminor]]' NS_DEPRECATED_MAC(10_8, API_TO_BE_DEPRECATED, "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") ^ 6 errors generated. make[2]: *** [FileSettings.o] Error 1 make[1]: *** [install_PythonLauncher] Error 2 make: *** [frameworkinstallapps] Error 2 /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `write': Broken pipe (Errno::EPIPE) from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `puts' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `rescue in block (3 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:31:in `block (3 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `block (2 levels) in safe_fork' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `open' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `block in safe_fork' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir' from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:26:in `safe_fork' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:719:in `build' from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:311:in `install' from /usr/local/Homebrew/Library/Homebrew/reinstall.rb:33:in `reinstall_formula' from /usr/local/Homebrew/Library/Homebrew/cmd/reinstall.rb:26:in `block in reinstall' from /usr/local/Homebrew/Library/Homebrew/cmd/reinstall.rb:20:in `each' from /usr/local/Homebrew/Library/Homebrew/cmd/reinstall.rb:20:in `reinstall' from /usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `
'

==> Formula Path: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python.rb ==> Configuration HOMEBREW_VERSION: 1.7.5 ORIGIN: https://github.com/Homebrew/brew HEAD: d639559c4de48faad79d3ecb1ec84dc851ea66f2 Last commit: 3 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 68763193b0a0973391c814b1b11720ef72fadc33 Core tap last commit: 7 hours ago HOMEBREW_PREFIX: /usr/local HOMEBREW_GIT: git CPU: quad-core 64-bit arrandale Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby Clang: 10.0 build 1000 Git: 2.19.0 => /usr/local/bin/git Curl: 7.54.0 => /usr/bin/curl Java: 10.0.2 macOS: 10.13.6-x86_64 CLT: 10.0.0.0.1.1535735448 CLT headers: N/A Xcode: 10.0 XQuartz: 2.7.11 => /opt/X11 ==> ENV HOMEBREW_CC: clang HOMEBREW_CXX: clang++ CMAKE_PREFIX_PATH: /usr/local/opt/sphinx-doc:/usr/local/opt/openssl:/usr/local/opt/readline:/usr/local/opt/sqlite:/usr/local/opt/tcl-tk:/usr/local CMAKE_INCLUDE_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers CMAKE_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig:/usr/local/opt/tcl-tk/lib/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.13 HOMEBREW_GIT: git HOMEBREW_SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk ACLOCAL_PATH: /usr/local/share/aclocal PATH: /usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/local/opt/pkg-config/bin:/usr/local/opt/sphinx-doc/bin:/usr/local/opt/gdbm/bin:/usr/local/opt/openssl/bin:/usr/local/opt/sqlite/bin:/usr/local/opt/xz/bin:/usr/local/opt/tcl-tk/bin:/usr/bin:/bin:/usr/sbin:/sbin

Error: python 3.7.0 did not build Logs: /Users/belinda/Library/Logs/Homebrew/python/00.options.out /Users/belinda/Library/Logs/Homebrew/python/03.make.cc /Users/belinda/Library/Logs/Homebrew/python/01.configure.cc /Users/belinda/Library/Logs/Homebrew/python/02.make.cc /Users/belinda/Library/Logs/Homebrew/python/config.log /Users/belinda/Library/Logs/Homebrew/python/01.configure /Users/belinda/Library/Logs/Homebrew/python/03.make /Users/belinda/Library/Logs/Homebrew/python/02.make READ THIS: https://docs.brew.sh/Troubleshooting

These open issues may also help: pipenv cannot easily manage multiple python versions https://github.com/Homebrew/homebrew-core/issues/31487 WeeChat fails to build --with-python https://github.com/Homebrew/homebrew-core/issues/30509 Python fails to build on macOS 10.13.6, with MacOSX10.14.sdk command line tools. https://github.com/Homebrew/homebrew-core/issues/31679 Jupyter notebook is launched with PYTHONPATH, modifies sys.path in Python kernels https://github.com/Homebrew/homebrew-core/issues/31325 vim fails to build from source with option --with-client-server when python is installed with '--with-tcl-tk' https://github.com/Homebrew/homebrew-core/issues/30949

SmithSamuelM commented 5 years ago

Deleting /Library/Developer/CommandLineTools and reinstalling with Xcode-select --install does not install 10.13.6 sdk but still has 10.14 sdk. How to I really downgrade to the 10.13.6 sdk?

SmithSamuelM commented 5 years ago

I got it too work. I deleted /Library/Developer/CommandLineTools I reinstalled with $ xcode-select --install

Afterwards this is the contents of /library/developer/CommandLineTools/SDKs/

drwxr-xr-x 6 root wheel 192 Sep 20 09:11 MacOSX.sdk/ lrwxr-xr-x 1 root wheel 10 Sep 20 09:12 MacOSX10.13.sdk@ -> MacOSX.sdk lrwxr-xr-x 1 root wheel 10 Sep 20 09:09 MacOSX10.14.sdk@ -> MacOSX.sdk

My application folder has: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ drwxr-xr-x 6 root wheel 192 Aug 31 10:45 MacOSX.sdk/ lrwxr-xr-x 1 root wheel 10 Sep 18 19:03 MacOSX10.14.sdk@ -> MacOSX.sdk

I did this after uninstalling brew tcl-tk and python3

$ brew install tcl-tk $ brew install python3 --with-tcl-tk

Xcode 10 MacOS 10.13.6

yunlingz commented 5 years ago

@SmithSamuelM A few days ago, Apple has pushed the new XCode and Command Line Tools. Since then, reinstall Command Line Tools on macOS 10.13.6 will not work.

Neberheim commented 5 years ago

Having the same issue, slightly different output.

Last 15 lines from ~/Library/Logs/Homebrew/python/03.make:
NS_DEPRECATED_MAC(10_8, API_TO_BE_DEPRECATED, "All NSUserNotifications API should be replaced with UserNotifications.frameworks API")
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:102:26: error: expected a version of the form 'major[.minor[.subminor]]'
NS_DEPRECATED_MAC(10_10, API_TO_BE_DEPRECATED, "All NSUserNotifications API should be replaced with UserNotifications.frameworks API")
                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:115:95: error: expected a version of the form 'major[.minor[.subminor]]'
FOUNDATION_EXPORT NSString * const NSUserNotificationDefaultSoundName NS_DEPRECATED_MAC(10_8, API_TO_BE_DEPRECATED, "All NSUserNotifications API should be replaced with UserNotifications.frameworks API") API_UNAVAILABLE(ios, watchos, tvos);
                                                                                              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserNotification.h:117:25: error: expected a version of the form 'major[.minor[.subminor]]'
NS_DEPRECATED_MAC(10_8, API_TO_BE_DEPRECATED, "All NSUserNotifications API should be replaced with UserNotifications.frameworks API")
                        ^
6 errors generated.
make[2]: *** [FileSettings.o] Error 1
make[1]: *** [install_PythonLauncher] Error 2
make: *** [frameworkinstallapps] Error 2
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `write': Broken pipe (Errno::EPIPE)
    from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `puts'
    from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `rescue in block (3 levels) in safe_fork'
    from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:31:in `block (3 levels) in safe_fork'
    from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `fork'
    from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:30:in `block (2 levels) in safe_fork'
    from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `open'
    from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:27:in `block in safe_fork'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
    from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:26:in `safe_fork'
    from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:719:in `build'
    from /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:311:in `install'
    from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:321:in `install_formula'
    from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:253:in `block in install'
    from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:in `each'
    from /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:251:in `install'
    from /usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'
fsiler commented 5 years ago

I had success with commenting out line 114 in python@2.rb. You can download old command line tools from Apple's dev site.

jhuebner79 commented 5 years ago

FWIW, I managed to build python with Xcode 10 by removing the following line from python.rb

homebrew-core/Formula/python.rb Line 107 in 9a72707 cflags << "-I/usr/include" # find zlib It seems that with Xcode 10, -isysroot and -I/usr/include don't seem to go well together.


$ cat x.m 
#include <Foundation/Foundation.h>
$ clang -c x.m # OK
$ clang -I/usr/include -c x.m # OK
$ clang -isysroot /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -c x.m # OK
$ clang -isysroot /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/usr/include -c x.m # KO
In file included from x.m:1:
In file included from /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:87:
In file included from /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:17:
In file included from /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:24:
In file included from /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:29:
/Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/> FWIW, I managed to build `python` with Xcode 10 by removing the following line from `python.rb`

[homebrew-core/Formula/python.rb](https://github.com/Homebrew/homebrew-core/blob/9a7270788f73e532a4841f3f0b5dc2642a9eaccf/Formula/python.rb#L107)
Line 107 in [9a72707](/Homebrew/homebrew-core/commit/9a7270788f73e532a4841f3f0b5dc2642a9eaccf)
 cflags  << "-I/usr/include" # find zlib 
It seems that with Xcode 10, `-isysroot` and `-I/usr/include` don't seem to go well together.

That worked. In other words: same here.

terrycojones commented 5 years ago

The @SmithSamuelM fix above worked for me too - thanks! https://github.com/Homebrew/homebrew-core/issues/31679#issuecomment-423259873

jpickwell commented 5 years ago

@SmithSamuelM's fix worked for me on 10.13.6.

ilg-ul commented 5 years ago

Apparently the trick is to install the command line tools via

$ xcode-select --install

this also creates the MacOSX10.13.sdk link, otherwise missing.

After this, installing python3 worked as expected.

fxcoudert commented 5 years ago

Fixed