bradford-smith94/informant

News comes in too late

Closed this issue · 2 comments

Firstly, this isn't necessarily an issue with Informant. It seems to be working okay (perhaps).

Today I tried a pacman -Syu and got the following error:

error: failed to commit transaction (conflicting files)
libxml2: /usr/lib/python3.10/site-packages/__pycache__/drv_libxml2.cpython-310.pyc exists in filesystem
libxml2: /usr/lib/python3.10/site-packages/__pycache__/libxml2.cpython-310.pyc exists in filesystem
Errors occurred, no packages were upgraded.

My first (probably incorrect) instinct was to delete these files. Rerunning the command then resulted in this:

:: Running pre-transaction hooks...
(1/3) Checking Arch News with Informant ...
:: informant: Stopping upgrade to print news
libxml2>=2.9.12-6 update may require manual intervention
Mon, 27 Dec 2021 06:17:35 +0000

The libxml2 package prior to version 2.9.12-6 was missing the compiled python
modules. This has been fixed in 2.9.12-6, so the upgrade may need to overwrite any
untracked pyc files created. If you get errors like these



    libxml2: /usr/lib/python3.10/site-packages/__pycache__/drv_libxml2.cpython-310.opt-1.pyc exists in filesystem
    libxml2: /usr/lib/python3.10/site-packages/__pycache__/drv_libxml2.cpython-310.pyc exists in filesystem
    libxml2: /usr/lib/python3.10/site-packages/__pycache__/libxml2.cpython-310.opt-1.pyc exists in filesystem
    libxml2: /usr/lib/python3.10/site-packages/__pycache__/libxml2.cpython-310.pyc exists in filesystem


when updating, use



    pacman -Syu --overwrite /usr/lib/python3.10/site-packages/__pycache__/\*


to perform the upgrade.


:: informant: You can re-run your pacman command to complete the upgrade
error: command failed to execute correctly
error: failed to commit transaction (failed to run transaction hooks)
Errors occurred, no packages were upgraded.

Which would have been pretty useful to have seen before :)

I installed Informant via the AUR, so my questions are:

  1. Is it possible to fail on news earlier?
  2. Is there a reason why we don't?

Yeah...

Informant is already setup as a PreTransaction hook, which I believe is as early as we can trigger a hook. The problem is some errors (like this one) may happen before we get to triggering hooks.

In order to trigger earlier I think we need to be a full pacman wrapper, which wasn't as set and forget as I wanted.

A good habit might be running informant manually after any pacman error just to double check.

I suspected as much, and that makes sense. I'll have to make a mental note to check informant at the first sign of an issue.