-
Notifications
You must be signed in to change notification settings - Fork 17
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
Make a change that tolerates php 7 #48
Conversation
@rosiel Have you experienced this error? |
Not sure that this makes sense as-is, especially without specific testing of it. Like, if we want to ensure 7.4 compatibility of some sense, we should probably have it in the CI harness, or risk it being broken again and again. That said, thinking we might be better suited by addressing compatibility with PHP versions somewhere...
which should hopefully build out a compatible list of packages for the given environment from the Could possibly make our CI try both, with both versions? Like: To try a ... probably similarly have to such a fallback implemented wherever things are used? Might go so far as to suggest against the use of ... or, could get into how other projects might support things across PHP version boundaries? Polyfills and the like? Late addition, but in terms of ... completely untested, and my Makefile-fu isn't terribly strong, but, that kind of thing (could probably break out to a separate script file, if necessary? Multi-line things in Makefiles seems to get weird). |
@adam-vessey
Suggesting people run a stack with dependency versions that are potentially untested is going to be problematic at best as those dependencies are constantly being updated. Although people could upgrade to PHP 8, the fact remains that Islandora's primary build method (isle-dc) doesn't support that yet and we should take this into heavy consideration. I think the title of this PR is probably off-topic for the scope of this. As it sits right now, if the user tries to run |
@DonRichards : This being more of a "template" project, those recommendations for including the By changing the version of PHP, you're already making compromises with respect to the integrity of the ... the alternative, if we want to support multiple versions of PHP, is to essentially roll separate branches (or forks?) for each version? Again: Might bear investigation into how other projects handle this issue. Something of an aside, but: not sure the assertion that |
@DonRichards : Another note: I'm not suggesting doing the Hypothetically, given what composer specs are possible, things could eventually get such that a |
@adam-vessey Sorry about the comment about isle-dc being the "primary". I was trying to be playfully biased on the topic, but I'm really bad at jokes, and my humor is pretty dry at times. There could be a compromise within the composer file. I just tested a slightly different modification that still works with isle that doesn't lock the dependencies to a specific version. I'll push that change to this. The simplest way I know of to regenerate the lock file without downloading or upgrading anything is to run |
@DonRichards :
Presently, the diff in the lock file isn't terribly complex... and presumably it would be tested after such a change, anyway? If really desired, could pass
... but this is essentially just to keep the diff of the Still doesn't address the situation of |
@adam-vessey Isn't the point of specifying the range in the composer.json file? "require": {
"php": "^7.4 || ^8", |
In isle it's simple enough to rebuild the composer.lock file if it's needed. Suppose the playbook uses this, it essentially needs to work without modification. In that case, we could have someone pull this update down onto a system that is running php8 and push the lock file to this PR, and I could add a PR to isle-dc to regenerate the lock file before running the composer install command. If that makes sense. |
It's indicating what's required/sufficient for installing the project, yes; however, the To able to build out for all versions, the lock file would need to potentially account essentially all version boundaries for all packages, as any package can include PHP constraints (as happened here). In my mind, the "safety" of using |
composer.json
Outdated
@@ -42,7 +42,7 @@ | |||
"drupal/matomo": "^1.19", | |||
"drupal/pdf": "^1.1", | |||
"drupal/rest_oai_pmh": "^2.0@beta", | |||
"drupal/search_api_solr": "^4.2", | |||
"drupal/search_api_solr": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like some trickery leftover from fixing the dependency knot? It probably should go back to ^4.2.
I'm fine moving this back down to be PHP 7 compatible until ISLE is on PHP 8. I did a bad. This was a breaking change and should have been managed through Semantic Versioning. We don't yet use it between ISLE/Playbook and the starter site. We don't even cut versions of the Starter Site. We don't do that because versioning seems to imply that you can do in-place upgrades (you can't). But we kind of need to version:
So I'm proposing:
|
@rosiel I can give that a try. |
OK, ready to test. |
Should I adjust the ci test? |
I went ahead and switched it. |
Feel like I should point out (again) that Composer has the diff --git a/composer.json b/composer.json
index 37dbac2..65411bd 100644
--- a/composer.json
+++ b/composer.json
@@ -70,7 +70,10 @@
"drupal/core-composer-scaffold": true,
"dealerdirect/phpcodesniffer-composer-installer": true
},
- "sort-packages": true
+ "sort-packages": true,
+ "platform": {
+ "php": "7.4"
+ }
},
"extra": {
"drupal-scaffold": { And this would tell Composer to always evaluate as though running with PHP 7.4, independent of the PHP runtime being used, but still allow installation on PHP 8 (assuming there's no conflicts preventing it)... would still be able to have the multiple versions under test, methinks? |
would this be a useful step for people running PHP 8 to be able to contribute to the starter site? I like that.
|
Thanks for having this discussion! Closing, as it's solved with #53 . |
make starter_dev
fails to build completely. This allows composer to determine a solution that fits the current setup (allows for php 7)To test
This should trigger the following error.
Then switch to this PR and run the above steps and it should completely.