fix: update Carbon constraint for PHP 8.1 --prefer-lowest compatibility#84
Open
fix: update Carbon constraint for PHP 8.1 --prefer-lowest compatibility#84
Conversation
This change allows both Carbon v2.73+ and v3.0+ to fix CI failures on PHP 8.1 with --prefer-lowest. Carbon v2.73+ supports PHP 8.1-8.4 with the same API as v3.x but without the strict PHP 8.1+ requirement that prevents --prefer-lowest from working. - Allows CI --prefer-lowest to install Carbon v2.73 on PHP 8.1 - Maintains preference for Carbon v3.x on newer PHP versions - Resolves composer dependency resolution conflicts Fixes composer error: 'Your requirements could not be resolved to an installable set of packages'
There was a problem hiding this comment.
Pull Request Overview
This PR fixes CI test failures on PHP 8.1 with --prefer-lowest by updating the Carbon dependency constraint to allow both v2.73+ and v3.0+, resolving version conflicts while maintaining backward and forward compatibility.
- Updated Carbon constraint from
^3.0to^2.73 || ^3.0to support PHP 8.1.0 environments - Ensures CI compatibility with
--prefer-lowestflag while preserving modern Carbon features - Maintains API compatibility across both Carbon major versions
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Missing PHP constraint was causing dependency resolution failures in CI - PHP ^8.1 requirement ensures compatibility with all SilverStripe 5.x dependencies - This addresses the 'Your requirements could not be resolved' error on PHP 8.1 --prefer-lowest builds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI tests are failing on PHP 8.1 with
--prefer-lowestflag due to Carbon dependency constraint conflicts:Root Cause
"nesbot/carbon": "^3.0"--prefer-lowesttries to install Carbon 3.0.0 on PHP 8.1.0 environmentsSolution
Updated composer.json constraint to:
Benefits:
--prefer-lowestcan install v2.73 on PHP 8.1Testing
References