rryqszq4 / ngx-php

ngx-php - Embedded php7 or php8 scripting language for nginx module. Mainline development version of the ngx-php.
BSD 2-Clause "Simplified" License
582 stars 56 forks source link

Compile PHP from source in Ubuntu 22.04 in tests #166

Closed joanhey closed 1 year ago

joanhey commented 1 year ago

Ubuntu 22.04 also fail, if we build PHP :disappointed:. But work with disabled dtrace.

Added composite workflows and conditional tests, using strings in commit message:

~- [ci only 20] only build and test with Ubuntu 20.04~ ~- [ci only 22] only build and test with Ubuntu 22.04~ ~- [compile-php] also compile PHP, build and test with Ubuntu 22.04~

Less verbose

Without that strings, build an test with Ubuntu 20.04 and 22.04, but without compile PHP. Also we have the default [ci skip], to bypass all.

So for specific changes, we can have faster tests. And with composite workflows, it's easy to modify or add tests.

I will normalize the file names, and add an small info in readme.

Now use setup-php action, is faster (8-9 minutes all tests without compile php and with extra fixes) and fix JIT problem. Compile PHP and ngx-php, now need ~8m before +20m.

Added PHP Nightly (8.3) only in the development branch. When fail, it's easier to only check the last changes in php-src,

joanhey commented 1 year ago

~I can't test more without a merge :(~ Don't permit workflows in dirs.

joanhey commented 1 year ago

We need a more reliable URL for the socket test. Perhaps api.github.com (with a token we have 5.000 reqs/hour)

But for normal commits, I think that now is OK.

rryqszq4 commented 1 year ago

We need a more reliable URL for the socket test. Perhaps api.github.com (with a token we have 5.000 reqs/hour)

But for normal commits, I think that now is OK.

Agree with you, currently httpbin.org is unstable.

joanhey commented 1 year ago

The problem with Ubuntu 22.04, Debian 11, ... is a bug in Systemtap with new kernels. Also Openresty have the same problem: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019869

openresty is not going to maintain the systemtap scripts anymore

They have some projects to create the stp for Nginx. But all are deprecated, and recommend their new Openresty Xray paying $$. https://github.com/openresty/openresty-systemtap-toolkit https://github.com/openresty/stapxx https://github.com/openresty/nginx-dtrace

We can try to build the last Systemtap from source, and check with Nginx. Or try to create new stp, :/

We can compile PHP from source and disable dtrace, like I did. But is very slow. The PHP packages by default use--enable dtrace. And it's better test with the official packages.

Compiling without enable dtrace, are working OK with Ubuntu 22.04. In this branch was skiped the compile :(, but in my branch was OK. https://github.com/joanhey/ngx-php/actions/runs/4716823974/jobs/8364888531#step:6:71 Now I'll make some fixes to work with the tests.

Or create a dtrace version only, that only work with Ubuntu 20.04, Debian 10, ... with a branch in the repo. Very few people use dtrace, are very useful in good hands. And another without the dtrace code in ngx-php.

@rryqszq4 you will decide or talk about what we do.

joanhey commented 1 year ago

Ready to be merged. It's better add new things in other PRs.

And we need to decide what solution to use for dtrace problem.

joanhey commented 1 year ago

Before with 24 jobs: image

Now with 60 jobs: image

joanhey commented 1 year ago

@rryqszq4 is ready to be merged !! Thank you

joanhey commented 1 year ago

If you want I can change to test 22.04 only in development branch, and so you can merge in the master branch.

rryqszq4 commented 1 year ago

We can merge into development at first.

rryqszq4 commented 1 year ago

@joanhey I think this code not be necessary, so i want to remove it. https://github.com/rryqszq4/ngx-php/blob/development/src/ngx_http_php8_zend_uthread.c#L443-L451