Some PHP 8.1 news

https://dev.tt-rss.org/fox/tt-rss/pulls/73#issuecomment-637

figured i’d repost here

Still considering 2023 for raising the minimum version?

not sure i get your point. i don’t like to raise minimum version requirements too often because of people stuck with shitty shared hosting. we have to, however, move forward.

Going off of the PR conversation and this comment from a while back, I was just curious if the plan was to keep maintaining 7.x compatibility, rather than raising the minimum to 8.x at some point in the near future (e.g. 2023). 7.4 goes EOL in November 2022 (7.1 was December 2019), at which point 8.0 will also be 2 years old.

oh. well. there doesn’t seem to be any pressing need to move to 8.0 baseline. i suppose instead we’ll move slowly upwards 7.x tree along with inevitable deprecations, like in the linked PR.

it seems unlikely that we’ll grow out of 7.x in 2023. it will still be unsupported because it’s not on the shipping docker image but i won’t purposely break it.

i’m going to bump docker images (and my development environment, eventually) to 8.1 since its supported by alpine now.

Fair enough. I’ve been running Alpine 3.16 with 8.1 for a bit now. If I remember correctly only the Idiorm stuff needed fixing.

hey everyone let’s look at these fucking clowns, point fingers, and laugh.

dev branch for php 8.1 dependencies - tt-rss/tt-rss: Tiny Tiny RSS - tt-rss - Tiny Tiny RSS

testers welcome.

tt-rss/ttrss-docker-compose: Dockerized tt-rss using docker-compose - ttrss-docker-compose - Tiny Tiny RSS dev branch for the docker scripts.

i’m seeing some warnings but so far nothing particularly annoying to fix.

don’t forget to mount tt-rss source into a local folder or something and switch from master to ‘testing-php8.1’.

unless something comes up, i plan to switch over to php8.1 on master by weekend.

php 8.1 is merged into master, docker images are going to come later.

e: php-readabiity generates a bunch of warnings on 8.1. i guess it’s one more library to fork because it also has a functionally dead upstream. really enjoying this shit.

i’m keeping the underlying code changes i.e. forked idiorm and some newer libraries, but docker image stays on 8.0 for the time being because of readability which needs to be fixed first.

this still bumps minimum version to 7.4.

my CI pipeline also stays on php 8.0 until readability is taken care of.

php-readabiity generates a bunch of warnings on 8.1

yeah, besides usort() warnings mentioned in [af_readability] usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero, there are many warnings mentioning #[\ReturnTypeWillChange]. Most likely fixes are similar to ones for idiorm.

i’ve forked readability-php to main/readability-php: Fork of https://github.com/fivefilters/readability.php - readability-php - Tiny Tiny RSS but idk when i’ll bother to go through it making those annotations or w/e.

Fox I’ve been using this fork of readability for the feediron plugin: GitHub - j0k3r/php-readability: A fork of https://bitbucket.org/fivefilters/php-readability I haven’t tested it with 8.1 yet but might be worth keeping it bookmarked?

Edit: Actually taking a second look I’m not 100% sure they are are NOT the same library. There is the readability-php and php-readability and fivefilters appears to have both. The naming of these projects is a pain. Ignore me.

this is an older version i think. anyway readability itself is already fixed, the issue is some secondary dependencies.

I’ve been running my test instance on 8.1, on and off, and I’m getting FPM crashes (of the SIGSEGV kind) with the OIDC plugin enabled on Alpine 3.16. i think we should let this in the oven for a few more months.

web-nginx_1  | 2022/07/25 18:09:33 [error] 32#32: *125 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.5.1, server: , request: "GET /tt-rss/?code=... HTTP/1.0", upstream: "fastcgi://192.168.5.3:9000", host: "dev-debian.fakecake.org", referrer: "https://dev-debian.fakecake.org/"
app_1        | [25-Jul-2022 18:09:33] WARNING: [pool www] child 184 exited on signal 11 (SIGSEGV) after 391.430404 seconds from start
app_1        | [25-Jul-2022 18:09:33] NOTICE: [pool www] child 254 started

i mean even if application code is doing something wrong, as far as i’m concerned it shouldn’t crash FPM.

e: hmm i also got those reproduced somehow on 8.0 :thinking:

I haven’t seen that thus far (no OIDC plugin, though). ttrss-docker-compose@165d2fdd6f and tt-rss@7c45b3f789.

I’ve managed to collect a core dump, and backtrace was full of xdebug-related stuff. Disabling xdebug made everything work properly.

I’m seeing this on both 8.0 and 8.1 with xdebug not connected to vscode, although I think on 8.0 it crashes less (doesn’t crash sometimes? idk). So, false alarm.

e: it seems to be related to xdebug function tracing specifically. i wasn’t really using it, so no big loss.

e2: i’ve imported my live database to the test instance running with 8.1 and i’m seeing one more warning:

Implicit conversion from float 30.5 to int loses precision
1. plugins.local/api_resize_media/init.php(97): imagecopy({GdImage}, {GdImage})
2. plugins.local/api_resize_media/init.php(175): make_thumbnail(c

gonna let it run for a few days, see how it goes.

for people interested here’s what needs be fixed before 8.1 switch happens (any possible runtime warnings excluded):

dev-debian:tt-rss (master):$ docker run --rm -v $(pwd):/app --workdir /app php:8.1-cli php -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G
Unable to find image 'php:8.1-cli' locally
8.1-cli: Pulling from library/php
461246efe0a7: Pull complete
220ce72386de: Pull complete
62c455a2624a: Pull complete
732a85e47ea2: Pull complete
f11ac7fd9880: Pull complete
ae9b20a1a100: Pull complete
0cd2d67e3c71: Pull complete
595648229835: Pull complete
01b51111f923: Pull complete
Digest: sha256:fd48f3c38643d85baa949969d7068972c726a3666af43d96ad9a77ac5ad3813f
Status: Downloaded newer image for php:8.1-cli
Note: Using configuration file /app/phpstan.neon.
 2010/2010 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ----------------------------------------------------------------------------------------
  Line   plugins/af_readability/vendor/masterminds/html5/src/HTML5/Parser/StringInputStream.php
 ------ ----------------------------------------------------------------------------------------
  195    Return type mixed of method
         Masterminds\HTML5\Parser\StringInputStream::next() is not covariant
         with tentative return type void of method Iterator::next().
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute
         to temporarily suppress the error.
  203    Return type mixed of method
         Masterminds\HTML5\Parser\StringInputStream::rewind() is not covariant
         with tentative return type void of method Iterator::rewind().
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute
         to temporarily suppress the error.
  213    Return type mixed of method
         Masterminds\HTML5\Parser\StringInputStream::valid() is not covariant
         with tentative return type bool of method Iterator::valid().
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute
         to temporarily suppress the error.
 ------ ----------------------------------------------------------------------------------------

 -- ---------------------------------------------------------------------------
     Error
 -- ---------------------------------------------------------------------------
     Error message "Return type mixed of method
     Masterminds\HTML5\Parser\StringInputStream::next() is not covariant with
     tentative return type void of method Iterator::next()." cannot be
     ignored, use excludePaths instead.
     Error message "Return type mixed of method
     Masterminds\HTML5\Parser\StringInputStream::rewind() is not covariant
     with tentative return type void of method Iterator::rewind()." cannot be
     ignored, use excludePaths instead.
     Error message "Return type mixed of method
     Masterminds\HTML5\Parser\StringInputStream::valid() is not covariant with
     tentative return type bool of method Iterator::valid()." cannot be
     ignored, use excludePaths instead.
 -- ---------------------------------------------------------------------------

 [ERROR] Found 6 errors

PRs welcome.

after forking aforementioned library, i have CI builds passing using phpstan under 8.1, next step is rebasing docker hub images to 8.1 (maybe next wekeend) and switching dynamic setup (maybe today).

e: Merge branch 'testing-php81' · 2c11aa4a35 - ttrss-docker-compose - Tiny Tiny RSS - that’s the dynamic branch.