-
Notifications
You must be signed in to change notification settings - Fork 173
Add Alpine Linux package management tools for EVE OS #5179
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
Conversation
81b29f3
to
d296fd9
Compare
d296fd9
to
c91d17d
Compare
c91d17d
to
fc2e860
Compare
@rucoder , thanks a lot for such great scripts, these will help a lot on upgrading Alpine and to fix all missed dependencies! Good job! |
Um, holy cow? Wow? This is great! |
BTW, at the request of @christoph-zededa , linuxkit recently got the ability to reference other packages automatically used build-args. So we actually could replace all of the explicit I know, not a big thing compared to this, but another piece to help ease building. I was going to add a PR for it, but I prefer to let a real user (hint hint @christoph-zededa ) do it, so we can see how well it works for someone who did not build it. |
Add three new tools for managing Alpine package lists in the EVE build system: - alpine_index.py: Core library for APKINDEX parsing and dependency resolution - alpine-migrate.py: Migrate package lists between Alpine versions (e.g. 3.16 → 3.21) - alpine-pkg-add.py: Add specific packages with dependencies to existing lists Features: - Automatic dependency resolution with cycle detection - Support for x86_64, aarch64, riscv64 architectures - Handle package relocations between main/community branches - Virtual package support (so:, cmd:, pc: prefixes) - Missing package reporting and dependency chain analysis - Maintains alpine-base container package cache structure These tools handle Alpine version upgrades where packages move between branches, get renamed, or have changed dependencies, ensuring complete package sets for reproducible EVE OS builds. Signed-off-by: Mikhail Malyshev <[email protected]>
fc2e860
to
4f06969
Compare
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.
Pull Request Overview
This PR adds three new Python tools for managing Alpine Linux package lists in the EVE build system to handle Alpine version upgrades and package maintenance. The tools provide automated migration between Alpine versions, dependency resolution, and package addition capabilities with support for multiple architectures and repository branches.
- Core library (alpine_index.py) providing APKINDEX parsing, dependency resolution, and package classification utilities
- Migration tool (alpine_migrate.py) for complete package list migrations between Alpine versions with handling of package relocations and dependency changes
- Package addition tool (alpine_pkg_add.py) for adding specific packages with full dependency resolution to existing package lists
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
tools/alpine-tools/alpine_index.py | Core library providing APKINDEX parsing, dependency resolution, and package classification utilities |
tools/alpine-tools/alpine_migrate.py | Migration tool for migrating package lists between Alpine versions with dependency resolution |
tools/alpine-tools/alpine_pkg_add.py | Tool for adding specific packages to existing Alpine package lists with dependency resolution |
docs/ALPINE.md | Documentation updates describing the new Alpine package management tools and their usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
for provide in provides: | ||
# Split on '=' to ignore version part | ||
# e.g., 'pc:znc=1.9.1' becomes 'pc:znc' | ||
# Note: Consider keeping versions for more precise dependency resolution |
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.
This TODO comment suggests an incomplete implementation. Version constraints in provides should either be preserved for precise dependency resolution or this comment should be removed if the current approach is intentional.
# Note: Consider keeping versions for more precise dependency resolution |
Copilot uses AI. Check for mistakes.
print(f"🚀 Starting migration from Alpine {args.old_version} " | ||
f"to {args.new_version}") | ||
print(f"📁 Package directory: {args.path}") | ||
|
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.
This check for same-version migration is duplicated (line 262 and 274). The logic should be consolidated to avoid redundant code and improve maintainability.
Copilot uses AI. Check for mistakes.
# pylint: disable=unbalanced-tuple-unpacking | ||
classified, missing_by_branch_arch = result | ||
chains_by_branch_arch = None | ||
|
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.
The pylint disable comment for 'unbalanced-tuple-unpacking' suggests a potential issue with tuple unpacking. The function resolve_and_classify_packages() returns different tuple lengths based on collect_chains parameter, which could lead to runtime errors if not handled correctly.
result = resolve_and_classify_packages( | |
packages_to_add, apk_indexes, provides_indexes, available_archs, collect_chains=print_chains | |
) | |
# Always unpack three values; chains_by_branch_arch may be None if not collected | |
if print_chains: | |
classified, missing_by_branch_arch, chains_by_branch_arch = result | |
else: | |
classified, missing_by_branch_arch, chains_by_branch_arch = result |
Copilot uses AI. Check for mistakes.
@rene @OhmSpectator are we merging it? eden is not required here at all |
Famous last words before EVE crash ;-) |
Looks good! I look forward to using the scripts |
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.
Looks good to me, nice clean scripts.
These are just script tools, it has nothing with the execution of pillar, I think it's fine to merge... |
for reference: #5190 |
Description
this PR addresses #5172
Add three new Python tools for managing Alpine Linux package lists in the EVE build system to handle Alpine version upgrades and package maintenance.
alpine_index.py: Core library providing shared utilities for APKINDEX parsing, dependency resolution, and package classification across branches and architectures.
alpine-migrate.py: Migrates complete package lists between Alpine versions (e.g. 3.16 → 3.21), handling package relocations between main/community branches, renamed packages, and changed dependencies.
alpine-pkg-add.py: Adds specific packages with full dependency resolution to existing Alpine package lists, useful for expanding the package cache with new tools or libraries.
Key features:
These tools are essential for Alpine version upgrades where packages frequently move between branches, get renamed, or have dependency changes, ensuring complete and consistent package sets for reproducible EVE OS builds.
How to test and validate this PR
Basic functionality testing:
Expected outcomes:**
Architecture testing:
Changelog notes
Add Alpine Linux package management tools for automated version migration and package list maintenance. These tools handle Alpine version upgrades by resolving package relocations, dependencies, and architecture-specific availability changes, ensuring complete package sets for reproducible container builds.
PR Backports
Checklist
And the last but not least:
check them.