crazywhalecc / static-php-cli

Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.
https://static-php.dev
MIT License
1.31k stars 230 forks source link

Error building 8.2 cli and fpm #526

Closed DimitriyB closed 2 months ago

DimitriyB commented 2 months ago

Hello everyone. I am getting strange error on the start of the build process. my steps are:

  1. Ubuntu server 22.04 LTS (updated)
  2. curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
  3. chmod +x ./spc
  4. mkdir ./bin
  5. mv ./spc ./bin
  6. ./bin/spc doctor --auto-fix
  7. ./bin/spc download --with-php=8.2 --for-extensions "amqp,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,ds,event,exif,fileinfo,filter,ftp,gd,gettext,gmp,iconv,igbinary,imagick,imap,inotify,intl,ldap,libxml,mbregex,mbstring,memcache,mongodb,mysqli,mysqlnd,opcache,openssl,parallel,password-argon2,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pdo_sqlsrv,pgsql,phar,posix,protobuf,rar,readline,redis,session,shmop,simdjson,simplexml,snappy,soap,sockets,sodium,sqlite3,sqlsrv,ssh2,sysvmsg,sysvsem,sysvshm,tidy,tokenizer,uuid,uv,xhprof,xlswriter,xml,xmlreader,xmlwriter,xsl,yac,yaml,zip,zlib,zstd" --prefer-pre-built
  8. ./bin/spc build --build-cli --build-fpm "amqp,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,ds,event,exif,fileinfo,filter,ftp,gd,gettext,gmp,iconv,igbinary,imagick,imap,inotify,intl,ldap,libxml,mbregex,mbstring,memcache,mongodb,mysqli,mysqlnd,opcache,openssl,parallel,password-argon2,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pdo_sqlsrv,pgsql,phar,posix,protobuf,rar,readline,redis,session,shmop,simdjson,simplexml,snappy,soap,sockets,sodium,spx,sqlite3,sqlsrv,ssh2,sysvmsg,sysvsem,sysvshm,tidy,tokenizer,uuid,uv,xhprof,xlswriter,xml,xmlreader,xmlwriter,xsl,yac,yaml,zip,zlib,zstd" --debug

And i am getting this error:

[21:20:26] [DEBU] Extracting source [micro] to /home/dmitriy/om-php/source/php-src/sapi/micro ... [21:20:26] [INFO] extracting micro source to /home/dmitriy/om-php/source/php-src/sapi/micro ... [21:20:26] [DEBU] [PASSTHRU] cp -r "/home/dmitriy/om-php/downloads/micro" "/home/dmitriy/om-php/source/php-src/sapi/micro" [21:20:26] [INFO] Patching micro with sapi/micro/patches/static_opcache_81.patch [21:20:26] [DEBU] [PASSTHRU] cd /home/dmitriy/om-php/source/php-src && cat sapi/micro/patches/static_opcache_81.patch | patch -p1 patching file build/order_by_dep.awk patching file ext/opcache/ZendAccelerator.c Hunk #1 succeeded at 93 (offset 2 lines). Hunk #2 succeeded at 4795 (offset -16 lines). patching file ext/opcache/config.m4 Hunk #2 FAILED at 328. 1 out of 2 hunks FAILED -- saving rejects to file ext/opcache/config.m4.rej patching file ext/opcache/config.w32 patching file main/main.c Hunk #1 succeeded at 2048 with fuzz 2 (offset 37 lines). Hunk #2 succeeded at 2305 (offset 40 lines). patching file win32/build/confutils.js Hunk #1 succeeded at 1534 (offset -1 lines). [21:20:26] [NOTI] Running dangerous command: rm -rf /home/dmitriy/om-php/source/php-src/sapi/micro [21:20:26] [ERRO] Uncaught SPC\exception\FileSystemException: Cannot extract source micro: Command run failed with code[1]: cd /home/dmitriy/om-php/source/php-src && cat sapi/micro/patches/static_opcache_81.patch | patch -p1 at phar:///home/dmitriy/om-php/bin/spc/src/SPC/store/FileSystem.php(205) [21:20:26] [ERRO] #0 phar:///home/dmitriy/om-php/bin/spc/src/SPC/store/SourceManager.php(65): SPC\store\FileSystem::extractSource('micro', '/home/dmitriy/o...', '/home/dmitriy/o...')

1 phar:///home/dmitriy/om-php/bin/spc/src/SPC/builder/BuilderBase.php(174): SPC\store\SourceManager::initSource(Array)

2 phar:///home/dmitriy/om-php/bin/spc/src/SPC/command/BuildCliCommand.php(147): SPC\builder\BuilderBase->proveExts(Array)

3 phar:///home/dmitriy/om-php/bin/spc/src/SPC/command/BaseCommand.php(101): SPC\command\BuildCliCommand->handle()

4 phar:///home/dmitriy/om-php/bin/spc/vendor/symfony/console/Command/Command.php(326): SPC\command\BaseCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

5 phar:///home/dmitriy/om-php/bin/spc/vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

6 phar:///home/dmitriy/om-php/bin/spc/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(SPC\command\BuildCliCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

7 phar:///home/dmitriy/om-php/bin/spc/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

8 phar:///home/dmitriy/om-php/bin/spc/bin/spc(20): Symfony\Component\Console\Application->run()

9 /home/dmitriy/om-php/bin/spc(8): require('phar:///home/dm...')

10 {main}

What i am doing wrong? because 3 month before this worked perfectly.

mpociot commented 2 months ago

This is a duplicate of #527 and is also related to the outdated phpmicro patch file for ext-opcache

crazywhalecc commented 2 months ago

This issue has been fixed via #536 .