Skip to content

Draft: pmb.build._package: detect recursion

Oliver Smith requested to merge detect-recursions into master

I've built this to figure out #2008. Let pmbootstrap keep track of the stack of packages it is building, and raise an error if it sees a package twice in the stack. Print the stack to the verbose log as well (pmbootstrap -v build ...), as it's very useful for debugging.

This is how it looks like (note that there is an error in the list below, pmbootstrap resolves plasma-wayland-protocols to plasma, therefore thinks it depends on kde-cli-tools):

$ pmbootstrap -v build --strict --force postmarketos-ui-plasma-mobile
[02:51:02] % rm -rf /home/user/.local/var/pmbootstrap/chroot_native
[02:51:03] Cleared up ~73 MB of space
[02:51:04] ERROR: Recursion found while building 'postmarketos-ui-plasma-mobile'!

Package 'plasma-workspace-dev' depends on itself:

plasma-workspace-dev
-> kwin
-> kwayland-server-dev
-> plasma-wayland-protocols
-> kde-cli-tools
-> plasma-workspace-dev

[02:51:04] See also: <https://postmarketos.org/troubleshooting>
Run 'pmbootstrap log' for details.

TODO:

  • better commit message
  • maybe add more comments
  • add a test

Test plan:

  • build recursions in pmaports and try to build them with pmbootstrap
  • do full installations of big UIs, does it complain about alpine packages?

Merge request reports