preservim / tagbar

Vim plugin that displays tags in a window, ordered by scope
https://preservim.github.io/tagbar
Other
6.13k stars 485 forks source link

Tagbar doesn't populate, ctags.exe can't find file /tmp/vGCKBiZ/11.cs #723

Open Rimann91 opened 3 years ago

Rimann91 commented 3 years ago

The problem is exactly as the title states. I've pasted a debug log. Here is some info

alerque commented 3 years ago

This looks like a permission problem with your /tmp directory. If you have the same setup on a different computer maybe compare notes on what permissions that directory has and whether your user can create new directories inside that.

Rimann91 commented 3 years ago

@alerque I just checked, i have read write and execute permissions on the tmp folder on both machines. I also tested and created a directory and a file to make sure. Also, I was mistaken, this doesn not work on either of my machines, I just tested the other one again and I must have only tried on the WLS side of that one before. The problem only occurs when trying to use tagbar on the mounted C drive

alerque commented 3 years ago

Is your gotags (or ctags if that's what is getting executed) installed via Snap, Flatpack, or some other containerized package system? This sounds like a security ACL of some kind kicking in prohibiting the process access to the file system even when your user could otherwise do so.

Rimann91 commented 3 years ago

No downloaded a release directly from here https://github.com/universal-ctags/ctags-win32/releases Snap currently isn't supported by WLS

alerque commented 3 years ago

I'm sorry I'm not much more use here, I really don't know what the issues is and without a Windows machine or any experience with the latest generation of WLS I really don't know where to go from here. We need input from someone with the right experience.

raven42 commented 3 years ago

@Rimann91 as a workaround, does it work if you change your $TMP or $TMPDIR environment variable to something else? From other similar file system errors with the /tmp path from other vim scripts / plugins, I've seen people recommend adding something like the following in the .vimrc file to change the tempname() result.

For Linux:

let $TMPDIR=$HOME . '/tmp'

For Windows (at least I think you need to use a \ instead of /, though might need to escape it if this doesn't work directly... don't have windows vim setup to test it):

let $TMP=$HOME . '\tmp'

If this does work, then we can document this as a solution to change your tmp directory for vim. Note this does change the behavior of vim when using tempname(). See :h tempfile or :h tempname for more info.

sqqqrly commented 1 year ago

I was having the same problem on my Ubuntu 18.04 box. Golang files would show in tagbar, but not Makefile targets. I have complex Makefiles.

Adding let $TMPDIR=$HOME . '/tmp' fixed it. Thank you @raven42 .

I would see an error referring to /tmp/vLI6Gek/14. I had no such file. I did have a /tmp/vLI6Gek/1

╰─➤  alias cat
cat=/usr/games/lolcat

╰─➤  ls -ald /tmp/vlhvgk7
drwx------ 2 sqqqrly sqqqrly 4096 Jan 26 19:33 /tmp/vlhvgk7

╰─➤  ls -l /tmp/vLI6Gek/1
srwxrwxr-x 1 sqqqrly sqqqrly 0 Jan 31 15:33 /tmp/vLI6Gek/1

╰─➤  cat /tmp/vLI6Gek/1
Traceback (most recent call last):
        5: from /usr/games/lolcat:24:in `<main>'
        4: from /usr/lib/ruby/vendor_ruby/lolcat/cat.rb:107:in `cat!'
        3: from /usr/lib/ruby/vendor_ruby/lolcat/cat.rb:107:in `each'
        2: from /usr/lib/ruby/vendor_ruby/lolcat/cat.rb:110:in `block in cat!'
        1: from /usr/lib/ruby/vendor_ruby/lolcat/cat.rb:110:in `open'
/usr/lib/ruby/vendor_ruby/lolcat/cat.rb:110:in `initialize': No such device or address @ rb_sysopen - /tmp/vLI6Gek/1 (Errno::ENXIO)