Bug #78750 [NEW]: configure assumes yacc and re2c work
| From: | php-bugs-2019 at ryandesign dot com | Date: | Fri, 25 Oct 2019 03:13:33 +0000 |
| Subject: | Bug #78750 [NEW]: configure assumes yacc and re2c work | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-223455@lists.php.net to get a copy of this message | ||
From: php-bugs-2019 at ryandesign dot com
Operating system: macOS
PHP version: 7.4.0RC4
Package: *Compile Issues
Bug Type: Bug
Bug description:configure assumes yacc and re2c work
Description:
------------
The configure script was modified in PHP 7.4 to test for the bison and
re2c version. But the code to do so assumes that the program that it
found responds to the --version flag and outputs a version number. If
the program is found (or if the user specifies which program to use with
the YACC or RE2C environment variables) but the output from the program
is empty or doesn't include the version number, then the configure
script inadvertently outputs all of its variables and functions.
For years, with PHP 7.3.x and earlier, I've been configuring PHP with
the environment variables LEX=true RE2C=true YACC=true. I did this to
ensure that the build system did not regenerate the parsers, even if the
right versions of lex, re2c or bison were installed; I could not find
any other way to tell the build system not to do that. Now, with PHP
7.4, that doesn't work anymore, or maybe it does work, but it produces
tons of undesired output in the process.
This is because the configure script runs `$YACC --version 2> /dev/null
| grep 'GNU Bison' | cut -d ' ' -f 4 | tr -d a-z`, assigns that to the
variable php_bison_version, saves IFS, sets IFS to ".", and runs `set
$php_bison_version`. If $php_bison_version is not empty, this sets the
positional parameters. But if $php_bison_version is empty, it outputs
all variables and functions. And similarly with $RE2C.
https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
> If no options or arguments are supplied, set displays the names and
values of all
> shell variables and functions
Test script:
---------------
YACC=true ./configure
Expected result:
----------------
[snip]
checking for bison... true
checking for bison version... unknown
[snip]
Actual result:
--------------
[snip]
checking for bison... true
checking for bison version... AWK=gawk
BASH=/bin/sh
BASH_ARGC=([0]="1")
BASH_ARGV=([0]="--no-reexec")
BASH_LINENO=([0]="0")
BASH_SOURCE=([0]="./configure")
BASH_VERSINFO=([0]="3" [1]="2" [2]="57" [3]="1"
[4]="release"
[5]="x86_64-apple-darwin17")
BASH_VERSION='3.2.57(1)-release'
CC=cc
CFLAGS='-g -O2'
COLORFGBG='15;0'
COLORTERM=truecolor
CONFIGURE_ARGS=
CONFIGURE_COMMAND=' '\''./configure'\'' '
[snip]
val=
var=CXX
verbose=
x_includes=NONE
x_libraries=NONE
expr: not a decimal number: 'dummy'
[snip]
--
Edit bug report at https://bugs.php.net/bug.php?id=78750&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78750&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78750&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78750&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78750&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78750&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78750&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78750&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78750&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78750&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78750&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78750&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78750&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78750&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78750&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78750&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78750&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78750&r=mysqlcfg