Code Monkey home page Code Monkey logo

Comments (10)

twpayne avatar twpayne commented on July 1, 2024 1

I've opened neovim/neovim#27499. As this is a bug in Neovim, I'll close this issue.

from chezmoi.

terminalmage avatar terminalmage commented on July 1, 2024 1

BTW @twpayne, I grabbed a pre-built nightly from here and cannot reproduce the bug with it. So it would appear that v0.10 should fix this.

Thanks again for taking the time to diagnose and report this upstream (even though it was closed as a duplicate).

from chezmoi.

twpayne avatar twpayne commented on July 1, 2024

I'm unable to reproduce this problem on macOS with nvim v0.9.5 and chezmoi v2.46.1. For me, the autocommand works as a expected and chezmoi applies the file on write and exits successfully.

Could you give steps to reproduce the problem in an isolated environment, e.g. a docker container?

Alternatively, if you add --debug to the chezmoi apply command, what do you see?

autocmd BufWritePost ~/.local/share/chezmoi/* ! chezmoi apply --debug --source-path "%"

from chezmoi.

terminalmage avatar terminalmage commented on July 1, 2024

I upgraded to 2.46.1, and am running neovim 0.9.5 as well. Still getting the error. This is on Ubuntu 20.04.

The debug logging disappears when nvim exits, so I can only get that logging when I write the buffer using :w. Here's that debug output, but keep in mind that the bad exit status for chezmoi only happens when I run :wq.

time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined/colors
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined/ftdetect
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined/ftplugin
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/dot_vim/pack/erik/start/user-defined/syntax
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=systemname=/home/erik/.local/share/chezmoi/private_dot_gnupg
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadDir component=system name=/home/erik/.local/share/chezmoi/private_dot_ssh
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadFile component=system name=/home/erik/.local/share/chezmoi/dot_vimrc size=3371 data="\" Status line\nset statusline=%F%M%r%h%w\\ %y\\ [%{&ff}]\\ ascii=\\%0..."
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=Lstat component=system n ame=/home/erik/.vimrc
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=Get component=persistentState bucket=entryState key=/home/erik/.vimrc value="{\n  \"type\": \"file\",\n  \"mode\": 420,\n  \"contentsSHA256\": \"39bc8626cbe3cbc60e1e6a337865df3e46bc9e536112748945bf8326946519c9\"\n}\n"
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=ReadFile component=system name=/home/erik/.vimrc size=3371 data="\" Status line\nset statusline=%F%M%r%h%w\\ %y\\ [%{&ff}]\\ ascii=\\%0..."
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=defaultPreApplyFunc targetRelPath=.vimrc targetEntryState.Type=file targetEntryState.Mode=420 targetEntryState.ContentsSHA256=39bc8626cbe3cbc60e1e6a337865df3e46bc9e536112748945bf8326946519c9 targetEntryState.contents="\" Status line\nset statusline=%F%M%r%h%w\\ %y\\ [%{&ff}]\\ ascii=\\%0..." lastWrittenEntryState.Type=file lastWrittenEntryState.Mode=420 lastWrittenEntryState.ContentsSHA256=39bc8626cbe3cbc60e1e6a337865df3e46bc9e536112748945bf8326946519c9 actualEntryState.Type=file actualEntryState.Mode=420 actualEntryState.ContentsSHA256=39bc8626cbe3cbc60e1e6a337865df3e46bc9e536112748945bf8326946519c9 actualEntryState.contents="\" Status line\nset statusline=%F%M%r%h%w\\ %y\\ [%{&ff}]\\ ascii=\\%0..."
time=2024-02-16T12:46:25.585-06:00 level=INFO msg=Close component=persistentState

I can reproduce this on Arch Linux with the same versions of chezmoi and neovim.

from chezmoi.

terminalmage avatar terminalmage commented on July 1, 2024

Will have to wait until later to try to reproduce in Docker.

from chezmoi.

terminalmage avatar terminalmage commented on July 1, 2024

One weird detail: On Arch Linux, I forgot to add the chezmoi.toml, and I still see the same error. Also, files open in ~/.local/share/chezmoi when chezmoi edit is invoked. I'm not sure why it does that when I had to disable edit.hardlink to get it to open the files there on Ubuntu.

from chezmoi.

twpayne avatar twpayne commented on July 1, 2024

Ah, I can now reproduce this. Interestingly, the autocmd works when you write the file from nvim (:w) but I also get the chezmoi: exit status 134 error when you write and quit nvim (:wq). So, I currently suspect some nvim weirdness.

from chezmoi.

terminalmage avatar terminalmage commented on July 1, 2024

Yeah, the autocmd works in both cases (:w then :q, or :wq). The changes do get successfully applied as expected in both cases. But only :wq causes chezmoi to exit nonzero.

from chezmoi.

twpayne avatar twpayne commented on July 1, 2024

So, it turns out that chezmoi is doing the right thing here. nvim is exiting with exit code 134, which is non-zero and therefore indicates failure. Exit code 134 typically means that the process received a SIGABRT. chezmoi is faithfully reporting nvim's self-reported failure. #3577 improves chezmoi's logging of all subprocesses it runs.

This is definitely a bug in NeoVim. I can reproduce it without involving chezmoi. I'll create an issue there.

from chezmoi.

terminalmage avatar terminalmage commented on July 1, 2024

Excellent, thanks so much for looking into it.

from chezmoi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.