arakashic / chromatica.nvim

Clang based syntax highlighting for Neovim
MIT License
299 stars 17 forks source link

Debug logging assumes location of clang binary relative to library #48

Closed Muon closed 6 years ago

Muon commented 6 years ago

I'm on Ubuntu 16.04, and I'm running Neovim with Chromatica. Some highlighting is missing, so I wanted to debug it. However, when trying to run ChromaticaEnableLog, the following occurs:

[chromatica] Logging to chromatica.log
Error detected while processing function chromatica#enable_logging:
line    6:
error caught in request handler 'chromatica_enable_logging ['INFO', 'chromatica.log']':
Traceback (most recent call last):
  File "/home/student.unimelb.edu.au/mnazecic/.config/nvim/plugged/chromatica.nvim/rplugin/python3/chromatica/__init__.py", line 29, in enable_logging
    self.__chromatica.dump_debug_info()
  File "/home/student.unimelb.edu.au/mnazecic/.config/nvim/plugged/chromatica.nvim/rplugin/python3/chromatica/chromatica.py", line 94, in dump_debug_info
    clang_verbose_info = util.get_clang_include_path(self.library_path).decode()
  File "/home/student.unimelb.edu.au/mnazecic/.config/nvim/plugged/chromatica.nvim/rplugin/python3/chromatica/util.py", line 108, in get_clang_include_path
    stderr=subprocess.STDOUT)
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/bin/clang'

I found that it was because it was trying to find the Clang binary relative to the library path, but my Clang library is in /usr/lib/x86_64-linux-gnu/, so it ends up looking for /usr/lib/bin/clang. Could we perhaps also specify a path to the Clang binary?

arakashic commented 6 years ago

This should be fixed by the latest patch