build: replace auto-discovered package lists with explicit definitions#5751
Open
rucoder wants to merge 2 commits intolf-edge:masterfrom
Open
build: replace auto-discovered package lists with explicit definitions#5751rucoder wants to merge 2 commits intolf-edge:masterfrom
rucoder wants to merge 2 commits intolf-edge:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5751 +/- ##
==========================================
+ Coverage 19.52% 28.34% +8.81%
==========================================
Files 19 18 -1
Lines 3021 2417 -604
==========================================
+ Hits 590 685 +95
+ Misses 2310 1588 -722
- Partials 121 144 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
andrewd-zededa
left a comment
There was a problem hiding this comment.
@rucoder From a quick review the hv=k pkg list looks correct
Contributor
Author
thank you @andrewd-zededa |
ba4408e to
bfb2fe8
Compare
rene
requested changes
Apr 23, 2026
Contributor
rene
left a comment
There was a problem hiding this comment.
Full build for riscv64 must be supported first.
The get-deps tool unconditionally scanned all directories under ./pkg to generate dependency rules. This caused issues where packages not relevant to the current build (e.g. bsp-imx on riscv64) would appear in pkg-deps.mk, requiring workarounds like the pkg/kernel no-op target. Now get-deps accepts an optional list of packages as positional arguments. When provided, only those packages are scanned for dependencies. When omitted, it falls back to the previous behavior for backward compatibility. The Makefile now passes $(PKGS) to get-deps, and the pkg/kernel no-op hack is removed. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
Replace the 'find pkg' auto-discovery of packages with explicit package lists split by category: COMMON_PKGS - packages built for every build combination ARCH_PKGS_* - architecture-specific (e.g. u-boot for arm64/riscv64) HV_PKGS_* - hypervisor-specific (e.g. kube for HV=k) PLATFORM_PKGS_* - platform-specific (e.g. nvidia, bsp-imx, optee-os) Package lists are defined in the new mk/packages.mk file. The final PKGS variable is assembled in the Makefile from these components. This eliminates: - The fragile 'find pkg | grep -Ev ...' auto-discovery - The hardcoded PKGS_riscv64 override (which included bsp-imx/optee-os only to work around the get-deps tool scanning all packages) - Implicit coupling between adding a pkg/ directory and having it built Also moves kernel-version.mk into the mk/ directory and updates all documentation references accordingly. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
bfb2fe8 to
a2b5864
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
NOTE: PR depends on alpine 3.22 update and must be rebased and retested when it is merged
We build some packages that are not part of architecture or platform e.g. u-boot, imx-bsp, etc make no sense for x86
Replace the fragile
find pkg | grep -Ev ...auto-discovery of packages with explicit package lists split by category:COMMON_PKGS— packages built for every arch/hv/platform combination-ARCH_PKGS_*— architecture-specific (e.g.u-bootfor arm64/riscv64)HV_PKGS_*— hypervisor-specific (e.g.kubefor HV=k)PLATFORM_PKGS_*— platform-specific (e.g.nvidia,bsp-imx,optee-os)This is done in two commits:
Fix
get-depstool to accept an explicit package list as positional arguments instead of unconditionally scanning all ofpkg/. The Makefile now passes$(PKGS)toget-deps, and thepkg/kernelno-op workaroundis removed.
Replace auto-discovery with explicit lists defined in the new
mk/packages.mk. The finalPKGSis assembled as:pkg/alpine $(COMMON_PKGS) $(ARCH_PKGS_$(ZARCH)) $(HV_PKGS_$(HV)) $(PLATFORM_PKGS_$(PLATFORM)). Moveskernel-version.mkintomk/directory. Eliminates the hardcodedPKGS_riscv64override that existed only to work aroundget-deps.How to test and validate this PR
make pkgsfor the default build (amd64/kvm/generic) and verify it builds the same set of packages as before.make HV=k pkgsand verifypkg/kubeandpkg/external-boot-imageare included.make PLATFORM=nvidia-jp5 ZARCH=arm64 pkgsand verifypkg/nvidiais included.pkg-deps.mkis generated correctly withmake pkg-deps.mk— it should only contain rules for packages inPKGS.Changelog notes
No user-facing changes.
PR Backports
Checklist
I've provided a proper description
I've added the proper documentation
I've tested my PR on amd64 device
I've tested my PR on arm64 device
I've written the test verification instructions
I've set the proper labels to this PR
I've checked the boxes above, or I've provided a good reason why I didn't
check them.