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
Replaces priority #1166
base: main
Are you sure you want to change the base?
Replaces priority #1166
Conversation
This enables one to use variables, and range substitutions in the ReplacesPriority and ProviderPriority. Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Requires chainguard-dev/melange#1166 Drop pybins, instead build all packages with commands in /usr/bin. Set replaces, replaces-priority to ensure they are apk installable. Also set provider-priority such that `apk add py3-pip` transparently installs py3.12-pip alone. This is all great, however not at all supported by apko. But imho should be supported. As one simply has to sort packages in replaces priority order prior to streaming. And allow overriding files between packages that have replaces declared. ```console ... (13/25) Installing python-3.10-base (3.10.14-r1) (14/25) Installing py3.10-flit-core (3.9.0-r2) (15/25) Installing py3.10-setuptools (69.5.1-r1) (16/25) Installing py3.10-pip (24.0-r2) (17/25) Installing python-3.11-base (3.11.9-r1) (18/25) Installing py3.11-flit-core (3.9.0-r2) (19/25) Installing py3.11-setuptools (69.5.1-r1) (20/25) Installing py3.11-pip (24.0-r2) (21/25) Installing python-3.12-base (3.12.3-r1) (22/25) Installing py3.12-flit-core (3.9.0-r2) (23/25) Installing py3.12-setuptools (69.5.1-r1) (24/25) Installing py3.12-pip (24.0-r2) (25/25) Installing py3-supported-pip (24.0-r2) OK: 197 MiB in 40 packages -rwxrwxr-x 1 root root 946 Apr 26 22:22 /usr/bin/pip3.12 -rwxrwxr-x 1 root root 946 Apr 26 22:22 /usr/bin/pip3.11 -rwxrwxr-x 1 root root 946 Apr 26 22:22 /usr/bin/pip3.10 -rwxrwxr-x 1 root root 940 Apr 26 22:22 /usr/bin/pip3 -rwxrwxr-x 1 root root 938 Apr 26 22:22 /usr/bin/pip ```
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
with my apk-tools maintainer hat on, this looks fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some doc on range
would be nice. I can't seem to find anything in doc/ about range
at all. But I understand you didn't add this.
It looks like it would be pretty easy to add test coverage to this in pkg/config/config_test.go
. Could you add some coverage?
@kaniini thank you for your comments. "replaces_priority" is only available in the installed database as Or is it optional and it wouldn't hurt anything to add it in the APKINDEX? |
… replaces-priority
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need this.
There is https://github.com/chainguard-dev/melange/blob/main/NEWS.md#major-changes-from-010-to-020 and also schema (but it just says that range is an acceptable key, without explaining which arguments it supports)
Will check. |
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Tests added. Docs are in academy and in the repo. Will see where best to improve stuff. |
This makes things awesome for python.
Melange Pull Request Template
Functional Changes
Notes:
SCA Changes
Notes:
Linter
Notes: