kisslinux / kiss

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

fix nonexistent directory #238

Closed ProkopRandacek closed 3 years ago

ProkopRandacek commented 3 years ago

There is a bug when building new packages.

/usr/bin/kiss: line 933: can't create /root/.cache/kiss/proc/813465/build/v: nonexistent directory

line 993: (pkg_verify)

pkg_checksums "$1" > "$mak_dir/v"

My analysis:

pkg_verify is called before pkg_build in pkg_build_all. And because $mak_dir is created in pkg_build, pkg_verify throws an error on line 993 when trying to create a file inside $mak_dir.

but I could be wrong.

I tested this patch by installing another few new packages and the bug didn't occur again.

dylanaraps commented 3 years ago

Can you reproduce this with the latest KISS? mak_dir is actually created on script start inside create_tmp_dirs() so it should always exist.

ProkopRandacek commented 3 years ago

Im running kiss 5.5.2. Just got another error

/usr/bin/kiss: line 1442: can't create /root/.cache/kiss/proc/1370977/build/m: nonexistent directory

when building htop. Interestingly, when I rerun kiss, the error disappears and I cant get it back even by removing entire ~/.cache and removing and then building htop again

dylanaraps commented 3 years ago

Yeah.. I've been trying to find a reliable way to reproduce this and can't. The directory should exist at all times as it's created on startup of the package manager. Will look into this further.

dylanaraps commented 3 years ago

I think these issues have always existed in some capacity since we were previously ignoring errors and hiding stderr for this code... Changes I've made since have just made the errors visible... lol

I can only reproduce this on the first invocation of the package manager in a fresh chroot. After one kiss invocation (with the error) it never appears again... This happens if the directory exists or not. Certainly very weird.

dylanaraps commented 3 years ago

Let's move discussion here: https://github.com/kisslinux/kiss/issues/218