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

Altis 12 not fully compatible with PHP 7.4 due to psr/log subdependency #590

Open
1 task
kadamwhite opened this issue Oct 4, 2022 · 3 comments
Open
1 task
Labels
bug Existing functionality isn't behaving as expected

Comments

@kadamwhite
Copy link
Contributor

kadamwhite commented Oct 4, 2022

Steps to reproduce:

  1. We updated a dev site to Altis 12, with all dependencies, which upgraded psr/log from 1.1.4 to 3.0.0.
  2. We deployed this branch to a dev environment still running PHP 7.4, per the docs page which states that v12 should support both PHP 7.4 and PHP 8.
  3. Login stopped working on Development, with an error,
syntax error, unexpected '|', expecting variable (T_VARIABLE)
  • That error occurred in file vendor/psr/log/src/LoggerInterface.php within psr/log v3.0.

psr/log versions since 2.0 specifically requires php: >=8.0.0, per packagist and the package's composer.json.

composer why output showing that psr/log evaluates to v3 in Altis 12:

composer why -t psr/log
psr/log 3.0.0 Common interface for logging libraries
└──monolog/monolog 2.8.0 (requires psr/log ^1.0.1 || ^2.0 || ^3.0)
   ├──altis/cloud 12.0.4 (requires monolog/monolog ^2.5)
   │  └──altis/altis 12.0.0 (requires altis/cloud ^12.0.0)
   │     └──humanmade/project dev-php-8-compat (requires altis/altis ^12.0.0)
   ├──google/apiclient v2.12.6 (requires monolog/monolog ^1.17||^2.0||^3.0)
   │  └──humanmade/project dev-php-8-compat (requires google/apiclient ^2.0)
   └──maxbanton/cwh v2.0.2 (requires monolog/monolog ^2.0)
      └──altis/cloud 12.0.4 (requires maxbanton/cwh ^2.0)
         └──altis/altis 12.0.0 (requires altis/cloud ^12.0.0)
            └──humanmade/project dev-php-8-compat (requires altis/altis ^12.0.0)

Manually pinning psr/log to 1.1.4 in the Altis project's composer.json appears to resolve the issue, and I can now sign in again on that project's dev environment.

I would expect a subdependency of Altis 12 to support PHP 7.4, because 7.4 is listed as deprecated but not incompatible on the Updating PHP docs page.

Acceptance criteria:

  • ...
@kadamwhite kadamwhite added the bug Existing functionality isn't behaving as expected label Oct 4, 2022
@roborourke
Copy link
Contributor

@kadamwhite does the config section of your composer.json specify a target PHP version. Setting that is typically part of the upgrade guide so if it's set to PHP 8.0 this could happen - likely the fault of our docs not indicating this difference.

@rmccue
Copy link
Member

rmccue commented Oct 5, 2022

Opened documentation PR at humanmade/altis-documentation#430 to encourage users to explicitly set that.

@kadamwhite
Copy link
Contributor Author

Rob hit the nail on the head, I was following the upgrade guide and installed Altis 12 as a part of PHP 8 preparedness. Sounds like there may NOT be a single version of Altis 12 that supports 7.4 and 8.0 without requiring a composer dependency update to be coordinated with a PHP deploy...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing functionality isn't behaving as expected
Projects
None yet
Development

No branches or pull requests

3 participants