Closed mpociot closed 2 months ago
Yup, so this patch is failing:
ext/opcache/config.m4
This line got changes in 8.3.11 https://github.com/php/php-src/compare/php-8.3.10...php-8.3.11#diff-fba8aed1e512099e6635bd4d9ffd939e0489105bc6b2c68d0bfe1abb0ee1007cR322
And the patch is looking for this line:
https://github.com/dixyes/phpmicro/blob/master/patches/static_opcache_83.patch#L62-L63
@crazywhalecc What's the best way to fix this? Is there a fork of phpmicro being used? I have a working patch file but I'm not sure where to send a PR for this.
Update: even though it compiles successfully with the updated patch file, the sanity check fails:
[11:48:48] [DEBU] [EXEC] /Users/marcelpociot/Code/static-php-builder/buildroot/bin/php --ri "Zend Opcache"
[11:48:48] [DEBU] Executed at: /Users/marcelpociot/Code/static-php-builder/src/SPC/builder/Extension.php:175
SPC\exception\RuntimeException
extension opcache failed compile check: php-cli returned 1
To reproduce:
./bin/spc download --with-php=8.3 --all --custom-url=micro:https://github.com/beyondcode/phpmicro/archive/refs/heads/master.zip
export SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -Os" && ./bin/spc build intl,pdo_sqlite,sqlite3,curl,openssl,tokenizer,bcmath,bz2,calendar,dba,ftp,iconv,mysqli,mbstring,mbregex,xml,simplexml,ctype,dom,pdo,filter,session,zlib,fileinfo,pdo_mysql,posix,sockets,shmop,sodium,sysvmsg,sysvsem,sysvshm,gd,zip,gmp,xmlwriter,phar,exif,xmlreader,readline,pcntl,soap,ffi,password-argon2,pgsql,pdo_pgsql,xsl,ldap,igbinary,zstd,opcache --debug --build-cli --build-fpm --with-libs=nghttp2,liblz4 --debug --no-strip
When running ./buildroot/bin/php -i | grep opcache
after a "successful" build, all I see is the --enable-opcache
configure command argument. Opcache itself is not compiled/enabled.
Now the phpmicro repository in static-php is consistent with the upstream repository (easysoft/phpmicro). If this issue is caused by phpmicro, you can make PR at easysoft/phpmicro. I'll also ~remind~ask the phpmicro author later, as he may not check emails often.
@crazywhalecc Thanks! Yeah so it's definitely the patch that needs to be updated. But even with a good patch, the opcache extension is now missing. I don't know enough about how micro works internalls to fix this I'm afraid. Or if this might be related to changes that need to be done in this repo.
I opened a PR for phpmicro and added some tasks as I'm not really sure how micro and static-php work together/where things need to be fixed.
Just to add some additional context, as someone suggested that the issue might be related to JIT. I tried to disable JIT but the opcache extension is still not properly registered.
The easiest way to reproduce this is:
./bin/spc build opcache --debug --disable-opcache-jit --build-cli --debug
Or with jit (as I used it before):
./bin/spc build opcache --debug --build-cli --debug
It does get passed to the make command correctly though, as I can see checking whether to enable Zend OPcache support... yes
in the output.
I'd really appreciate any help in order to be able to update to the latest PHP version.
I know @mpociot is keen to get the latest PHP versions here, but as this problem is more widely breaking all fresh builds, it would be nice if it was possible to explicitly set the exact version of PHP we want to build, e.g. 8.3.10
, which would at least allow us to continue building with a known release that worked...
@simonhamp @mpociot I understand. I'll temporarily fix this to avoid build errors caused by this patch file while we wait for @dixyes to fix the patch.
@simonhamp You can already use --custom-url when downloading spx dependencies to specify an older PHP version
@mpociot i tried that, but i must be missing something about its syntax because every time i cleaned the downloads/source and then re-ran with a URL to an older release, it always fetched the latest version and the build
step kept failing
@simonhamp I added x.y.z specific version download for --with-php
option in #532 . You can switch php version using bin/spc switch-php-version 8.2.22 --debug
command. Or you can directly download fresh new php-src using bin/spc download --for-extensions=xxx --with-php=8.2.22 --ignore-cache-sources=php-src
.
🙏🏼 I will try this out shortly
@crazywhalecc this has worked for me to fixate on older versions for which these patches were working, nice job 👍🏼
This issue has been fixed via #536 .
When trying to build the latest PHP versions, the Micro patches can not be applied.
I assume something changed between 8.3.10/8.3.11 and 8.2.22/8.2.23