kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

Dependency resolution for packages not in KISS_PATH #247

Closed dilyn-corner closed 3 years ago

dilyn-corner commented 3 years ago

Description

If a package isn't found in $KISS_PATH, and it has a dependency that is not currently installed, kiss will error and refuse to uninstall the package.

There is an error I think that is also related to this (some bug in dependency detection), so I'm including it here as well as a bonus case at the bottom.

Below is with Master @ b2e1d53bb791a02d14bb141d13292ce8a051c0b7, issue exists with 5.5.18 release as well.

Error message

dilyn ~  -> export KISS_PATH=
dilyn ~  -> /home/dilyn/git/kiss/kiss r cmake
ERROR 'linux-headers' not found 

Verbose log

The log is strangely sparse:

dilyn ~  -> echo $KISS_PATH

dilyn ~  -> env KISS_PROMPT=0 sh -x /home/dilyn/git/kiss/kiss r cmake
+ main r cmake
ERROR 'linux-headers' not found 

dilyn ~  -> export KISS_PATH=/var/db/kiss/KISS-me/gpl # linux-headers is in gpl

dilyn ~  -> env KISS_PROMPT=0 sh -x /home/dilyn/git/kiss/kiss r cmake
+ main r cmake
ERROR 'linux-headers' not found 

export KISS_PATH=/var/db/kiss/KISS-me/core:/var/db/kiss/KISS-me/gpl # cmake, llvm are in core
dilyn ~  -> env KISS_PROMPT=0 sh -x /home/dilyn/git/kiss/kiss r cmake       
+ main r cmake
Using doas (to become root)
-> cmake Checking if package removable
-> cmake Removing package
-> cmake Removed successfully
+ pkg_clean

Bonus case:

dilyn ~  -> export KISS_PATH=/var/db/kiss/KISS-me/gpl
dilyn ~  -> env KISS_PROMPT=0 sh -x /home/dilyn/git/kiss/kiss depends cmake
+ main depends cmake
ERROR Circular dependency detected llvm <> cmake 
usage: kiss-depends [pkg]

dilyn ~  -> kiss-depends cmake
ERROR Circular dependency detected llvm <> cmake 
usage: kiss-depends [pkg]
dilyn ~  -> env KISS_PROMPT=0 sh -x /home/dilyn/git/kiss/kiss depends llvm
+ main depends llvm
ERROR Circular dependency detected cmake <> llvm 
usage: kiss-depends [pkg]

dilyn ~  -> cat /var/db/kiss/installed/llvm/depends                                                                     
cmake   make
python  make
samurai make
zlib

dilyn ~  -> cat /var/db/kiss/installed/cmake/depends 
bzip2
curl
expat
libressl
linux-headers make
llvm
zlib

dilyn ~  -> export KISS_PATH=/var/db/kiss/KISS-me/core
dilyn ~  -> env KISS_PROMPT=0 sh -x /home/dilyn/git/kiss/kiss r cmake
+ main r cmake
Using doas (to become root)
-> cmake Checking if package removable
-> cmake Removing package
-> cmake Removed successfully
+ pkg_clean

The original problem is not specific to any one package (you can test it with having something requiring bison m4 flex etc etc and then unsetting KISS_PATH and trying to remove that package). The 'bonus' problem I've only encountered with cmake and llvm.

dylanaraps commented 3 years ago

This is: https://github.com/kisslinux/kiss/commit/4bcefedb4bf2a955a7f80bcb5c40a61c8cd937f

Working on a fix. Thanks for the issue.

(The above commit is desirable as the package manager aborts as soon as possible. Issue is just making it less greedy for certain actions.)

dilyn-corner commented 3 years ago

Awesome! I also ran into another thing (https://libera.irclog.whitequark.org/kisslinux/2021-07-24#30336022; to 16:35) which might likewise be related, I was going to hold off on reporting that just in case they both got fixed.

dylanaraps commented 3 years ago

OK. Have reverted the change. Will perfect it locally. Please try master and let me know if the vim/ncurses issue is fixed.

Edit: The changes to updates should make support for additional remote retrieval methods (both in the package manager and in hooks) possible. ie, we can extend methods within the package manager and users can now extend methods using hooks. (Mentioning since this is related to the fossil PR).

dilyn-corner commented 3 years ago

It isn't fixed; I'll open a new issue!