You are not logged in.
I've tried installing a few vim plugins, e.g. vim-ctrlp from the official repos, vim-vimtex, vim-delimitmate-git, vim-csv from the AUR. In all cases, vimdoc.hook produced an error.
$ sudo pacman -S vim-ctrlp
...
:: Processing package changes...
(1/1) installing vim-ctrlp [################################################] 100%
Optional dependencies for vim-ctrlp
ctags: for searching tags [installed]
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating Vim help tags...
error: command failed to execute correctly
I looked at the hook file at /usr/share/libalpm/hooks/vimdoc.hook, and ran the command manually.
sudo bash -c '/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"'
but this did not produce an error.
EDIT: bug submitted
Last edited by Salkay (2022-07-24 06:05:30)
Offline
Mod note: moving to Pacman/upgrade issues.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
FWIW the bug was closed, since it was unable to be reproduced. I'm still hitting it though, so any input is appreciated.
Offline
Maybe use pacman's '--debug' flag and post that output...
Online
Thanks @dogknowsnx. Nothing much more I'm afraid. Presumably --debug wouldn't produce more output from the hooks?
$ sudo pacman --debug -S --asdeps vim-ctrlp
...
:: Running post-transaction hooks...
...
(2/2) Updating Vim help tags...
debug: executing "/usr/bin/vim" under chroot "/"
debug: call to waitpid succeeded
error: command failed to execute correctly
debug: unregistering database 'local'
debug: freeing package cache for repository 'local'
debug: unregistering database 'core'
debug: freeing package cache for repository 'core'
debug: unregistering database 'extra'
debug: freeing package cache for repository 'extra'
debug: unregistering database 'community'
debug: freeing package cache for repository 'community'
debug: unregistering database 'multilib'
$
Offline
Try
# pacman -Syu vim-runtime
Online
@dogknowsnx did you mean to reinstall vim-runtime? I just tried, but vim-runtime doesn't actually trigger vimdoc.hook. After reinstallation I tried to install vim-ctrlp again, and I hit the same problem.
Offline
Yes, because '/usr/share/libalpm/hooks/vimdoc.hook' is owned by 'vim-runtime'. No idea what the issue might be atm...
Last edited by dogknowsnx (2022-07-23 13:46:51)
Online
Thanks for your help anyway. Hopefully someone else has some insight.
Offline
Please post the contents of '/usr/share/libalpm/hooks/vimdoc.hook'
cat /usr/share/libalpm/hooks/vimdoc.hook
Online
Please post the contents of '/usr/share/libalpm/hooks/vimdoc.hook'
It's totally unmodified. It's identical to upstream.
Last edited by Salkay (2022-07-23 14:46:05)
Offline
I'm asking because you said you tested the hook manually issuing
Exec = /usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"
...
EDIT: The above command should open an interactive vim instance, and '--cmd ":q" would be skipped, hence the error message (when run from a pacman hook, since pacman doesn't get an exit 0 from it)... Maybe the presumably modified old '/usr/share/libalpm/hooks/vimdoc.hook' was still cached during the session where you reinstalled 'vim-runtime' and tried to install 'vim-ctrlp' (EDIT#2: 'sudo' alone would already have caused the hook to fail, anyway...) - do you still get the error after a logout/reboot?
Last edited by dogknowsnx (2022-07-24 07:02:20)
Online
Thanks again @dogknowsnx. I appreciate your help, but I'm confused on so many levels.
I'm asking because you said you tested the hook manually issuing
sudo bash -c '/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"'
Yes, that's correct. That's the same command as in the hook.
EDIT: The above command should open an interactive vim instance, and '--cmd ":q" would be skipped,
No, that command does not open up an interactive vim session. Firstly it's silent because of the -s part, but then the :q part quits vim anyway. I can run it manually and confirm that it quits, i.e.
$ sudo vim -es
:helptags /usr/share/vim/vimfiles/doc
:q
$
hence the error message (when run from a pacman hook, since pacman doesn't get an exit 0 from it)...
Ahhh! Yes, this is correct. I'm quite sure my sudo bash -c code is fine, but I do indeed get a non-zero code after running it.
Maybe the presumably modified old '/usr/share/libalpm/hooks/vimdoc.hook'
It was not modified on my system and never was.
was still cached during the session where you reinstalled 'vim-runtime' and tried to install 'vim-ctrlp'
I don't think this makes sense. Hooks are not cached.
(EDIT#2: 'sudo' alone would already have caused the hook to fail, anyway...) - do you still get the error after a logout/reboot?
This doesn't seem to make sense either. I need to run vim with root permissions, otherwise I can't run the command. For example, if I try and run the command with a non-root user.
E152: Cannot open /usr/share/vim/vimfiles/doc/tags for writing
However, you've put me onto the right path with the non-zero exit code. After more investigation, I think I've worked out the issue. Firstly, if I run the vim instance without the silent -s option it is more informative, i.e. sudo vim-e. I then run :helptags /usr/share/vim/vimfiles/doc, and can see the following issue.
::helptags /usr/share/vim/vimfiles/doc
E154: Duplicate tag "lazy" in file /usr/share/vim/vimfiles/doc/diffchar.txt
E154: Duplicate tag "quick" in file /usr/share/vim/vimfiles/doc/diffchar.txt
Looks like it's a bug with the vim-diffchar package, which has now been fixed upstream.
Thanks again for putting me on the right direction.
Offline
Thanks for the "feedback". I could only make assumptions based on the scarce debug output, your false claims and your not disclosing all aur vim packages that you've installed.
You prepended 'sudo (bash -c)' to the command from the hook when testing it - the command actually doesn't need root on a regular arch system (also see the upstream link you posted). To be clear, this is the exec array from the hook:
/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"
which is not the same as
sudo bash -c '/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"'
that you claim is the command from the hook...
Anyway. it doesn't matter since 'vim-diffchar' is an aur package (hence not part of a regular arch system)...
Last edited by dogknowsnx (2022-07-24 08:20:11)
Online
Sorry, I don't mean to offend you, and I hope it wasn't taken as such. I'm not sure which claims were false. I also disclosed none of my vim packages at all!
You prepended 'sudo (bash -c)' to the command from the hook when testing it - the command actually doesn't need root on a regular arch system (also see the upstream link you posted). To be clear, this is the exec array from the hook:
/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"
which is not the same as
sudo bash -c '/usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"'
that you claim is the command from the hook...
My understanding (and again I could be wrong) is that pacman hooks are essentially run as a root user. Hence, if I were to run the first command as a non-root user it would be different from running is from the hook. Which is indeed what I saw with it causing permission errors.
Anyway apologies again if I have offended. Thank you again for your help.
Offline
Afaiu executing a root command from a hook is like executing it from inside a script, and one would need to provide credentials for it, which coincides with a modified hook I just tested.
Anyway, glad you were able to figure it out - no hard feelings, have a nice day.
Online
Anyway, glad you were able to figure it out - no hard feelings, have a nice day.
You too! Honestly, I wouldn't have worked it out without your help, so I'm sincerely sorry if it came across the wrong way. Thank you again.
Offline