Problem
Currently (as of the last release which at the moment is 1.1.1) the way we install auto-instrumentations that require instrumentation of functions from PHP extensions is by disabling composer's check of PHP requirement
which unfortunately is global and it cannot be limited to specific packages (namely those packages with those auto-instrumentations). composer's behavior in this case is copletely drop PHP version requirement check for all the packages.
For example open-telemetry/sdk (1.9.0) requires ramsey/uuid (4.9.1) requires brick/math (0.14.0).
brick/math 0.14.0 requires PHP 8.2+ and it would have broken the application if loaded in context of PHP 8.1
because in 0.14.0 brick/math introduced the use of PHP 8.2+ readonly classes feature.
Suggestions
For auto-instrumentations requiring PHP 8.2+ packages
We need to add (preferably automatic) safety checks that those auto-instrumentations packages for functions from PHP extensions - for example verifying that the code in those packages is not using any PHP 8.2+ features. This will allow us to update pinned versions of those packages with higher confidence.
For the rest of the packages
We need to make sure that the rest of the packages (other than auto-instrumentations for functions from PHP extensions) are subjected to PHP version requirements.
One possible way to implement it is to:
- Install package into a temp location
- Fix the package composer.json to allow PHP 8.1
- Install "fixed" package via composer local repository instead of the original package from packagist.org
- Remove
--ignore-platform-req=php thus return composer's ability to enforce PHP version requirement
Problem
Currently (as of the last release which at the moment is 1.1.1) the way we install auto-instrumentations that require instrumentation of functions from PHP extensions is by disabling composer's check of PHP requirement
which unfortunately is global and it cannot be limited to specific packages (namely those packages with those auto-instrumentations). composer's behavior in this case is copletely drop PHP version requirement check for all the packages.
For example
open-telemetry/sdk(1.9.0) requiresramsey/uuid(4.9.1) requiresbrick/math(0.14.0).brick/math0.14.0 requires PHP 8.2+ and it would have broken the application if loaded in context of PHP 8.1because in 0.14.0
brick/mathintroduced the use of PHP 8.2+readonlyclasses feature.Suggestions
For auto-instrumentations requiring PHP 8.2+ packages
We need to add (preferably automatic) safety checks that those auto-instrumentations packages for functions from PHP extensions - for example verifying that the code in those packages is not using any PHP 8.2+ features. This will allow us to update pinned versions of those packages with higher confidence.
For the rest of the packages
We need to make sure that the rest of the packages (other than auto-instrumentations for functions from PHP extensions) are subjected to PHP version requirements.
One possible way to implement it is to:
--ignore-platform-req=phpthus return composer's ability to enforce PHP version requirement