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

php84: init at 8.4.0beta3 #355

Merged
merged 8 commits into from
Aug 27, 2024
Merged

php84: init at 8.4.0beta3 #355

merged 8 commits into from
Aug 27, 2024

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Aug 23, 2024

  • mysqli socket regression test (outputs.checks.x86_64-linux.php81-mysqli-socket-path) fails, reportedly due to missing symbols:

    Warning: PHP Startup: Unable to load dynamic library '/nix/store/gv1fxy87wgndr0y023qphdq7l4r6idjr-php-mysqlnd-8.1.29/lib/php/extensions/mysqlnd.so' (tried: /nix/store/gv1fxy87wgndr0y023qphdq7l4r6idjr-php-mysqlnd-8.1.29/lib/php/extensions/mysqlnd.so (/nix/store/gv1fxy87wgndr0y023qphdq7l4r6idjr-php-mysqlnd-8.1.29/lib/php/extensions/mysqlnd.so: undefined symbol: compress), /nix/store/m86afannv5mjvyh4icmmh15799lacy4k-php-8.1.29/lib/php/extensions//nix/store/gv1fxy87wgndr0y023qphdq7l4r6idjr-php-mysqlnd-8.1.29/lib/php/extensions/mysqlnd.so.so (/nix/store/m86afannv5mjvyh4icmmh15799lacy4k-php-8.1.29/lib/php/extensions//nix/store/gv1fxy87wgndr0y023qphdq7l4r6idjr-php-mysqlnd-8.1.29/lib/php/extensions/mysqlnd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    
    Warning: PHP Startup: Unable to load dynamic library '/nix/store/sfv14v1f7cbd538wj3mccqak8ccnga7p-php-mysqli-8.1.29/lib/php/extensions/mysqli.so' (tried: /nix/store/sfv14v1f7cbd538wj3mccqak8ccnga7p-php-mysqli-8.1.29/lib/php/extensions/mysqli.so (/nix/store/sfv14v1f7cbd538wj3mccqak8ccnga7p-php-mysqli-8.1.29/lib/php/extensions/mysqli.so: undefined symbol: mysqlnd_global_stats), /nix/store/m86afannv5mjvyh4icmmh15799lacy4k-php-8.1.29/lib/php/extensions//nix/store/sfv14v1f7cbd538wj3mccqak8ccnga7p-php-mysqli-8.1.29/lib/php/extensions/mysqli.so.so (/nix/store/m86afannv5mjvyh4icmmh15799lacy4k-php-8.1.29/lib/php/extensions//nix/store/sfv14v1f7cbd538wj3mccqak8ccnga7p-php-mysqli-8.1.29/lib/php/extensions/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    
    • not sure why, nothing suspicious in git log -p 1e3deb3d8a86a870d925760db1a5adecc64d329d...5de1564aed415bf9d0f281461babc2d101dd49ff -- '**php**'
    • tried comparing mysqlnd.so from known good Nixpkgs version using diffoscope but the compress symbol appears to be present in both
  • xdebug does not build with PHP 8.4 – we will need to switch to 3.4.0alpha1

  • redis does not build with PHP 8.4 php84.extensions.redis: Fix build NixOS/nixpkgs#336912

  • libxml2 patch needs backport php81: libxml 2.13 compatibility NixOS/nixpkgs#334411
    Decided to just vendor an older version of libxml2 since backporting the patche to an older PHP version would be too much work and breaks other stuff:

    On PHP 8.0, setting DOMDocument::$encoding to null as is done by bug77569.phpt will coerce the property to an empty string.
    Before libxml2 2.13, xmlFindCharEncodingHandler('') would return null but 2.13 changed it to return a pointer to an existing handler.
    As a result setting the encoding in bug77569.phpt would not throw an exception and, consequently, the test would fail to match the output.
    This patch makes it so that trying to set the encoding property to null throw “Invalid document encoding” error straigth away.
    Unfortunately, in PHP 8.0, that error, for some reason, races ahead the exception thrown in __toString method of an object that is set as encoding.
    This breaks the toString_exceptions.phpt.
    This bug appears to be fixed in PHP 8.1.

@jtojnar jtojnar force-pushed the update branch 2 times, most recently from 9f536c8 to b4a6f84 Compare August 24, 2024 01:46
@jtojnar jtojnar marked this pull request as draft August 24, 2024 01:55
@piotrkwiecinski
Copy link

@jtojnar I have some libxml fixes here piotrkwiecinski/php-src-nix#1 unfortunately for older builds we have to apply additional patches.

@jtojnar
Copy link
Member Author

jtojnar commented Aug 26, 2024

I bisected the mysqlnd issue to libxml2 bump which does not make sense to me.

@jtojnar
Copy link
Member Author

jtojnar commented Aug 26, 2024

  • php74.extensions.redis3 patch conflict
  • php84.extensions.redis is broken on darwin:
    /private/tmp/nix-build-php-redis-6.0.2.drv-0/source/library.c:2890:62: error: call to undeclared function 'php_rand'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                        (long)tv.tv_sec, (long)tv.tv_usec, (long)php_rand());
                                                                 ^
    /private/tmp/nix-build-php-redis-6.0.2.drv-0/source/library.c:3121:73: warning: format specifies type 'long' but the argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
                persistent_id = strpprintf(0, "phpredis_%ld%ld", tv.tv_sec, tv.tv_usec);
                                                           ~~~              ^~~~~~~~~~
                                                           %d
    
  • dom tests failing for PHP < 7.4 on Darwin

@jtojnar jtojnar marked this pull request as draft August 26, 2024 09:02
`v >= min && v < max` reads more naturally than `v < max && v >= min`
pkgs/libxml2/2.12.nix Outdated Show resolved Hide resolved
This is three major versions behind, it makes little sense to consider it the same project as the current redis. For example, Nixpkgs is going to apply patch for PHP 8.4.
@jtojnar jtojnar force-pushed the update branch 2 times, most recently from f583faf to a56e422 Compare August 26, 2024 20:10
@jtojnar jtojnar marked this pull request as ready for review August 26, 2024 20:13
@drupol
Copy link
Collaborator

drupol commented Aug 26, 2024

Would it be hard to fix the failing darwin builds?

Same as the previous commit, redis has sufficiently diverged from this version.
phpredis 6.1 will not support PHP < 7.4. In fact, one of the patches we apply to make it build with PHP 8.4 already broke PHP 7.0.
Let’s just stay with a latest known working version for the older versions of PHP.
@jtojnar jtojnar force-pushed the update branch 2 times, most recently from dbfacdc to 57486a9 Compare August 26, 2024 20:33
@jtojnar
Copy link
Member Author

jtojnar commented Aug 26, 2024

Those are failing dom tests. I can’t be bothered trying to debug them, just going to do doCheck = false on Darwin and hope it is not too broken there.

@jtojnar jtojnar force-pushed the update branch 4 times, most recently from 0aa853e to 9166b82 Compare August 27, 2024 05:13
Many tests are failing there for some reason, someone should probably look into it.
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/1e3deb3d8a86a870d925760db1a5adecc64d329d' (2024-06-27)
  → 'github:NixOS/nixpkgs/79ed718bf5fa685c44ed4607c314527ff832e53f' (2024-08-26)

Upgrades libxml2 to 2.13, which includes some breaking changes.
Since fixing them in older PHP versions would require extensive patching,
let’s just pin the EOL PHP versions to a vendored libxml2 2.12.
And because we just use it for PHP, we pare the libxml2 package down a bit
(e.g. no Python or static support).
Copy link
Collaborator

@drupol drupol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you want me to say here, I'm mind blown by what you did! Thank you!!!

@jtojnar jtojnar merged commit 3e23c62 into master Aug 27, 2024
34 checks passed
@jtojnar jtojnar deleted the update branch August 27, 2024 10:51
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

Successfully merging this pull request may close these issues.

3 participants