Add yay's rebuildtree option to recursively rebuild dependent AUR packages
Have you checked the readme and man page for this feature? Yes, not available
Have you checked previous issues for this feature? Yes
Related: https://github.com/Morganamilo/paru/issues/239#issuecomment-1003792100
Corresponding yay commit: https://github.com/Jguer/yay/commit/18af7000533200017aaaa66ffedc5d44606066ec
It would be great for paru to support the --rebuildtree option. This is important for libraries which need to be rebuilt with dependent .so changes.
@Morganamilo I was about to port over this feature and was wondering if you have any suggestions on how to do this before I get into it?
One question I had was do I piggy back off rebuild like what we did for the rebuildall feature? Or do I create another flag for rebuildtree specifically?
Also I'm not sure how to get the recursive dependencies for a package to modify the following line:
https://github.com/Morganamilo/paru/blob/c122ce076906f0e6c138f07add559490d6fd6ebd/src/install.rs#L1956
There's checks to stop resolving deps if a package is satisfied. There needs to be a condition that says not to stop resolving if rebuild tree is set and the package is an aur package.
So something else like this?
if (config.rebuild == YesNoTreeAll::Yes && base.target()) || (config.rebuild == YesNoTreeAll::Tree && base.{missing_func()}) || config.rebuild == YesNoTreeAll::All {
Is there already a function that can check if the aur package is a recursive dep or does that function need to be created? If so, where would it reside?
Sorry for pestering, just a bit of a noob.
You can't check that. This needs to be a check at the solver level that tells it to not stop.
By the solver level do you mean resolve_targets?
https://github.com/Morganamilo/paru/blob/c122ce076906f0e6c138f07add559490d6fd6ebd/src/install.rs#L846
The resolver is its own library https://github.com/Morganamilo/aur-depends
I see I'll go ahead and open an issue in that repo as well.
Okay so building on top of the linked PR:
Would I just simply add a flag here based on some user rebuildtree flag?
https://github.com/Morganamilo/paru/blob/c122ce076906f0e6c138f07add559490d6fd6ebd/src/resolver.rs#L12
Implemented, though this doesn't work if you're using local repos. Due to them being repo packages. This will probably be fixed at a later date.
Thanks for this! Should I open another issue for --rebuild=tree for repo packages? Or should we just reopen this one?
Also should documentation be added for --rebuild to incorporate the tree option?