Currently, the use of the cache directory for patch-hub, which is located at ${KW_CACHE_DIR}/patch_hub or ${HOME}/.cache/kw/patch_hub is used for patchsets downloaded using the b4 tool as introduced by commit 51f39380.
However, we don't't check if the path to this cache directory exists before using it. This causes a crash when entering a "Patchset Details and Actions" screen, as it needs the downloaded patchset by b4, which fails due to the path to the cache directory not existing.
This flew under the radar because, for some reason, Arch-based distros (and Fedora-based as well) seem to create nonexistent parent directories in a path. As I use Arch (btw), I didn't notice this, but one user mentioned this error on a Debian system and the issue re-surfaced when testing the releases in a Debian container.
Edit: After some digging, I found that the b4 tool creates intermediary directories when using a custom path output (the case), and that the difference in the distros is how b4 behaves in this manner.
How to reproduce:
Create a container instance based on a Debian image and start a Bash session with
docker run -it debian:latest bash
Install curl, xz-utils, and b4 with
apt update && apt install curl xz-utils b4
Download the v0.1.1 release of patch-hub and decompress with
curl -LO https://github.com/kworkflow/patch-hub/releases/download/v0.1.1/patch-hub-x86_64-unknown-linux-gnu.tar.xz
tar -xvf patch-hub-x86_64-unknown-linux-gnu.tar.xz
Run patch-hub, consult a mailing list, and try opening a patchset to see the crash occur.
Expected behavior:
We should try to create the cache every time we use it.
Description:
Currently, the use of the cache directory for
patch-hub
, which is located at${KW_CACHE_DIR}/patch_hub
or${HOME}/.cache/kw/patch_hub
is used for patchsets downloaded using theb4
tool as introduced by commit 51f39380.However, we don't't check if the path to this cache directory exists before using it. This causes a crash when entering a "Patchset Details and Actions" screen, as it needs the downloaded patchset by
b4
, which fails due to the path to the cache directory not existing.This flew under the radar because, for some reason, Arch-based distros (and Fedora-based as well) seem to create nonexistent parent directories in a path. As I use Arch (btw), I didn't notice this, but one user mentioned this error on a Debian system and the issue re-surfaced when testing the releases in a Debian container.
Edit: After some digging, I found that the
b4
tool creates intermediary directories when using a custom path output (the case), and that the difference in the distros is howb4
behaves in this manner.How to reproduce:
curl
,xz-utils
, andb4
withpatch-hub
and decompress withpatch-hub
, consult a mailing list, and try opening a patchset to see the crash occur.Expected behavior:
We should try to create the cache every time we use it.
Screenshots
Setup:
Screenshot setup: Docker-Hub debian:latest image - digest 8dd517b3c9f Release version: version 0.1.1