paru icon indicating copy to clipboard operation
paru copied to clipboard

Add yay's rebuildtree option to recursively rebuild dependent AUR packages

Open acxz opened this issue 3 years ago • 8 comments

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.

acxz avatar May 08 '22 08:05 acxz

@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

acxz avatar Aug 10 '22 14:08 acxz

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.

Morganamilo avatar Aug 10 '22 16:08 Morganamilo

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.

acxz avatar Aug 10 '22 17:08 acxz

You can't check that. This needs to be a check at the solver level that tells it to not stop.

Morganamilo avatar Aug 10 '22 17:08 Morganamilo

By the solver level do you mean resolve_targets? https://github.com/Morganamilo/paru/blob/c122ce076906f0e6c138f07add559490d6fd6ebd/src/install.rs#L846

acxz avatar Aug 10 '22 17:08 acxz

The resolver is its own library https://github.com/Morganamilo/aur-depends

Morganamilo avatar Aug 10 '22 17:08 Morganamilo

I see I'll go ahead and open an issue in that repo as well.

acxz avatar Aug 10 '22 17:08 acxz

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

acxz avatar Aug 10 '22 22:08 acxz

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.

Morganamilo avatar Sep 03 '22 12:09 Morganamilo

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?

acxz avatar Oct 03 '22 20:10 acxz