Problem/Motivation
As found in #2976394: Allow Symfony 4.4 to be installed in Drupal 8, when Drupal 8 is installed with Symfony 4, our composer integration test fails, because it ensures all dependencies support PHP 5.5.9.
Proposed resolution
We support PHP 5.5.9 until March 2019, but while this test helps to ensure we don't drop support, DrupalCI test runs will immediately fail with a clear composer error message on PHP 5 builds, so we can rely on per-commit testing instead.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | 3020301-22.patch | 2.09 KB | catch |
| #19 | 3020301_19.patch | 120.06 KB | mile23 |
| #10 | 3020301-10.patch | 2.1 KB | effulgentsia |
| #8 | 3020301-8.patch | 1.02 KB | catch |
| #2 | 3020301-2.patch | 549 bytes | catch |
Comments
Comment #2
catchHere's just that test change, obviously it creates a mis-match between this value and the one in Drupal.php, but due to the way the test is written I think it will be green. If it's green, we'll need to modify the comment to indicate why it's not a match.
Comment #3
effulgentsia commentedUbuntu 16.04's default PHP version is 7.0, which will be supported by Ubuntu until 2021. Therefore, do we need to support PHP 7.0 beyond 8.7's release? If so, would it be possible to retain a test that ensures PHP 7.0 compatibility of dependencies (e.g., via platform configuration, which would then implicitly pin Symfony to 3.x) in addition to a separate composer integration test for PHP 7.1.3+ / Symfony 4?
Comment #4
berdirThere's also #2992116: Bump core dependencies minimum version to PHP 7.0
Comment #5
catchNote this patch does not increase the requirement or update any dependencies, it only increases the version we test with, so it's different from adding a hard requirement like #2992116: Bump core dependencies minimum version to PHP 7.0.
It might but I don't really have an idea how if we also want to allow Symfony 4 installs, unless we somehow tried to detect the Symfony version but then that undermines the point of the test - the main thing we need something like this for is #2874198: Create and run dependency regression tests for core / #2976407: Use drupalci.yml for composer dependency min/max testing - DO NOT COMMIT.
Comment #6
wim leersPer #5, clarifying issue title :)
(I was coming here to say something like #4, until I read #5.)
Comment #7
xjmWe need some docs here as per #2. Thanks!
Comment #8
catchHere's some docs.
The more I think about this the more I don't really think there's a way to test both 7.0 and 7.1 - either we set the testing floor at 7.0 or we don't. Whatever we add to make tests pass with PHP 7.1 means that the test will pass with PHP 7.1, and remove the hard protection to keep things on 7.0. i.e. if we fingerprint Symfony 4, then say someone posts a patch to update to Symfony 4, that'll pass, and this is what the 5.5.9 check currently prevents on purpose.
I don't think it completely undermines the point of the test because we also want to ensure that we stick to the lowest supported PHP version that Symfony supports, which at the moment is 7.1.3 - if some other depdendency introduced a version relying on PHP 7.3, we'd want the test to fail with that version.
Comment #9
jibranComposer install worked on PHP5 so all good here.
Comment #10
effulgentsia commentedHow about this instead? Just a docs change (and rename of the constant), but I'm curious if this captures the intent of this issue more clearly, or if I'm misunderstanding the intent.
Comment #11
effulgentsia commentedThough if the docs in #10 are correct, then why don't we just leave 8.7.x as-is, and just raise the value of the constant in the patches that are updating to Symfony 4, and other D9-only library versions?
Comment #12
jibran7.1 will be unsupported after 1 Dec 2019 so for that reason this name is incorrect. As per http://php.net/supported-versions.php min D9 PHP version could only be 7.2.
Comment #13
effulgentsia commentedIf we're already willing to decide that D9's minimum PHP version will be 7.2, then why change our composer integration test to 7.1.3 instead of 7.2?
Comment #14
jibranI think setting up D9's minimum PHP version to an unsupported release is not a right thing to do so I'd say yes, we should set it to 7.2.
Comment #15
catchIt's possible to raise the value every time we post a Symfony 4 patch, I posted this issue to try to not need to do that though.
However we'll need to do something like this to support #2976407: Use drupalci.yml for composer dependency min/max testing - DO NOT COMMIT (i.e. core and/or contrib testing of 8.x with Symfony 4 and/or 5). Allowing contrib test runs against Symfony 4/5 with 8.x would help everyone get ready for them being required.
Comment #16
wim leersThat would indeed be very valuable!
Comment #17
alexpottIf we've got #2976407: Use drupalci.yml for composer dependency min/max testing - DO NOT COMMIT in place can't we remove this test? I think @mile23 might already by testing our components using travis with min / max testing.
Comment #18
mile23I was wondering why someone was poking at #2976407: Use drupalci.yml for composer dependency min/max testing - DO NOT COMMIT :-)
The reason for the test is to make sure that the lock file doesn't include dependencies that are outside our target PHP versions. That way d.o won't package a tarball that is incompatible.
We did this in lieu of adding a
config:platform:php:5.6to composer.json because it would mean that anyone (unfortunately) using drupal/drupal to install with Composer would be stuck with PHP 5.6.So there are a bunch of solutions, here in order of real preference:
The plan is that we're going to relegate drupal/drupal away from any use other than assembling the dependencies for a dev codebase. That's going to be real after we get #2982680: Add composer-ready project templates to Drupal core. I'm thinking we should remove this test when that happens, as long as we have dependency regression tests. We don't have that yet, so the test should stay.
The real problem with this test is that it runs after you've updated to the new PHPUnit version, so your lock file has a bunch of updated dependencies in it. So therefore, to get around it, mark it as skipped in your patch, or you can revert or delete composer.lock before running tests in your CI process.
The change here should reflect the minimum PHP version supported by 8.7.0. If we're doing Symfony 4 and that needs 7.1, then there's your answer.
Comment #19
mile23Given the current PHP requirements page: https://www.drupal.org/docs/8/system-requirements/php-requirements
...It seems like we shouldn't need to guarantee PHP 5 for Drupal 8.7.0 release, just PHP 7.0.x.
So this means a couple of things:
For this issue, we should bump up the minimum version in the test. This isn't sufficient for Symfony 4, but it's the listed requirement for Drupal 8.7.0.
Out of scope here, we should remove all the PHP 5 scaffold code like the existence of drupal-phpunit-upgrade.
How I made this patch:
ComposerIntegrationTest::MIN_PHP_VERSIONto 7.0.8.config:platform:phpto 7.0.8.composer updatecomposer update --lockso we don't have a content hash problem.I arrived at PHP 7.0.8 because that's the minimum for symfony/http-foundation, according to messages like this:
Anyone who's using PHP 5 can then use
composer updateand pray, or remove the lock file and useinstall. Theoretically, we could have tests to see whether we actually support PHP 5, but then we'd be supporting PHP 5.And, most preferably of all, hopefully we'll get #2982680: Add composer-ready project templates to Drupal core before 8.7.0 release and people won't be using our lock file.
Comment #20
catchOK I thought about this more, and I think we should remove the test entirely.
If we update to a set of PHP dependencies which require > PHP 5, the test fails immediately with a clear error from composer: https://www.drupal.org/pift-ci-job/1171597
Therefore if we always request a PHP $lowest_version test run when we update composer.lock, we'll always catch these without the dedicated test. If something slips through, then the branch tests (commit or daily) will catch it soon enough.
No new patch yet but it'd just be removing the test itself.
Comment #21
xjmDiscussed with @catch and I agree with #20; I think it's okay to either update the test to increase the version number, or to remove the test entirely. We can just make it part of our process to run tests on all PHP versions prior to commit for dependency update issues, the same way that we run tests on all databases when we make changes to the Views or database APIs. And the sooner we unblock #2976394: Allow Symfony 4.4 to be installed in Drupal 8, the better.
We can't do #19 quite yet though. :) The plan is to keep all branches (including 8.7.x) 100% PHP 5-compliant until 8.7.0, in order to keep backports safe, and thereafter to avoid PHP 5 regressions in 8.7.x and earlier so that sites can still update to security releases even if they're on PHP 5. Only 8.8.x should update to non-PHP-5-safe dependency versions. See #2842431-176: [policy] Remove PHP 5.5, 5.6 support in Drupal 8.7 for specifics.
Comment #22
catchHere's a patch for that.
Comment #23
mile23OK, so because of the way we build the tarball that means leaving the test in until just after the 8.7.0 release, or really until the planned stop of support for PHP 5. Which is a little unclear, by the way. :-)
The test is supposed to be annoying. It is literally the only automated test that says we support PHP 5.
If anyone wants to RTBC #22 I won't object, tho, because I don't want to be as annoying as that test.
Comment #24
catchNo it just means we need to test any dependency updates on PHP5 explicitly, or rollback if we forget to do that and break HEAD.
The tests stops us breaking HEAD, but DrupalCI prevents us from tagging a release, because the PHP5 tests can't even run composer install without an error.
Comment #25
mile23Like I said: If someone wants to RTBC that's fine and go for it. Core 8.7.x currently has a PHP 5 build on commit in DrupalCI.
Comment #26
catchComment #27
alexpottWhilst we support PHP5 we need to be running at least one test run against it. We are so I'm not sure what this test really buys us. So +1 to removing this. Once we have #2976407: Use drupalci.yml for composer dependency min/max testing - DO NOT COMMIT this test is moot anyways.
Comment #28
effulgentsia commentedCrediting @xjm and @alexpott for their review of #20 / #22.
Comment #29
effulgentsia commentedRemoving credit from myself, as my earlier work is moot with the new direction.
Comment #31
effulgentsia commentedPushed to 8.7.x.