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
Migrate to GitHub Actions #1766
Migrate to GitHub Actions #1766
Conversation
728028c
to
daa4774
Compare
What would it take to get those setup? The SSH functional tests have def found legit issues and regressions and altho I'm okay not having them for a short amount of time I don't see it as being something I'd be happy with for the long term. The other stuff is fine. We never had Windows tests before. They'd be nice but at least it doesn't feel like back peddling by not having them! Also, I note that the README.md changes don't replace the Travis Build Status indicator. https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge talks about how to add that. Would you be up for doing this for the 1.0 and 2.0 branches as well? The master branch is (currently) 99% the same as the 3.0 branch. The only (current) difference is that the master branch has #1751 whereas the 3.0 branch doesn't. It looks like GitHub Actions supports PHP down as low as 5.3: https://github.com/marketplace/actions/setup-php-action phpseclib 2.0 is, in theory, supposed to work on PHP 5.3+ so having it unit tested down to 5.3 would be good, composer issues notwithstanding. phpseclib 1.0 is supposed to, in theory, work on PHP 4.4+ but trying to do unit tests for PHP versions that old is just not reasonable. If short array syntax (which was introduced in PHP 5.4+) crops up in the 1.0 branch it's presence results in a bug report I'll fix it but I'm not necessarily proactively fixing it (altho linting, as #1710 attempted to add, would be cool) I'm playing around with a cherry-picked version of this to the 1.0 branch myself. Still a work in progress (altho it is behind your latest changes, now, since you seem to be doing rebasing) |
9430e2f
to
a5f9af7
Compare
a5f9af7
to
0779445
Compare
|
I cherry-picked this to the 3.0 branch and merged it into master! |
For phpseclib 1.0... for linting for versions of PHP below 5.3... maybe we could use the 4.4-5.2 Docker containers at https://github.com/phpseclib/docker-php |
In Travis CI you could have allow select builds to fail using The only versions of PHP the unit tests are now failing on is 8.2 and 5.6. On 8.2 it's due to a "PHP Fatal error: Uncaught Error: Call to undefined function each() in /Users/runner/work/phpseclib/phpseclib/vendor/phpunit/phpunit/src/Util/Getopt.php:38 On 5.6... I have no idea what it's due to. There's an intermittent segfault that's happening on the GitHub Actions build. Travis CI never had segfaults with 5.6 and I'm not able to reproduce it locally either. I thought that maybe I could isolate it down to a single unit test by selectively deleting unit tests but alas that did not help. It seems like it's combination of tests that's causing the error. Since it's a segfault I don't see how I can get any info on it from GitHub Actions. Maybe if they were using Docker containers to do the different PHP versions I could duplicate it locally but idk. In lieu of that I think imma just have to accept failing tests on PHP 5.6, sadly. |
Actually, I was able to reproduce the PHP 5.6 segfault on Ubuntu. Due to it's intermittent nature I guess I just hadn't tried it enough times lol. I was able to reproduce it in gdb as well and here's what the
Here's what
idk that there's gonna be much I'm gonna be able to do about this. I mean, maybe in theory, there are some code changes phpseclib could make to remedy this but maybe not. And if not... it's not like I can submit a bug report about this feature because PHP 5.6 is EOL. |
I almost wonder if we're seeing something like zendtech/ZendOptimizerPlus#146 going on for PHP 5.6. Some functions that are being unit tested employee randomization. Like prime number generation for RSA keys. You randomly generate a bunch of numbers and test each one to see if it's prime. And even the primality testing algorithm, itself (Miller-Rabin) employees randomization, by design. More specifically, Miller-Rabin is a probabilistic primality test - non-probabilistic (aka determinstic) primality tests exists, even in P, but they're galactic algorithms, so they're not very useful IRL. Anyway, I just mention that because, assuming that the issue is that too many objects are being created the randomized algorithms would (probably) explain why the problem is intermittent. Maybe the solution to this is to make it so that some unit tests simply aren't ran on PHP 5.6. |
I didn't know 5.6 was failing sometimes, I never ran into it yet. It sure is strange that it only happens after all the tests have ran. Must be something PHPUnit is doing at the very end. Edit: Funnily enough, I just hit the problem in my new PR #1768 |
Looks like the segfault's are for a multitude of reasons:
Thus far I've gotten 5 segfaults in gdb. 80% of them are the That said, the
Here's where destroy_op_array is defined (which is referenced in the first stack trace that I posted): https://github.com/php/php-src/blob/PHP-5.6.40/Zend/zend_opcode.c#L354 Nothing references dl-procinfo.c but, then again, we do have one I think it's gonna be best just to drop 5.6 from the unit tests. It can still be linted - just not unit tested :| Like even with my proposals for PHP 4.4 / phpseclib 1.0... my proposal isn't that we do unit tests on PHP 4.4. Rather, it's just that linting be done with the Docker containers (if possible). If people have specific issues with PHP 5.6 (or PHP 4.4 for phpseclib 1.0) they can create bug reports on github. |
I'll mark the PHP 5.6 tests as "continue-on-error" in #1768 (allows failure) |
Future issues: