Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More support macOS #538

Open
mizunashi-mana opened this issue Oct 14, 2018 · 4 comments
Open

More support macOS #538

mizunashi-mana opened this issue Oct 14, 2018 · 4 comments

Comments

@mizunashi-mana
Copy link
Contributor

See also: phpenv/phpenv#90 (comment)

Now, on macOS, such command gets error:

$ php-build 7.2.9 $HOME/.anyenv/envs/phpenv/versions/7.2.9
[Info]: Appending build output to /tmp/php-build.7.2.9.20181015004111.log
[Info]: Loaded extension plugin
[Info]: Loaded apc Plugin.
[Info]: Loaded composer Plugin.
[Info]: Loaded github Plugin.
[Info]: Loaded uprofiler Plugin.
[Info]: Loaded xdebug Plugin.
[Info]: Loaded xhprof Plugin.
[Info]: Loaded zendopcache Plugin.
[Info]: php.ini-production gets used as php.ini
[Info]: Building 7.2.9 into /Users/mizunashi/.anyenv/envs/phpenv/versions/7.2.9
[Skipping]: Already downloaded and extracted https://secure.php.net/distributions/php-7.2.9.tar.bz2
[Preparing]: /var/tmp/php-build/source/7.2.9

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: WARNING: unrecognized options: --with-mcrypt
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: 2.3, min: 204, excluded: ).
configure: error: Cannot find OpenSSL's <evp.h>
-----------------------------------------

The full Log is available at '/tmp/php-build.7.2.9.20181015004111.log'.
[Warn]: Aborting build.

https://github.com/rbenv/ruby-build and https://github.com/pyenv/pyenv/tree/master/plugins/python-build provides fallbacks to use homebrew bundled package or build method to use latest OpenSSL.

ruby-build/python-build's method:

  1. Detect os type (https://github.com/rbenv/ruby-build/blob/master/bin/ruby-build#L103)
  2. If is macOS, check whether use breaked OpenSSL (https://github.com/rbenv/ruby-build/blob/master/bin/ruby-build#L1015)
    • OpenSSL bundled macOS is always breaks because it is older libreSSL, so, ruby-build/python-build search Hombrew's OpenSSL.
  3. If use breaked OpenSSL, build OpenSSL by sources (https://github.com/rbenv/ruby-build/blob/master/share/ruby-build/2.5.1#L1)

I want this support for PHP. This support helps also phpenv/phpenv#77 .

@madumlao 's approach is similar. However, I think this is too expensive. In my cases, php-build should use macOS bundled zlib/bzip2 as possible.

I would like you to discuss this points and provide more supports for macOS users.
And I report test results of https://github.com/madumlao/php-build/tree/osx-zlib on this issue.

@GrahamCampbell
Copy link
Member

Thanks for getting in touch. We're absolutely open to contributions. Please let me know how you get on. :)

@GrahamCampbell
Copy link
Member

Ah, I see this relates to php/php-src#3616. We probably want this patched at an earlier level than master. I guess they'll merge it where they want. Just, master branch is for PHP 7.4 I think.

@mizunashi-mana
Copy link
Contributor Author

mizunashi-mana commented Oct 28, 2018

I implemented my idea on https://github.com/mizunashi-mana/php-build/tree/add-fallback-for-openssl. This provides only openssl fallback, so, we cannot build PHP with just this patch on Mojave.
However, macOS includes libxml2/zlib/bzip2/iconv/libedit/freetype now and when php/php-src#3616 will be merged, we will be able to use php-build with only openssl fallback.

And, found a bug for https://github.com/madumlao/php-build/tree/osx-zlib:

@madumlao We should specify the --with-openssl option but not --with-openssl-dir. You can see the test results at https://travis-ci.org/mizunashi-mana/php-build/jobs/446023483.

We probably want this patched at an earlier level than master.

@GrahamCampbell Yes, I think so. Actually, I'm waiting any reactions of PHP team and searching any better solutions.
Because we can use macOS_SDK_headers_for_macOS_10.14.pkg in the short term for Mojave, we still have time for discussions.

@YouSysAdmin
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants