Bug #73219 [Opn->Ver]: acinclude.m4 sed syntax garbled

From: Date: Sat, 01 Oct 2016 21:18:12 +0000
Subject: Bug #73219 [Opn->Ver]: acinclude.m4 sed syntax garbled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204394@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73219&edit=1

 ID:                 73219
 Updated by:         cmb@php.net
 Reported by:        rainer dot jung at kippdata dot de
 Summary:            acinclude.m4 sed syntax garbled
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   Solaris, Linux
 PHP Version:        7.0.11
 Block user comment: N
 Private report:     N

 New Comment:

Thanks for reporting this issue and providing a patch. I agree,
that # is preferable over /.

However, I'm puzzled because the commit you've mentioned appears
to be in PHP-7.0 only, even though git branch --contains says
it's in 7.0, 7.1 and master, and there appears to be no commit
afterwards which reverts the commit or modifies the change.


Previous Comments:
------------------------------------------------------------------------
[2016-10-01 17:59:48] rainer dot jung at kippdata dot de

Description:
------------
In acinclude.m4 the following line was introduced by commit

https://github.com/php/php-src/commit/1524e00ccc8d99885dae0a4567b8b45a2ff44ba2#diff-a5522b90382504dc530177f63ced5209

clean_configure_args=$(echo $clean_configure_args | sed -e "s/'$var=$val'//")

If the value of the variable contains a "/" character, this will result in an sed error
message, because "/" was chosen as the delimiter. In our case we have CC="gcc
-specs=/shared/build/autobuild/specs/specs.solaris" but it can also happen e.g. in CFLAGS,
LDFLAGS etc.

Error on Solaris:

sed: command garbled: s/'CC=gcc -specs=/shared/build/autobuild/specs/specs.solaris'//

Error on Linux:

sed: -e expression #1, char 26: unknown option to `s'

The errors happen during configure run for PHP, but also when the configure generated by phpize is
being run for an extension.

I suggest to use "#" instead of "/" as delimiter, because it is very unlikely to
be part of the variable values.

The problem currently occurs in PHP 7.0 and 7.1, likely also in trunk. The change that causes it has
not been backported to 5.6, so no need to fix 5.6.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=73219&edit=1


Thread (7 messages)

« previous php.bugs (#204394) next »