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

Add php 8.0 support #94

Closed
stronk7 opened this issue May 8, 2021 · 7 comments
Closed

Add php 8.0 support #94

stronk7 opened this issue May 8, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@stronk7
Copy link
Member

stronk7 commented May 8, 2021

Right now it seems that php 8.0 is not well supported by moodle-plugin-ci

  1. I tried bumping a plugin (local_codechecker) to 8.0 and started getting problems on install.
  2. moodle-plugin-ci own tests (make, travis/gha...) are also failing badly.

So this is about to try to get everything working and passing with php 8.0. Sure that a bunch of dependencies will have to be updated too (phpunit, cs-fixer...) some only dev-dependencies but still.

Maybe, also, worth considering if we should drop support for 35_STABLE (and older) as far as it's (LTS) finished upstream (since May 10th, 2021).

This can be considered part of the php80 epic.

Once fixed, we should release a new version ASAP.

Ciao :-)

@ewallah
Copy link

ewallah commented May 11, 2021

Hurray, I ran my first successful moodle-plugin-ci check using PHP8.0.

I see only different behaviour in phpdocs and segmentations faults when querying code coverage (but these faults were also popping up lately in PHP7.3). 

@stronk7
Copy link
Member Author

stronk7 commented May 11, 2021

Yeah, the differences with phpdoc are caused by changes in PHP8 tokeniser, it's being fixed @ moodlehq/moodle-local_moodlecheck#72

@ewallah
Copy link

ewallah commented Dec 22, 2021

With GitHub Actions code coverage is working in PHP 8.0 and PHP 7.4 in master and MOODLE_311_STABLE branches when

  • using: coverage: xdebug
  • removing: phpdbg -d memory_limit=-1 -qrr from ci/src/Command/PHPUnitCommand.php file

In branches MOODLE_310_STABLE on PHP 7.4 and MOODLE_39_STABLE on PHP 7.3 the code coverage is ignored with the Error: Incorrect whitelist config, no code coverage will be generated.

Perhaps this approach can shed some light on the segmentation faults?

@ewallah
Copy link

ewallah commented Dec 29, 2021

The segmentation faults when generating code coverage seems to be in the CodeUnitCollection class:

SebastianBergmann\CodeUnit\CodeUnitCollection::mergeWith(): Argument #1 ($filename) must be of type string, SebastianBergmann\CodeUnit\CodeUnitCollection given, called in vendor/phpunit/phpunit/src/Util/Test.php on line 654

@andrewnicols
Copy link
Contributor

The segmentation faults when generating code coverage seems to be in the CodeUnitCollection class:

Don't use phpdbg. The segfault is not an issue on our end, but in phpdbg.

When we first started supporting coverage generation from within Moodle, there was a choice between xdebug version 2, and nothing. xdebug at that time would take a very long time to run, so when phpdbg was made more widely available we jumped at that as it gave code coverage generation in a fraction of the time.

Sadly, phpdbg is no good for coverage generation any more (it segfaults but there are other issues).

From Moodle 3.10 onwards we've been able to use pcov instead. It's easy to install, and run, and it's very fast. You can also use xdebug 3.

Don't bother with phpdbg. It's out our hands and there's very little that we can do except report the issues upstream with stacktraces.

@stronk7
Copy link
Member Author

stronk7 commented Jan 18, 2022

Please, let's create some issue about the problems with phpdbg and review that everything recommends to use pcov or xdebug.

Other than that', unless I'm missing something (please tell!), I think that we can close this because moodle-plugin-ci checks are working under php80 perfectly (but self-tests, but that's another story that will be touched @ #151).

Ciao :-)

stronk7 added a commit to stronk7/moodle-local_codechecker that referenced this issue Feb 13, 2022
@stronk7
Copy link
Member Author

stronk7 commented Jul 6, 2022

Hi,

I think that we can safely close this now.

Other than that, I imagine that, soon, we'll bump the requirements of moodle-plugin-ci to more actual versions (php, symfony...) but, as commented above, that's #151

If nobody argues against it, I'll close this in 24h.

Ciao :-)

@stronk7 stronk7 closed this as completed Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants