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

php virtual provides should not include version #32874

Open
smoser opened this issue Nov 1, 2024 · 2 comments
Open

php virtual provides should not include version #32874

smoser opened this issue Nov 1, 2024 · 2 comments

Comments

@smoser
Copy link
Member

smoser commented Nov 1, 2024

php packages currently have virtual provides with a full package version.
This causes issue when multiple php versions exist as discussed some #32398.

    dependencies:
      provides:
        - php-igbinary-config=${{package.full-version}}

The biggest problem here is:

  1. you have 2 packages php8.3-ampq and php8.2-ampq both at version 2.1.2 at epoch 0. They both provide php-amqp=${{package.full-version}}
  2. A change is made to php8.2-ampq, and the epoch bumped.

Now, if something tries to install the virtual php-ampq, they'll get the php8.2 version rather than the 8.3 version.

We were lucky and avoided that problem in python because of the multi-versioning. You cannot currently bump py3.12-foo without bumping py3.13-foo (they are both built by py3-foo).

So I think that:

  • virtual provides are only for humans. They should never be allowed to be used by image builds.
  • We should not provide versions on virtual provides, but rather rely on provider-priority. (php-igbinary-config is fine, but php-igbinary-config-${{package.version}} is not). This decision is primarily made for consistency with py3-*). I do not have a reason why one option should be strongly preferred over the other, so I'm choosing consistency.

In order to accomplish this, we have to

  • drop the version on php-* virtual provides
  • bump and build and withdraw all older versions php-* . This is required so that users would not continue to get the older version as version provider-priority is only consulted when version is equal.
@smoser
Copy link
Member Author

smoser commented Nov 1, 2024

@ajayk please read above.

@smoser
Copy link
Member Author

smoser commented Nov 1, 2024

great. so, after writing the above, i realize that a provider-priority of '83' for php 8.3 and then 84 for php 8.4 falls apart when we have a 9.0 and 8.10 (as 8.10 then gets 810 and 9.0 gets 90).

2 options to address taht

  1. use version on the virtual-provides instead (php-igbinary-config=8.3 for php8.3-igbinary-config)
  2. use provider-priority with more thoughtful versions (Major*100+minor). This would currently require a 'var' to define rather than var-transform, as I do not think I can do math in the regex.

It wouldnt be all that bad to drop it.

We'd end up with something like:

package:
  name: php-8.4-zstd
  version: 0.13.3
  epoch: 1
  ...
  dependencies:
    runtime:
      - ${{package.name}}-config
      - php-${{vars.phpMM}}

vars:
  phpMM: 8.4
  phpPriority: 804

Rather than what we have now:

package:
  name: php-8.2-zstd
  version: 0.13.3
  epoch: 1
...
  dependencies:
    runtime:
      - ${{package.name}}-config
      - php-${{vars.phpMM}}

var-transforms:
  - from: ${{package.name}}
    match: ^php-(\d+\.\d+)-.*$
    replace: "$1"
    to: phpMM

The first is arguably more readable anyway, it just requires changing the two 'var' definition when copying php-8.3-zstd to php-8.4-zstd

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

1 participant