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.9k stars 337 forks source link

Outdated php packages on the fallback mirror (https://setup-php.com/ondrej/php/ubuntu) #862

Closed rutomo-humi closed 3 weeks ago

rutomo-humi commented 3 weeks ago

Describe the bug Outdated php extension packages on fallback mirror(https://setup-php.com/ondrej/php/ubuntu) causes certain extensions to fail such as gd. The issue did not have every time in our CICD pipeline, however, whenever the fallback mirror was used, it failed because it tried to install 8.2.20-2+ubuntu22.04.1+deb.sury.org+1 version of php8.2-gd. The installation failed because the installed php8.2-common was 8.2.22-1+ubuntu22.04.1+deb.sury.org+1

Version

Runners

Operating systems

Ubuntu 22.04

PHP versions

8.2

To Reproduce

            - name: Setup PHP
              uses: shivammathur/setup-php@2.31.1
              with:
                  php-version: 8.2
                  extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql
                  coverage: none
                  ini-values: opcache.enable_cli=1, opcache.jit=disable

Expected behavior

setup-php runs successfully and installs the correct version for each extension from the fallback mirror - https://setup-php.com/ondrej/php/ubuntu

Screenshots/Logs

 deb [arch=amd64 signed-by=/usr/share/keyrings/sp-php-keyring.gpg] https://setup-php.com/ondrej/php/ubuntu jammy main
Get:1 https://setup-php.com/ondrej/php/ubuntu jammy InRelease [24.6 kB]
Get:2 https://setup-php.com/ondrej/php/ubuntu jammy/main amd64 Packages [123 kB]
Get:3 https://setup-php.com/ondrej/php/ubuntu jammy/main Translation-en [38.0 kB]
Fetched 185 kB in 4s (48.0 kB/s)
Reading package lists...

Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php8.2-gd : Depends: php8.2-common (= 8.2.20-2+ubuntu22.04.1+deb.sury.org+1) but 8.2.22-1+ubuntu22.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
Hit:1 http://ca-central-1.ec2.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://ca-central-1.ec2.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://ca-central-1.ec2.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists...

Additional context

It also failed randomly on other extensions such as soap and imagick. When I looked into the package itself on our self hosted runner, the available version from https://setup-php.com/ondrej/php/ubuntu repo was 8.2.20-2+ubuntu22.04.1+deb.sury.org+1 for gd

Package: php8.2-gd
Version: 8.2.20-2+ubuntu22.04.1+deb.sury.org+1
Priority: optional
Section: php
Source: php8.2
Maintainer: Debian PHP Maintainers <team+pkg-php@tracker.debian.org>
Installed-Size: 143 kB
Provides: php-gd
Depends: php-common (>= 1:81~), ucf, php8.2-common (= 8.2.20-2+ubuntu22.04.1+deb.sury.org+1), libc6 (>= 2.4), libgd3 (>= 2.3.3)
Download-Size: 32.9 kB
APT-Sources: https://setup-php.com/ondrej/php/ubuntu jammy/main amd64 Packages
Description: GD module for PHP
 This package provides the GD module(s) for PHP.
 .
 PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
 open source general-purpose scripting language that is especially suited
 for web development and can be embedded into HTML.

Are you willing to submit a PR?

shivammathur commented 3 weeks ago

I have re-synced the mirror and fixed the update script. It should update regularly now.