fix: plan-resolve silently drops packages not in pool#44
fix: plan-resolve silently drops packages not in pool#44marcos-mendez wants to merge 1 commit intoturnkeylinux:masterfrom
Conversation
Three bugs in Plan.resolve(): 1. The 'missing' set was never populated — packages.missing was not accumulated across while-loop iterations. Fixed by adding 'missing |= packages.missing' inside the loop. 2. The 'all_missing' computation was inside the loop but should be after it, using the fully accumulated 'missing' set. 3. The 'brokendeps' list iterated over 'missing' without filtering by 'all_missing', including virtual packages already satisfied by bootstrap Provides. Also adds iter_provided() to resolve.py to extract virtual package names (Provides) from the bootstrap dpkg status, so packages like 'awk' (provided by mawk) are correctly recognized as satisfied. Without this fix, packages like locales, curl, nginx, git, iptables, fail2ban, postfix, ssh, build-essential, etc. were silently dropped from root.spec, causing build failures.
|
When I first tried to reproduce the issue you note I could. However it didn't make any sense to me as there were a ton of other packages that were getting pulled in from the common plans - including packages that are only in the The couple of commits that added Regardless, after having a look at your code changes, there's definitely improvements there that are worth including. Although now I can't reproduce the issue that you are experiencing I'd really like to spend some time properly reviewing and testing before merging. And I'm so close to a 19.0 RC I really want to focus on that... Once I have that done I really want to turn to reviewing your new apps so we can publish them too! FWIW I have a slightly newer version of fab, but the changes are irrelevant to your issue (they are related to a Note that without setting
And Including And abusing |
|
Hey Jed, thanks for taking the time to dig into this — and sorry for the confusion. You're right. I went back and checked my local environment and found that my So when I was debugging the missing I think with the excess of local branches and uncommitted work I got confused and something slipped past me. That's on me — I should have double-checked against upstream before opening the PR. That said, looking at the code itself, I do believe the fixes to I also cleaned up a duplicate line I had in the last push ( No rush on the review — totally understand the focus on the 19.0 RC. Looking forward to working on the new apps once that's out! |
Summary
Plan.resolve()infablib/plan.pysilently drops packages from the plan that are not found in the pool, instead of passing them through as repo-installable packages. This causes critical packages likelocales,curl,nginx,git,iptables,fail2ban,postfix,ssh,build-essential,isolinux,linux-image-amd64etc. to be missing fromroot.spec, breaking all appliance builds.Root cause
Three bugs in
Plan.resolve():missingset never populated —packages.missingwas not accumulated across while-loop iterations. Themissingvariable stayed empty throughout execution.all_missingcomputed in wrong scope — it was calculated inside the while loop using only the last iteration'spackages.missing, instead of after the loop using the fully accumulated set.brokendepsincluded virtual packages — packages already satisfied by bootstrapProvides(e.g.,awkprovided bymawk) were included in the output, causingapt-get install awkto fail.Fix
plan.py: Accumulatemissing |= packages.missinginside the loop. Moveall_missingcalculation after the loop. Filterbrokendepsbyall_missing.resolve.py: Additer_provided()to extractProvidesfrom bootstrapdpkg/status. Pass bootstrap-provided virtual packages toPlan.resolve()so they are excluded from missing.Testing
Before fix:
After fix:
Full appliance build (NetBox 4.5.7) completes successfully with ISO and tar.gz generation.
Impact
This bug affects all appliance builds on TKLDev with fab 1.1rc5. Without this fix, no appliance can build correctly — critical packages are missing from the root filesystem.