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

Bump to PHP 8.3 #60

Open
dshafik opened this issue Mar 15, 2024 · 2 comments
Open

Bump to PHP 8.3 #60

dshafik opened this issue Mar 15, 2024 · 2 comments

Comments

@dshafik
Copy link

dshafik commented Mar 15, 2024

We can no longer use this image as our application requires 8.3 and composer install fails.

composer install --no-scripts --no-progress --no-dev 
  Installing dependencies from lock file
  Verifying lock file contents can be installed on current platform.
  Your lock file does not contain a compatible set of packages. Please run composer update.
  
    Problem 1
      - Root composer.json requires php ^8.3 but your php version (8.2.13) does not satisfy that requirement.
  
  Error: Your lock file does not contain a compatible set of packages. Please run composer update.
  
    Problem 1
      - Root composer.json requires php ^8.3 but your php version (8.2.13) does not satisfy that requirement.

I'm happy to open a PR for this, but realistically you might need to start building multiple packages to support each of the different (minor) versions of PHP supported by a given version of Psalm.

@braindawg
Copy link

braindawg commented Mar 28, 2024

Interesting, I just ran into the same issue because we're trying to bump to PHP 8.2 and the container only has PHP 8.1.2 installed. I'm guessing that's based on the jobs.build.runs-on property of the Github workflow, since we're running on ubuntu-latest and the version matches: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#php-tools

Out of curiosity, which runner image are you using that has PHP 8.2 support? Looks like the latest Win/Mac runner releases have PHP8.3, but Ubuntu is lagging the pack with 8.1.

EDIT: Did some more digging on this, and it was a decision by GitHub to remove non-Canonical repositories from their Ubuntu 22.04 runner, which is why the image is capped at PHP 8.1.2. Source thread here.

Looks like the "official" workaround for this is to use shivammathur/setup-php as an early workflow step to activate the PPA:Ondrej repo & install the requested version(s) of PHP from that. Fortunately, that process went smoothly, and the increased CI workflow times aren't an issue for us.

@braindawg
Copy link

Psalm already has built-in support for PHP versions that differ from the installed environment, so my previous comment is mostly moot.

Seems to me that the best way to provide support for multiple versions of PHP is to expose Psalm's --php-version CLI option as a workflow param. Then we could use the container to check against all supported PHP versions:

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        php-versions: ['8.1', '8.2', '8.3']
    steps:
    - name: Psalm – Static Analysis for PHP
      uses: docker://ghcr.io/psalm/psalm-github-actions:5.15.0
      with:
        composer_ignore_platform_reqs: true
        composer_require_dev: true
        php-version: ${{ matrix.php-versions }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants