-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Unable to build PHP 8.3.0 alpha 1 / fileinfo extension #11408
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
Comments
While no external libraries should be required to build the fileinfo extension, I do find this line from your logs interesting:
This command (and the accompanying libmagic library) is normally available on all Unix-like distributions. I'm not sure why it's missing. Install it, and see if that fixes the issue. https://www.darwinsys.com/file/ |
That error occurs because Either way, I suspect this is something Nix specific and OP should check out what the “invalid” library is:
|
The "invalid library" is |
Never mind about my "missing libmagic/file" assumption. PHP ships with libmagic, so it doesn't need any anything from the system. https://github.com/php/php-src/tree/master/ext/fileinfo I was hoping it was a missing system dependency, since that'd be easier to fix. 😄 |
Note: I don't use Nix, but I can't reproduce this on my distro (built as shared object). |
I updated the OP with the information requested, I will come back on the computer a bit later to dig a bit deeper. In the meantime, if you have a clue, let me know. |
I see your .dynsym section doesn't contain an export for |
Thanks for sticking through! diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index a6f3e64db6..19eda44ec4 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -14,6 +14,9 @@
+----------------------------------------------------------------------+
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "php.h"
#include "libmagic/magic.h"
@@ -133,9 +136,9 @@ zend_module_entry fileinfo_module_entry = {
};
/* }}} */
-#ifdef COMPILE_DL_FILEINFO
+//#ifdef COMPILE_DL_FILEINFO
ZEND_GET_MODULE(fileinfo)
-#endif
+//#endif
/* {{{ PHP_MINFO_FUNCTION */
PHP_MINFO_FUNCTION(fileinfo)
If this works, does the following then also work (after you reverted the above patch)? diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index a6f3e64db6..c3047233db 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -14,6 +14,9 @@
+----------------------------------------------------------------------+
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "php.h"
#include "libmagic/magic.h"
|
Dear @nielsdos, I just tested with the first and the issue is still there. I also tested with 8.3.0-alpha2 with no difference. |
Thanks for testing. Are you able to share your config.h and the configure command line you used? This would help us reproduce the issue on our systems. |
Here's the /tmp/nix-build-php-fileinfo-8.3.0.drv-1/php-8.3.0alpha2/ext/fileinfo/config.h
|
I succeeded to build the extension, I was applying not applying the patch correctly the first time. I confirm that both patches are working. |
On some configurations, the COMPILE_DL_FILEINFO must come from the config.h file. If the COMPILE_DL_FILEINFO macro is not set, the build won't include the ZEND_GET_MODULE block necessary for building this extension as a shared object.
Thanks @drupol I've submitted a PR to fix this, the fix will be in the next alpha. |
Description
Hello,
I'm trying to provide PHP 8.3.0 in the Nix ecosystem and I'm unable to compile PHP 8.3.0 alpha1. The issue seems to come from the
fileinfo
extension, see the attached log.Here's the output of the test 57547:
(See gist)
PHP Version
PHP 8.3.0
Operating System
NixOS
The text was updated successfully, but these errors were encountered: