Now, php-build is breaking on Mojave.
This is the upstream issue of PHP. However, php-build supports many PHP versions ended of supports. So, we should discussion the road map to fix.
Reasons
TL;DR:
- Mojave changed the policy of library paths.
./configure of PHP includes some bugs; on older macOS, these are not appeared.
- Therefore, PHP
./configure with current php-build options cannot detect some necessary library on Mojave.
Details:
Mojave changed the policy (https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624):
The command line tools will search the SDK for system headers by default. However, some software may fail to build correctly against the SDK and require macOS headers to be installed in the base system under /usr/include. If you are the maintainer of such software, we encourage you to update your project to work with the SDK or file a bug report for issues that are preventing you from doing so. As a workaround, an extra package is provided which will install the headers to the base system. In a future release, this package will no longer be provided.
In the short term, we can use below command for fallback:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
On the other hand,
- current configure of PHP does not support recommended macOS SDK paths.
- PHP does not support current X11 paths of macOS.
- macOS SDK use
.tbd extension for library, but, PHP does not support.
- (LDAP library bundled Mojave is not included some necessary symbols for PHP.)
On macOS < Mojave, we use libxml2/zlib/bzip2/libiconv/libedit/libpng/libjpeg/sqlite/libcurl bundled on macOS at /usr/include.
However, on Mojave, we cannot use these libraries bundled at /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include because PHP cannot detect them.
Now, Homebrew give up to use bundled libiconv/libpng/etc. on Mojave and use Homebrew's ones. We also can do same. (Fortunately, because some libraries such as zlib/bzip2 avoid checking of PHP configure and are linked by PHP make, we can use them with just specifing /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr as prefix path.)
We can select another way; patch php/php-src#3616 and remove =/usr on default configure options.
See also
Filed bugs:
Patches:
Related:
Now,
php-buildis breaking on Mojave.This is the upstream issue of PHP. However,
php-buildsupports many PHP versions ended of supports. So, we should discussion the road map to fix.Reasons
TL;DR:
./configureof PHP includes some bugs; on older macOS, these are not appeared../configurewith current php-build options cannot detect some necessary library on Mojave.Details:
Mojave changed the policy (https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624):
In the short term, we can use below command for fallback:
On the other hand,
.tbdextension for library, but, PHP does not support.On macOS < Mojave, we use
libxml2/zlib/bzip2/libiconv/libedit/libpng/libjpeg/sqlite/libcurlbundled on macOS at/usr/include.However, on Mojave, we cannot use these libraries bundled at
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/includebecause PHP cannot detect them.Now, Homebrew give up to use bundled
libiconv/libpng/etc. on Mojave and use Homebrew's ones. We also can do same. (Fortunately, because some libraries such aszlib/bzip2avoid checking of PHP configure and are linked by PHP make, we can use them with just specifing/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usras prefix path.)We can select another way; patch php/php-src#3616 and remove
=/usron default configure options.See also
Filed bugs:
Patches:
Related: