zqqw / pakku

Pacman wrapper with AUR support
GNU General Public License v3.0
39 stars 3 forks source link

Dependency changes while editing the PKGBUILD are ignored. #26

Open Lattay opened 1 year ago

Lattay commented 1 year ago

Hello,

Apparently dependencies are not reparsed after the editing of the dependencies, which make the said editing completely useless. As far as I am concerned, this is one of the most common editing I do to PKGBUILD, so it would be nice to reparse the deps after editing.

Is this something that would be implemented ?

I am not a daily Nim programmer, but I think I know enough of it that I could look into implementing this if it is acceptable for you.

zqqw commented 1 year ago

Well spotted, after adding another dependency, although the PKGBUILD is reparsed, so most changes in there work as expected, the extra dependency is not then installed:

==> Checking buildtime dependencies...
==> ERROR: Could not resolve all dependencies.
error: failed to build 'termenu-git'
:: Build failed, retry? [y/e/N/?] y

It's possible to proceed with the build if it's manually installed in another terminal tab, so the change is getting registered but it seems no action is taken to re-run the install part if required. If you did want to fix this, that would be great. Thank you for getting in touch about this.

Lattay commented 1 year ago

Another problem is that if you remove a dependency, it will still be installed. I mention that because my test case was trying to replace an old version of a package only available on AUR with a more recent one, available on official repos. I'll look into the problem.

Can you maybe point me to the right modules where this may be handled, to get me up to speed ?

zqqw commented 1 year ago

It sounds like it could be more a case for re-ordering events slightly, so the option to edit the files takes place before the dependencies are installed. A lot of this will take place in src/feature/syncinstall.nim and many procs called from there are from src/common.nim. The startup point is src/main.nim but not a lot happens in there, it mostly just sets things in motion. If you ag/grep the error messages it should help you find the right general area. The control flow does tend to jump about a lot and there are different paths with common points for say -Sn (repopkg) vs -S (aurpkg) so it could take a while to trace things through. As it runs on the console you can easily add debugging echos to print out variables and monitor progress, if you want to pause things to check the current contents of directories an input line works well, eg let myInput = readLine(stdin)

zqqw commented 1 year ago

Some of the onscreen messages are from makepkg, pacman and possibly git which are exec'd in various ways at various points, I should have mentioned before.