FriendsOfPHP / pickle

PHP Extension installer
Other
1.65k stars 89 forks source link

Parsing the "AC_ARG_WITH" parameter in the "config.m4" file will be wrong. #240

Open nick322 opened 3 years ago

nick322 commented 3 years ago
pickle install gnupg

After the program is executed, pickle will parse the gpg package config.m4

Log:

 ~$ pickle install gnupg
  - Installing gnupg (latest-stable): Downloading (100%)
+-----------------------------------+--------+
| Package name                      | gnupg  |
| Package version (current release) | 1.5.0  |
| Package status                    | stable |
+-----------------------------------+--------+
AS_HELP_STRING([--with-gpg (default: ):
The following error(s) happened: configure failed, see log at /var/folders/6h/qhrmc0wx0cng0kdbvqs_p_1m0000gn/T/pickle-f4a5ad04f74bfdf425e2ea448bb78834678d7c15\config.log
Would you like to read the log?
1: phpize
2: Configuring for:
2: PHP Api Version:         20200930
2: Zend Module Api No:      20200930
2: Zend Extension Api No:   420200930
2: configure.ac:18: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
2: build/php.m4:2072: PHP_CONFIG_NICE is expanded from...
2: configure.ac:18: the top level
2: configure.ac:161: warning: The macro `AC_LANG_C' is obsolete.
2: configure.ac:161: You should run autoupdate.
2: ./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
2: build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: The macro `AC_LANG_C' is obsolete.
2: configure.ac:161: You should run autoupdate.
2: ./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
2: lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
2: lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
2: ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
2: ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
2: build/libtool.m4:561: _LT_AC_LOCK is expanded from...
2: build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
2: build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: The macro `AC_TRY_LINK' is obsolete.
2: configure.ac:161: You should run autoupdate.
2: ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
2: lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
2: lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
2: ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
2: ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
2: build/libtool.m4:561: _LT_AC_LOCK is expanded from...
2: build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
2: build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
2: build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
2: build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
2: build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
2: build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not exist
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: output file \`$ofile' does not exist
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not look like a libtool script
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: output file \`$ofile' does not look like a libtool script
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: tag name \"$tagname\" already exists
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: The macro `AC_LANG_CPLUSPLUS' is obsolete.
2: configure.ac:161: You should run autoupdate.
2: ./lib/autoconf/c.m4:262: AC_LANG_CPLUSPLUS is expanded from...
2: build/libtool.m4:2810: _LT_AC_LANG_CXX_CONFIG is expanded from...
2: build/libtool.m4:2809: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
2: build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
2: build/libtool.m4:2810: _LT_AC_LANG_CXX_CONFIG is expanded from...
2: build/libtool.m4:2809: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
2: configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
2: build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
2: build/libtool.m4:2810: _LT_AC_LANG_CXX_CONFIG is expanded from...
2: build/libtool.m4:2809: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
2: build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from...
2: build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
2: build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
2: build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
2: configure.ac:161: the top level
1: /var/folders/6h/qhrmc0wx0cng0kdbvqs_p_1m0000gn/T/gnupg/gnupg-1.5.0/configure --with-gnupg=shared  --with-gnupg --without-[gpg]
2: configure: error: invalid package name: `[gpg]'%

https://github.com/php-gnupg/php-gnupg/blob/master/config.m4#L65-L67

AC_ARG_WITH([gpg], [AS_HELP_STRING([--with-gpg],
        [path to gpg v1.x])], [], [with_gpg=no])

when it parse https://github.com/FriendsOfPHP/pickle/blob/d69ff6f6cafc0e484e6db4bcdfddf3066c6b1215/src/Package/PHP/Package.php#L240-L269

 [$name, $desc] = explode(',', $option);  //  $option ='[gpg], [AS_HELP_STRING([--with-gpg],'

the $name will be an error