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

package installs outside module can install undesired version of PHP #681

Open
FrankVanDamme opened this issue Apr 6, 2023 · 1 comment

Comments

@FrankVanDamme
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.23.0
  • Ruby: ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-linux]
  • Distribution: Debian 11
  • Module version: 8.2.0
  • using sury sources

The issue:

Certain packages in Debian (such as simplesamlphp) have a dependency on "php". This resolves to php7.4 in Debian 11 and - currently - php8.2 with Sury sources added. Suppose the user specifically wants version 8.1, then installing it by means of setting php::globals::php_version to 8.1 does not result in litteral conflicts, but in 2 PHP versions of PHP ending up on the system, and the higher one of the two takes preference for the CLI binary.

Each php${version} package ("php7.4", "php8.1", "php8.2") has "php" in their "Provides" field to they all are capable of satisfying the dependency. So eg, if "php7.4" was previously installed, it satisfies the dependency;

How to reproduce (e.g Puppet code you use)

manifest:

    class { "php":
        manage_repos => true,
    }
 
    php::fpm::pool {"default":
    }
 
    package { "simplesamlphp":
        ensure  => present,
        # install simplesamlphp after configuring sury apt source and having a 
        # php version already installed so it doesn't pull php7.4 as a dependency
        require => Package["php8.1-fpm"],
    }

hiera:

  php::globals::php_version: '8.1'

What are you seeing

  • "php8.2" gets installed besides "php8.1-cli" and "php8.1-fpm"
  • "php8.2-cli" is installed as dependency
  • ->
#  php -v
PHP 8.2.4 (cli) (built: Mar 16 2023 14:37:38) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.4, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.4, Copyright (c), by Zend Technologies

What behaviour did you expect instead

Preferably I'd like to see the "main" php version of a specific version installed. This will satisfy the dependencies of any other package that may depend on "php". I can see two options:

Output log

Any additional information you'd like to impart

@abctaylor
Copy link

This is definitely an issue and is super annoying!

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