-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix Bug 76345 (fix missing zip.h include when using custom libzip) (7.4) #4190
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
Conversation
I'm slightly confused why this is necessary, as the LIBZIP_CFLAGS are already passed to PHP_NEW_EXTENSION. |
Unfortunately I kind of lack knowledge about the internals of the build system. Fact is, that if a custom libzip path is defined all "prechecks" during "configure" run fine, but during the build phase the "-Ipath/to/libzip/include" CFLAG is missing, which results in zip.h not being found. I added the PHP_EVAL_INCLINE which i have "stolen" from the gd extension. Can i provide any details? |
I'm struggling to reproduce this, even using a custom path. How are you calling |
Here is a minimal Dockerfile that will reproduce the issue. You need to make sure that the system does not have any zip.h already installed. It will fail with:
Which is obvious when having a look at the CC line. The include path is missing.
|
Thanks, @paresy. This makes it clear, since I didn't realise you were talking about 7.3.5. Your patch is indeed correct. |
@hughmcmaster What's the relevant difference between 7.3 and 7.4 here? While 7.4 exclusively uses pkg-config, the way they work with LIBZIP_CFLAGS looks the same to me. |
Here is a Dockerfile with the same options against master. Maybe i am mistaken, but it seems like zip support is totally broken. It is not build at all.
|
@nikic, Unfortunately, the Note that this situation only occurs when the headers are not installed in a standard system search path. The 7.3.x, 7.4 and master branches all have this problem. All other extensions converted to use PKG_CHECK_MODULES call PR #4189 includes a patch to fix this problem in 7.4 and master. |
@hughmcmaster Ah, thank you, that makes a lot of sense! Ideally we would not even include zip.h inside php_zip.h and only include it in implementation files. But to avoid larger changes, I guess that this fix is fine (though we should drop the CFLAGS from the NEW_EXTENSION call, as those are redundant now). |
Still don't understand... don't see any include of php_zip.h in main/internal_functions_cli.c or anywhere else |
@remicollet internal_functions.c includes the headers for all statically linked extensions. If you don't see php_zip.h in there, you probably have a shared build. |
@nikic ty (my latest build was with --disable-all.... so...) |
Both 4189 / 4190 target phpmaster, which is obviously wrong Both need to be rebased |
Merged as a0c9d08 into 7.2+. Thanks! |
https://bugs.php.net/bug.php?id=76345
Patch for PHP 7.3 and older is different due to removal of the "bundled" libzip since PHP 7.4.
https://github.com/paresy/php-src/commit/092ded376c515ee225ca33b1abcfe37fe7b95b71.patch