deoplete-clang2
deoplete-clang2 copied to clipboard
Permission denied error?
Same setup works with deoplete-clang but not here.
I was just triggering asking for autocompletions after std::
using clang 5.0 in arch
[deoplete] Traceback (most recent call last):
[deoplete] File "/home/phc/.vim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 136, in gather_results
[deoplete] ctx['candidates'] = source.gather_candidates(ctx)
[deoplete] File "/home/phc/.vim/plugged/deoplete-clang2/rplugin/python3/deoplete/sources/deoplete_clang2.py", line 662, in gather_candidates
[deoplete] cmd, flags = self.build_flags(context)
[deoplete] File "/home/phc/.vim/plugged/deoplete-clang2/rplugin/python3/deoplete/sources/deoplete_clang2.py", line 505, in build_flags
[deoplete] flags = self.get_clang_flags(lang) + flags
[deoplete] File "/home/phc/.vim/plugged/deoplete-clang2/rplugin/python3/deoplete/sources/deoplete_clang2.py", line 226, in get_clang_flags
[deoplete] stdout = self.call_clang([], clang_flags, True)
[deoplete] File "/home/phc/.vim/plugged/deoplete-clang2/rplugin/python3/deoplete/sources/deoplete_clang2.py", line 303, in call_clang
[deoplete] stderr=subprocess.PIPE, cwd=cwd)
[deoplete] File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
[deoplete] restore_signals, start_new_session)
[deoplete] File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
[deoplete] raise child_exception_type(errno_num, err_msg, err_filename)
[deoplete] PermissionError: [Errno 13] Permission denied: ''
[deoplete] Could not get completions from: clang2. Use :messages for error details.
`
I can reproduce this error in my setup. If I print the contents of line 303, just before execution, I get this:
['', '-fsyntax-only', '-x', 'c', '-', '-v'] #value of variable "cmd"
So, no surprise that the execution fails. I wonder why the variable self.clang_path
is not properly set though.
self.clang_path is initialized to ''
in the constructor.
And it is set in on_event().
https://github.com/tweekmonster/deoplete-clang2/blob/787dd4dc7eeb5d1bc2fd3cefcf7bd07e48f4a962/rplugin/python3/deoplete/sources/deoplete_clang2.py#L147
If on_event() is not called, it will be ''
.
So no surprising.
What are possible causes of this issue? My configuration reads like this:
"configuration for deoplete-clang2
let g:deoplete#sources#clang#flags=['-darwin=10.13']
let g:deoplete#sources#clang#std={'c': 'c11', 'cpp': 'c++1z'}
I put a break point on on_event()
, but as completion is triggered, this function is never called, so the value of clang_path
does not get set.
I think self.clang_path
should be set in the constructor.
I tried this, but no luck - I continue to have the same error. It would be great if somebody could propose a serious patch here. Are we the only affected people? Is this plugin still being maintained?
The plugin is still maintained. But the author seems busy. I have created another source plugin.
https://github.com/Shougo/deoplete-clangx
@phcerdan can you post your clang version? or your os info, I also use arch, but I can not reproduce this issue.