shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
https://setup-php.com
MIT License
2.91k stars 340 forks source link

Loop on installing extensions on PHP 8.1 #790

Closed janvernieuwe closed 10 months ago

janvernieuwe commented 10 months ago

Describe the bug

Stuck on installing extensions since latest release

Version

Runners

Operating systems

ubuntu

PHP versions

8.1

To Reproduce

Install php 8.1 with extensions on ubuntu.

Expected behavior

Installs extensions

Screenshots/Logs

image

Looks like we get stuck in a loop (when i ran it verbose)

Repository ondrej/php already exists
sudo: apt-fast: command not found
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  icu-devtools libicu-dev zlib1g-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 59 not upgraded.
sudo: apt-fast: command not found
/usr/sbin/phpenmod
Repository ondrej/php already exists
sudo: apt-fast: command not found
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  icu-devtools libicu-dev zlib1g-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 59 not upgraded.
sudo: apt-fast: command not found
/usr/sbin/phpenmod
Repository ondrej/php already exists
sudo: apt-fast: command not found
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  icu-devtools libicu-dev zlib1g-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 59 not upgraded.
sudo: apt-fast: command not found
/usr/sbin/phpenmod
Repository ondrej/php already exists

this goes on forever

Additional context

Was no problem earlier today, we're reverting to previous release

Are you willing to submit a PR?

Unfortunately no :|

janvernieuwe commented 10 months ago

We're looking further into this . Might be the runner, I'll update when I get new information.

shivammathur commented 10 months ago

Please provide me the relevant yaml for the setup-php step.

janvernieuwe commented 10 months ago

We tested it with 27.1 is still working. lastest we run in to the issues confirmed. There are the yaml's we use for the runner image and the workflow.

runner image:

FROM summerwind/actions-runner:ubuntu-22.04

USER root

RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php &&\
    apt-get update &&\
    apt-get install software-properties-common ca-certificates lsb-release apt-transport-https unzip make zstd php8.1 php-cli zlib1g-dev libbrotli-dev libcurl4-openssl-dev libevent-dev libicu-dev libidn2-dev -y &&\
    curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php &&\
    php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer &&\
    rm -rf /tmp/* &&\
    apt-get clean

USER runner

workflow

jobs:
  grumphp-test-suite:
    runs-on:
        group: PHP-8.1
    strategy:
        matrix:
            php-versions: ['8.1']
            composer-options: ['']
    name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-options }}
    steps:
        - name: Checkout
          uses: actions/checkout@v3
        - name: Install PHP
          uses: shivammathur/setup-php@v2
          with:
              php-version: ${{ matrix.php-versions }}
              extensions: xdebug, mbstring, raphf, pecl_http
shivammathur commented 10 months ago

@janvernieuwe

Please start with a new container i.e. setup-php action has not run on it and specify the env runner as self-hosted.

- name: Install PHP
  uses: shivammathur/setup-php@v2
  with:
    php-version: ${{ matrix.php-versions }}
    extensions: xdebug, mbstring, raphf, pecl_http
  env:
    runner: self-hosted    

Ref: https://github.com/shivammathur/setup-php?tab=readme-ov-file#self-hosted-setup

janvernieuwe commented 10 months ago

That solved the looping indeed, thanks!