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

Cannot compile swoole against 7.4.11-3+ubuntu20.04.1+deb.sury.org+1 #1471

Closed
luispabon opened this issue Oct 18, 2020 · 11 comments
Closed

Cannot compile swoole against 7.4.11-3+ubuntu20.04.1+deb.sury.org+1 #1471

luispabon opened this issue Oct 18, 2020 · 11 comments

Comments

@luispabon
Copy link

Describe the bug

After the 7.4.11-3+ubuntu20.04.1+deb.sury.org+1 version rolled out, swoole 4.5.5 cannot be compiled against it:

Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
configure.ac:161: warning: LTOPTIONS_VERSION is m4_require'd but not m4_defun'd
build/libtool.m4:61: LT_INIT is expanded from...
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
configure.ac:161: warning: LTSUGAR_VERSION is m4_require'd but not m4_defun'd
build/libtool.m4:61: LT_INIT is expanded from...
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
configure.ac:161: warning: LTVERSION_VERSION is m4_require'd but not m4_defun'd
build/libtool.m4:61: LT_INIT is expanded from...
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
configure.ac:161: warning: LTOBSOLETE_VERSION is m4_require'd but not m4_defun'd
build/libtool.m4:61: LT_INIT is expanded from...
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
configure:9187: error: possibly undefined macro: m4_ifval
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure:12663: error: possibly undefined macro: LT_INIT
configure:12663: error: possibly undefined macro: _LT_SET_OPTIONS

It compiled fine against the previous revision 7.4.11-2+ubuntu20.04.1+deb.sury.org+1.

Examples:

Scroll down to the php74-swoole section.
To Reproduce
Dockerfile: https://github.com/phpdocker-io/base-images/blob/master/php/7.4/swoole/Dockerfile
Dockerfile for base image used above: https://github.com/phpdocker-io/base-images/blob/master/php/7.4/cli/Dockerfile

Expected behavior
Compiles successfully.

Distribution (please complete the following information):

  • OS: Ubuntu 20.04
  • Architecture: amd64
  • Repository: Ubuntu PPA

Package(s) (please complete the following information):

~ apt-cache policy php7.4-dev
php7.4-dev:
  Installed: (none)
  Candidate: 7.4.11-3+ubuntu20.04.1+deb.sury.org+1
  Version table:
     7.4.11-3+ubuntu20.04.1+deb.sury.org+1 500
        500 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 Packages
     7.4.3-4ubuntu2.4 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
     7.4.3-4ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

Additional context
I believe I've covered everything relevant.

@oerdnj
Copy link
Owner

oerdnj commented Oct 18, 2020

Confirmed, I am seeing that too, I restored the patch to use system libtool m4 macros, but it looks like it’s incomplete.

As quick workaround, copy all m4 files from libtool package to build/ directory just after running phpize.

@luispabon
Copy link
Author

Copy that, thank you 👍

@oerdnj
Copy link
Owner

oerdnj commented Oct 18, 2020

Uploaded a fix (JFTR the copying won’t work because the phpize build changes in 7.4+).

@oerdnj oerdnj closed this as completed Oct 18, 2020
@luispabon
Copy link
Author

luispabon commented Oct 18, 2020

Thank you. I'm finding a different error now though which I'm not sure what to do about:

configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
/bin/bash /tmp/swoole-src/libtool --mode=compile g++  -I. -I/tmp/swoole-src -DPHP_ATOM_INC -I/tmp/swoole-src/include -I/tmp/swoole-src/main -I/tmp/swoole-src -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/tmp/swoole-src -I/tmp/swoole-src/include -I/tmp/swoole-src/thirdparty/hiredis  -DHAVE_CONFIG_H  -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11   -c /tmp/swoole-src/php_swoole.cc -o php_swoole.lo 
/tmp/swoole-src/libtool: line 947: X--mode=compile: command not found
/tmp/swoole-src/libtool: line 1114: *** Warning: inferring the mode of operation is deprecated.: command not found
/tmp/swoole-src/libtool: line 1115: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
/tmp/swoole-src/libtool: line 1258: Xg++: command not found
/tmp/swoole-src/libtool: line 1258: X-I.: command not found
/tmp/swoole-src/libtool: line 1258: X-I/tmp/swoole-src: No such file or directory
/tmp/swoole-src/libtool: line 1258: X-DPHP_ATOM_INC: command not found

See build here: https://ci.auronconsulting.co.uk/teams/main/pipelines/phpdocker-base-images/jobs/php%207.4/builds/436

I wouldn't think this to be an issue with php itself, but swoole's sources, if it wasn't because the same version of swoole compiled fine against an earlier version of the php packages.

@oerdnj
Copy link
Owner

oerdnj commented Oct 18, 2020

Argh, there’s some weird copy of libtool binary bundled in the PHP, which is causing the issues.

cp /usr/bin/libtool . in the swoole directory help.

@oerdnj
Copy link
Owner

oerdnj commented Oct 18, 2020

Fixed in php7.4_7.4.11-6 and php8.0_8.0.0~rc1-6 (just uploaded and building).

@oerdnj oerdnj closed this as completed Oct 18, 2020
@luispabon
Copy link
Author

Thank you, just waiting for builds to go through in launchpad to retest 👍

@oerdnj
Copy link
Owner

oerdnj commented Oct 18, 2020

I also briefly looked into packaging swoole, but oh boy, it does contain a lot of 3rd party code without any option to use the system libraries (hiredis, nghttp2, ...) which makes it a security nightmare to maintain.

@luispabon
Copy link
Author

That explains why it's so massive in size. It's straightforward enough to build from source though at least.

@luispabon
Copy link
Author

luispabon commented Oct 18, 2020

Thank you, all swoole builds are now green (7.4 & 8.0) 👍

@oerdnj
Copy link
Owner

oerdnj commented Oct 18, 2020

Thanks for the confirmation. This issue actually unearthed a much older problem. There was a code that should have replaced the custom copies of shtool, and libtool (and recently pkg-config) files with just symlinks, but it was defunct for I don’t know how long.

Now the custom copies have been removed rather than symlinked and those files are copied by phpize from their original sources.

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

2 participants