humanmade / humanmade/altis-core

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

Open
#590 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
19
Forks
3
Avg merge
4d 13h
Merged PRs (30d)
3

Description

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](https://docs.altis-dxp.com/guides/updating-php/).
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](https://packagist.org/packages/psr/log#3.0.0) 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](https://docs.altis-dxp.com/guides/updating-php/) docs page.

Acceptance criteria:

- [ ] ...

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the PHP 7.4 deployment and inspecting the Altis project's composer.json alongside vendor/psr/log/src/LoggerInterface.php. Confirm which dependency constraint resolves psr/log to 3.0.0, then verify that the resolved dependencies support PHP 7.4 and login works without the syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.