php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78102 Can't compile on OSX
Submitted: 2019-06-03 20:10 UTC Modified: 2019-06-07 20:35 UTC
From: dams@php.net Assigned: dams (profile)
Status: Closed Package: Compile Failure
PHP Version: Next Major Version OS: OSX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dams@php.net
New email:
PHP Version: OS:

 

 [2019-06-03 20:10 UTC] dams@php.net
Description:
------------
I'm building PHP 7.4 from the git repository : fresh clone, and short compilation script (see below). 

I've been bumping the following error message for 3 weeks now : 
/Users/php/bin/php-src/Zend/zend_language_parser.h:205:2: error: #endif without #if
#endif /* !YY_ZEND_USERS_php_BIN_PHP_SRC_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED  */

I tried to disable all extensions, buildconf --force, make clean, script/dev/genfiles without success. I also tried to build right after a clone. 

PHP 7.3.6 builds (simple checkout), but 7.4 can't pass make. 

I'm using bison 3.4.1, OSX Mojave

Test script:
---------------
git checkout PHP-7.4; git pull
make clean
./buildconf --force
env YACC=`brew --prefix bison`/bin/bison ./configure \
    --disable-all
make -j`sysctl -n hw.logicalcpu_max`
make test


Expected result:
----------------
Compilation succeed :)

Actual result:
--------------
In file included from /Users/php/bin/php-src/Zend/zend_ast.c:23:
/Users/php/bin/php-src/Zend/zend_language_parser.h:53:18: warning: extra tokens at end of #include directive [-Wextra-tokens]
#include "zend.h"#ifndef YYTOKENTYPE
                 ^
                 //
/Users/php/bin/php-src/Zend/zend_language_parser.h:205:2: error: #endif without #if
#endif /* !YY_ZEND_USERS_php_BIN_PHP_SRC_ZEND_ZEND_LANGUAGE_PARSER_H_INCLUDED  */
 ^
1 warning and 1 error generated.
make: *** [Zend/zend_ast.lo] Error 1

Patches

78102.patch (last revision 2019-06-03 22:35 UTC by petk@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-03 20:32 UTC] petk@php.net
Hello. Thanks for the report. It's the macOS version of make most likely here...

What is the output of this on this machine?

  make -v
 [2019-06-03 22:35 UTC] petk@php.net
The following patch has been added/updated:

Patch Name: 78102.patch
Revision:   1559601351
URL:        https://bugs.php.net/patch-display.php?bug=78102&patch=78102.patch&revision=1559601351
 [2019-06-04 05:49 UTC] dams@php.net
>make -v 
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.


I also upgrade to the latest command line tools (from yesterday), and I keep running into the same version and error.
 [2019-06-04 15:21 UTC] petk@php.net
Yes, confirmed. It's the special version and build of Make for macOS 3.81 that causes this. Has been identified via appended patch above.

Until this patch is confirmed and merged in the php-src we can now also bypass this using the usual GNU Make:

  brew install make

and adding this on the first line of the ~/.bashrc file (or ~/.zshrc and equivalent):

  PATH="/usr/local/opt/make/libexec/gnubin:$PATH"

That will give you something like this:

  make -v

GNU Make 4.2.1
Built for x86_64-apple-darwin18.2.0
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Which is equivalent to:

  gmake -v

macOS is not catching up with some tools versions out there (such as this strange make 3.81 prehistoric version released in 2006) due to their licensing lockups and annoyances.
 [2019-06-05 08:06 UTC] nikic@php.net
Automatic comment on behalf of peterkokot@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ac9ce0f895c285a01052eae6accc37ece25090fa
Log: Fixed bug #78102
 [2019-06-05 08:06 UTC] nikic@php.net
-Status: Open +Status: Closed
 [2019-06-07 20:35 UTC] dams@php.net
-Assigned To: +Assigned To: dams
 [2019-06-07 20:35 UTC] dams@php.net
Compiled using 'gmake' instead of 'make', following the installation of 'brew install make' and it all went well.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 21:01:29 2024 UTC