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

PHP 8.1 compatibility #489

Merged
merged 12 commits into from Dec 16, 2021
Merged

PHP 8.1 compatibility #489

merged 12 commits into from Dec 16, 2021

Conversation

tidal
Copy link
Member

@tidal tidal commented Nov 27, 2021

PHP 8.1 has been released on Nov. 25th.

So this PR just adds PHP 8.1 to the test matrix.

@tidal
Copy link
Member Author

tidal commented Nov 27, 2021

Seems as some packages have to catch up with PHP8.1.
We can just leave this PR open until the PHP8.1 CI run works.

@bobstrecansky
Copy link
Collaborator

Looks like the composer package for qossmic/deptrac-shim was updated recently; we probably just need to update the version we use (there is v0.18.0 now)

@tidal
Copy link
Member Author

tidal commented Dec 2, 2021

Run vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no -vvv
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no -vvv
shell: /usr/bin/bash -e {0}
PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.0.*.
Current PHP version: 8.1.0.
To ignore this requirement please set PHP_CS_FIXER_IGNORE_ENV.
If you use PHP version higher than supported, you may experience code modified in a wrong way.

Looks like php-cs-fixer still has problems with 8.1. There are changes to address this in the master branch, but they are not live, yet. I'll temporarily set the php-cs-fixer version to 'dev-master' just to see, if there are more issues.

@tidal
Copy link
Member Author

tidal commented Dec 2, 2021

Ok, PHP 8.1 support in php-cs-fixer dev-master seems not to be fully there as well, so I'll revert the version again, and check back in a few days.

@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

Merging #489 (d8d4532) into main (597a811) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #489   +/-   ##
=========================================
  Coverage     95.11%   95.11%           
  Complexity      946      946           
=========================================
  Files            95       95           
  Lines          2313     2313           
=========================================
  Hits           2200     2200           
  Misses          113      113           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 597a811...d8d4532. Read the comment docs.

@bobstrecansky
Copy link
Collaborator

Looks like php-cs-fixer requires up to 8.0, but does not have 8.1 as a requirement:

https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/composer.json#L17

I've opened an issue with them in order to get PHP 8.1 support added.
PHP-CS-Fixer/PHP-CS-Fixer#6145

@bobstrecansky
Copy link
Collaborator

PHP CS Fixer doesn't yet suport 8.1:

PHP-CS-Fixer/PHP-CS-Fixer#5891

We will either have to wait for that or use a different library.

@brettmc
Copy link
Collaborator

brettmc commented Dec 13, 2021

php-cs-fixer + 8.1 support dropped yesterday (v3.4.0) so this should be good to go, now.
It would be nice to have an "allowed to fail" setting, but I haven't been able to find a way to implement it for github actions...

@tidal tidal requested a review from brettmc as a code owner December 13, 2021 01:58
@brettmc
Copy link
Collaborator

brettmc commented Dec 13, 2021

Getting closer - now it looks like we are waiting on a protobuf fix for 8.1: protocolbuffers/protobuf#9293
The complaints in integration tests look reasonable and easy enough to fix (move required parameters to before optional)

@tidal tidal changed the title Add PHP 8.1 to test matrix PHP 8.1 compatability Dec 13, 2021
@tidal tidal changed the title PHP 8.1 compatability PHP 8.1 compatibility Dec 13, 2021
@brettmc
Copy link
Collaborator

brettmc commented Dec 13, 2021

I've been playing with allowing some jobs to fail and found https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-preventing-a-specific-failing-matrix-job-from-failing-a-workflow-run
I think this is the way to do it:

strategy:
  fail-fast: false
  matrix:
    php-versions: ['7.4', '8.0']
    experimental: [false]
    include:
      - php-versions: 8.1
        experimental: true
runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}

@tidal
Copy link
Member Author

tidal commented Dec 14, 2021

I've been playing with allowing some jobs to fail and found https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-preventing-a-specific-failing-matrix-job-from-failing-a-workflow-run I think this is the way to do it:

strategy:
  fail-fast: false
  matrix:
    php-versions: ['7.4', '8.0']
    experimental: [false]
    include:
      - php-versions: 8.1
        experimental: true
runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}

If we allow the PHP8.1 checks to fail, there is no much value in running them in the first place imo, or maybe I'm just not understanding, what you are trying to achieve by doing this.

@tidal
Copy link
Member Author

tidal commented Dec 14, 2021

Getting closer - now it looks like we are waiting on a protobuf fix for 8.1: protocolbuffers/protobuf#9293 The complaints in integration tests look reasonable and easy enough to fix (move required parameters to before optional)

I don't think we need to wait on protobuf to fix things. The is just an indicator for our code being to tightly coupled to the protobuf library, so stuff is leaking into our unit tests. I will address this in a different PR.

However there is still a problem with with this line, which lets the unit test run crash. We should discuss in the next meeting, if we want to support such edge cases like context switching inside of a Fiber in the main library by using FFI. I don't think the dev images have even FFI installed, but I have tested this on my local system. I personally like all the stuff one can do with FFI, but it is still marked as experimental.

@brettmc
Copy link
Collaborator

brettmc commented Dec 14, 2021

If we allow the PHP8.1 checks to fail, there is no much value in running them in the first place imo, or maybe I'm just not understanding, what you are trying to achieve by doing this.

It means we can start running our tests against new PHP versions as soon as possible (before they go GA), and find issues earlier. In the case of 8.1, once it does go green, we switch off "experimental" and then it must always pass.

@tidal
Copy link
Member Author

tidal commented Dec 14, 2021

It means we can start running our tests against new PHP versions as soon as possible (before they go GA), and find issues earlier. In the case of 8.1, once it does go green, we switch off "experimental" and then it must always pass.

Ok, got you. let's talk about this in tomorrows meeting, as the FFI issue will not just turn green, the tests are crashing after 51%.

@brettmc
Copy link
Collaborator

brettmc commented Dec 16, 2021

Related issue: #515

@brettmc brettmc mentioned this pull request Dec 16, 2021
3 tasks
@tidal tidal merged commit 04ba5c9 into open-telemetry:main Dec 16, 2021
@tidal tidal deleted the php8.1 branch December 16, 2021 23:10
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.

None yet

3 participants