Closed (fixed)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Base system (internal API)
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2012 at 05:57 UTC
Updated:
15 Jul 2013 at 13:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
greg.1.anderson commentedHere is what I propose. If we had a strong need to require a later version of php due to a Drush requirement, then I think it would be fine to up the minimum php in Drush master. If this is just for D8, though, there are still a bunch of places where I run into php 5.3.2 pre-installed, sometimes on servers I don't directly control. I've upgraded some, but I'd rather take more time before making this a global requirement.
Here's the change log for php 5.3.5 (with 5.3.4 and 5.3.3 below).
http://us.php.net/ChangeLog-5.php#5.3.5
Comment #2
greg.1.anderson commentedComment #3
greg.1.anderson commentedTurns out that node_save can have problems with php < 5.3.5, so this isn't just a Drupal 8 issue. I'm going to take the @msonnabaum solution here. (Upgrade. Your. Shit.)
Comment #4
anarcat commentedwait what? node_save() has problems with PHP 5.3.5? in which drupal version? and if so why weren't the requirements updated? reminder: Drupal 7 depends on PHP 5.2.5 or later.
https://drupal.org/requirements/php
The above page also mentions that Drupal 6 contrib modules are mostly unusable with PHP 5.4 (which I can confirm, at least views is really annoying), and I suspect Drupal 7 has its own issues with it. Often PHP 5.4 is the solution to fix this drush dependency: it's the only upgrade path available in Debian for example. It's also the version available in Fedora...
So what, exactly, makes Drush incompatible with PHP 5.3.3? and why the heck do we force a version comparison instead of letting stuff break? a warning could be sufficient...
Comment #5
anarcat commentedand here's a patch for ya.
Comment #6
greg.1.anderson commented#5 completely removes the floor for php versions. I could see perhaps allowing "slightly older" versions of php to work, but it seems to me that there should always be some minimum version at which we bail out and do not run. Nothing below 5.2.4, for example. Before we lower the absolute floor, though, we should investigate how the unit tests do with older versions of php.
I regret that I did not put a link in to the source that described the problems that can happen with node_save and php < 5.3.5; I read this a long time ago, I am no longer prepared to speculate why the release notes were not updated. Regarding the upgrade path, the page you quote has a recommendation for getting to 5.3.10 on Debian.
Comment #7
greg.1.anderson commentedThere is a proposal to use closures in #2008928: Make config edit filter instead of bailing out when item does not exists.. If we are going to roll back to 5.2.x as a minimum version, we should do so before that issue is decided. (Early indications are "no closures", though.)
Beyond that, I do not know if there is anything in Drush that was unconsciously added to Drush that requires 5.3.x. A lot of time has gone by since last November; I'm surprised that no one but me has has any issue with lack of 5.2 support since then. Since so much time has gone by, my concern is that there may be a number of failures on 5.2 by now. Since we're so close to the Drush 6 release, I think we may be stuck with 5.3 and later now. If php 5.2 users really are in the minority, they could stick with Drush 5.
Comment #8
moshe weitzman commentedIf the test suite passes, I'm OK with drush6 moving back to 5.2.
Comment #9
jonhattanIf we're moving back to 5.2, some changes in 8dca558da0fd2eb91552d3fb554365840e48b4af must be reverted. Also 31b9bb0ba6c0f10d36fdd2baa82a6f29e9360dde
In general
git log -S"5.3"should be reviewed.Comment #10
ergonlogicI believe that the point in #4 was to continue support Drupal 6 and Debian Squeeze. Even if 5.2 seems like a bit of a stretch, it seems clear that we could lower the requirement at least that far (5.3.3), no?
Also, the original issue suggested:
I certainly like the idea of de-coupling Drush's required PHP version from Drupal's. Would this imply that we'd move the Drupal version-specific check into _drush_bootstrap_drupal_root()? In that case, perhaps drush_drupal_major_version() shouldn't depend on bootstrapping Drupal at all, but should rather just check for the existence of core/includes/bootstrap.inc (et. al.).
Comment #11
jonhattanWhat's the point with 5.3.3, Drupal 6 and Squeeze? dotdeb.org provides php 5.3.26 for squeeze.
btw, drush_drupal_major_version() only needs the path to drupal root. No further bootstrap.
Comment #12
anarcat commentedSome people (including me and many others) do not run Dotdeb packages. They compile PHP differently and the upgrade path to and from dotdeb is not exactly trivial.
The point of D6, PHP 5.3.3 and squeeze is that this is what squeeze is. It's a stable and controled environment that will only feature security fixes. Who knows what went into dotdeb's version of 5.3.26?
Using your logic, we might as well say that people can easily compile PHP themselves and could run PHP 6.x on Debian potato without problems. Heck, we should just rewrite Drush in Ruby while we're here, that would make for fun version dependencies.
I find it amazing that we go through all those crazy hoops to support Windows but we can't support Debian properly or Ubuntu LTS 10.04.
As for the check itself: i am not proposing to remove the check, I am proposing to make it a warning. If drush will fail with older PHP versions, why don't we let if fail? How do we know it will really fail? Maybe some people did some hackery to work around their issues in their PHP compilation (it could very well be the case for squeeze's 5.3.3).
This reminds me of problems with checking if we have write access before writing - you should just try to write and rollback properly. See also http://en.wikipedia.org/wiki/Time_of_check_to_time_of_use
Comment #13
greg.1.anderson commentedI'm still not in favor of removing the check. We should only allow supported configurations to run. Per #9, we know that 5.2 will fail, so we're not going to let it run.
Issues with the way Drush detects and reports error conditions (e.g. unwritable files) should be raised in a separate issu.
I think it would be quick and safe to roll the check back to PHP 5.3.3. If anyone wants to go back further, then we need to re-apply the necessary PHP 5.2 workarounds identified in #9. Per #8, it's okay to go back to a prior version if someone wants to do the work to test it and make sure it works. If no one wants to do the work, then we'll stick with what's already committed.
Comment #14
anarcat commented8dca558da0fd2eb91552d3fb554365840e48b4af requires 5.2.1, so that's okay.
31b9bb0ba6c0f10d36fdd2baa82a6f29e9360dde is less clear - it says there's inconsistencies in mime type detection in 5.2, but doesn't say which version exactly.
the run-server stuff needs 5.3, but that's okay. i looked at git log -S 5.3 until 2 years back and that's all i found.
so i really think that requiring a higher 5.3 version is premature. 5.3.0 should work for everything that was mentionned here, and some 5.2 release may just work for most of drush.
it would be a damn shame if drush would just lock people away because they are running an older PHP version. at least allow them to *start* drush and they get *something*, even if with reduced functionality. worse case, a kill switch for lower PHP versions should be opt-out with an option, say --yes-i-know-i-am-an-old-fart that would override the version check...
otherwise we are just leaving people out.
i hate it when i need to throw away perfectly working devices after 5 years. software should be the same, and we should strive to avoid obsolescence, not encourage it.
Comment #15
greg.1.anderson commentedOkay; roll a patch and run the test suite against it on a system with an appropriately old php version on it, and we can put it in. If we go back to 5.2, runserver could explicitly check for 5.3.
Comment #16
greg.1.anderson commentedFYI, just saw this via Twitter: http://news.php.net/php.internals/67734. The first 5.3 release was in 2009. The last 5.2 release was in 2011. All php releases are here: http://php.net/releases/index.php
I know, this does not invalidate the comments about old php releases; there is just something ironic about the fact that 5.3 is now EOL, and we are still discussing whether or not it should be required. If we're going to go back to 5.2, someone should submit a patch before Drush 6 is released.
Comment #17
ergonlogicI tested the latest HEAD (d543b36faf6) against PHP 5.3.3, and while there were 2 errors, I don't believe either were related to this:
I've attached a patch that reduces the minimum PHP version to 5.3.3, as well as introducing a new global option, "--no-min-php-error", to allow the error to be ignored.
Comment #18
greg.1.anderson commentedI guess that --no-min-php-error is acceptable in concept, although I don't know how useful the proposed implementation is, since it cannot be placed in a drushrc.php file. Folks would try to do it, and we'd get support and feature requests. I don't think we should create a confusing situation like this.
I think that a better strategy is:
1. Roll back the 5.2-support code identified in #9.
2. Make the absolute minimum php 5.2.x (x up for discussion; 0 or 4 or something)
3. In _drush_bootstrap_drupal_root, check for php 5.3.x for Drupal 8+. (Edit: Per #15, runserver should also explicitly test for php 5.3)
I don't think we should allow php below 5.2.0 in any event, even with a flag. We could introduce a flag at step 3 to subvert the version check, but at that point it wouldn't be of too much help to do so, so I'm indifferent about including it or leaving it out.
In absence of doing that much work, I think that going back to 5.3.3 w/out the --no-min-php-error. Regarding the failures in #17, the qd test commonly fails on some systems (not sure why, but perhaps no sqlite available?), but it works in general, so I think this one can be ignored. The testPhpOptionsTest bears further investigation before reverting to 5.3.3; I'm not sure this is innocuous.
Comment #19
ergonlogicRe. testPhpOptionsTest, I had /usr/bin/drush linked directly to drush.php, and so was bypassing the shell script. That test passes now.
fwiw, I'd be fine with just rolling back to 5.3.3, as I don't have a 5.2 environment to test the rollbacks mentioned in #9.
As for an '--no-min-php-error' option, it's just a nice-to-have, imo. We could avoid documenting it in the help output by doing something like:
Comment #20
greg.1.anderson commentedI'd be happy with just rolling back to 5.3.3 now, and leaving 5.2.x for a potential later improvement, if others agree.
I don't think there's much value to providing a cli-only option to skip the minimum php version. Maybe an environment variable would work better, as that would be something that you could set in your bashrc and forget. I don't think we should allow earlier than 5.2.0, though, even with an environment variable set.
Comment #21
ergonlogicHere's a patch that lowers the minimum PHP to 5.3.3 and skips the error in an environment variable (DRUSH_NO_MIN_PHP) is set.
It seems to me that if someone sets this env var, they'd have to be aware that they are taking their chances, and we should probably let them.
Comment #22
moshe weitzman commentedCommitted. Thanks for sticking with this.
Comment #23
moshe weitzman commentedIf anyone has an idea about where to document the new Env Variable, let us know or write a docs patch. Thanks.
Comment #24
anarcat commentedthanks!
Comment #25
ergonlogicHow about documenting it in examples/example.bashrc?
Comment #26
helmo commented#25 looks good.
Comment #27
moshe weitzman commentedCommitted.