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

allow php 8 #1313

Closed
wants to merge 1 commit into from
Closed

allow php 8 #1313

wants to merge 1 commit into from

Conversation

garak
Copy link
Contributor

@garak garak commented Dec 12, 2020

Q A
Branch? 2.0
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #1309
License MIT
Doc PR not needed

Allow PHP 8

Copy link
Contributor

@fbourigault fbourigault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for handling this!

To keep the matrix pilosophy I introducted in #1202, I requested some changes.

The major ideas in the matrix is to:

  • test each supported php version with latest dependencies.
  • test latest supported php version with code coverage enabled.
  • test lowest dependencies with oldest and latest supported php versions.
  • test each supported Symfony version with it's minimum required PHP.

@@ -21,7 +21,7 @@ matrix:
- php: '7.2'

This comment was marked as resolved.

.travis.yml Outdated
@@ -21,7 +21,7 @@ matrix:
- php: '7.2'

# Enable code coverage with the latest supported PHP version
- php: '7.3'
- php: '7.4'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 8.0. This would match the comment.

.travis.yml Outdated
@@ -40,20 +40,23 @@ matrix:
- SYMFONY_VERSION=3.4.*
- php: '7.1'
env:
- SYMFONY_VERSION=4.3.*
- SYMFONY_VERSION=4.4.*

- php: '7.2.9'
env:
- SYMFONY_VERSION=5.0.*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be kept as Symfony 5.0 isn't supported anymore?

.travis.yml Outdated

- php: '7.2.9'
env:
- SYMFONY_VERSION=5.0.*

- php: '7.2.9'
- php: '7.4'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not change as minimum supported version of Symfony 5.1 is 7.2.

.travis.yml Outdated
env:
- SYMFONY_VERSION=5.1.*

- php: '8.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 7.2.9 as Symfony 5.2 requires at least this version.

.travis.yml Outdated
env:
- COMPOSER_FLAGS="--prefer-lowest"

# Test each supported Symfony version with lowest supported PHP version
- php: '7.1'
- php: '5.5.9'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one must be kept on 7.1 as it's the minimal PHP version required by this bundle!

@fbourigault
Copy link
Contributor

The matrix looks good now, but the build is failing.

7.X failures are unrelated with this PR and I started to fix those in #1315.

@dbu
Copy link
Member

dbu commented Dec 15, 2020

#1315 fixed the existing builds, can you please rebase this PR on master?

@garak
Copy link
Contributor Author

garak commented Dec 15, 2020

No luck for php8, imagemagick does not compile 😞

@garak
Copy link
Contributor Author

garak commented Dec 15, 2020

Related: Imagick/imagick#358

@fbourigault
Copy link
Contributor

You can add an IMAGINE_ENABLED environment variable with de default value of true, install imagick extension only if this variable value is true and set the variable to false for PHP 8.0 jobs.

A few tests will be skipped as imagick won't be available, but that's acceptable as users won't be able to have such setup (php 8 + imagick).

@garak
Copy link
Contributor Author

garak commented Dec 16, 2020

Still not working since a dependency can't install. Related issue: php-enqueue/enqueue-dev#1108

@dbu
Copy link
Member

dbu commented Dec 16, 2020

as enqueue is optional, could we have the php 8 build remove it from composer before installing and have the tests that rely on enqueue skip when enqueue is not available?

@coveralls
Copy link

coveralls commented Dec 16, 2020

Coverage Status

Coverage decreased (-0.4%) to 81.047% when pulling 11c7f89 on garak:allow-php8 into 4704b34 on liip:master.

@garak
Copy link
Contributor Author

garak commented Dec 16, 2020

OK, I think we're almost there...
It looks like phpunit 7.5 doesn't work well with php8, so I think we should give up with the possibility of testing php8 with it.
I would remove SYMFONY_PHPUNIT_VERSION="7.5" from line 41 of travis config, what do you think?

@dbu
Copy link
Member

dbu commented Dec 16, 2020

yeah, phpunit 7 does not work on php 8. afaik phpunit 8 now works on both php 7 and 8, lets try that? phpunit 9 brings a couple of BC breaks that means we would need to adjust assertions and such. we eventually want to do that, but should not mix in too many things into one PR

can you try explicitly setting it to the current 8.x version?

@garak
Copy link
Contributor Author

garak commented Dec 16, 2020

Unfortunately, even phpunit 8.5 is failing (due to missing return type on tearDown)

@dbu
Copy link
Member

dbu commented Dec 16, 2020

this has been fixed in symfony 3.4.23
i suggest changing the composer.json to "symfony/framework-bundle": "^3.4.23|^4.3|^5.0",

.travis.yml Outdated
yes | pecl install imagick;
fi
- if [[ "$ENQUEUE_ENABLED" == "false" ]]; then
composer remove --dev enqueue/enqueue-bundle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add the --no-update option as the update is performed at install step.

@garak
Copy link
Contributor Author

garak commented Dec 16, 2020

Any idea of the reasons of last failures? 😞 Why images are not found?

@fbourigault
Copy link
Contributor

Could you rebase please? I will look at those failure localy.

- XDEBUG_MODE=coverage
- PHPUNIT_FLAGS="-v --coverage-text --coverage-clover var/build/clover.xml"

# Minimum supported dependencies with the latest and oldest supported PHP versions
- php: '7.1'
env:
- COMPOSER_FLAGS="--prefer-lowest"
- php: '7.3'
- php: '8.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the last failing job. I think we should stick with php 7.4 here as having php 8.0 with --prefer-lowest would work only if any dependencies doesn't declare supporting php with the >= operator without being compatible with php 8.0.

Note: Symfony does the same (see https://github.com/symfony/symfony/blob/5.x/.travis.yml#L23-L30)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i agree. we could also drop the "latest php version prefer-lowest" completely. the main thing we care about is "lowest php version with prefer-lowest".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The highest supported PHP version with lowest dependencies tests the case where, in a project, an unrelated dependency lock one of our dependency to a lower version than expected.

I took the idea from Symfony IIRC but maybe this is already covered with other jobs. I’m neutral about keep/remove this job from the matrix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is always a chance of some combinations of versions having a problem. but builds are fast and parallel, so lets change this to 7.4 for now.

@fbourigault fbourigault mentioned this pull request Dec 17, 2020
@nicwortel nicwortel mentioned this pull request Dec 24, 2020
@lsmith77
Copy link
Contributor

closing in favor of #1325

@lsmith77 lsmith77 closed this Dec 30, 2020
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.

5 participants