Closed hukl closed 7 years ago
Does /Users/hukl/Projekte/weberl/_build/default/lib/elli/include/elli.hrl
exist?
Yes it does :)
Here is the little project - hopefully you can reproduce it: weberl.zip
I unpacked the zip file and for me Vim can find the hrl, I get no errors. Interestingly, the command-line build was also successful for you, only Vim showed the errors.
A few questions might help to narrow the problem down:
Output from :make
:!/Users/hukl/.dotfiles/.vim/bundle/vim-erlang-compiler/compiler/erlang_check.erl --outdir . src/weberl_callback.erl 2>&1| tee /var/folders/r_/5h46wlnj5hj_j8n46f5zlsj00000gn/T/vV00b3d/3
Output from :version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Feb 3 2017 16:49:50)
MacOS X (unix) version
Included patches: 1-297
Compiled by travis@Traviss-Mac-592.local
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +cmdline_compl +digraphs +folding +lambda +mouse +multi_lang +profile +statusline +timers +wildignore
+arabic +cmdline_hist +dnd -footer +langmap +mouseshape -mzscheme +python/dyn -sun_workshop +title +wildmenu
+autocmd +cmdline_info -ebcdic +fork() +libcall +mouse_dec +netbeans_intg +python3/dyn +syntax +toolbar +windows
+balloon_eval +comments +emacs_tags +fullscreen +linebreak -mouse_gpm +num64 +quickfix +tag_binary +transparency +writebackup
+browse +conceal +eval -gettext +lispindent -mouse_jsbterm +odbeditor +reltime +tag_old_static +user_commands -X11
++builtin_terms +cryptv +ex_extra -hangul_input +listcmds +mouse_netterm +packages +rightleft -tag_any_white +vertsplit -xfontset
+byte_offset +cscope +extra_search +iconv +localmap +mouse_sgr +path_extra +ruby/dyn -tcl +virtualedit +xim
+channel +cursorbind +farsi +insert_expand +lua/dyn -mouse_sysmouse +perl/dyn +scrollbind +termguicolors +visual -xpm
+cindent +cursorshape +file_in_path +job +menu +mouse_urxvt +persistent_undo +signs +terminfo +visualextra -xsmp
+clientserver +dialog_con_gui +find_in_path +jumplist +mksession +mouse_xterm +postscript +smartindent +termresponse +viminfo -xterm_clipboard
+clipboard +diff +float +keymap +modify_fname +multi_byte +printer +startuptime +textobjects +vreplace -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/opt/libya
ml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework Cocoa
-fstack-protector -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE
rebar version is: rebar 3.3.5 on Erlang/OTP 19 Erts 8.2
vim-erlang-compiler commit hash: d26f2ed61be9f8f6e4fb952a73bc5514fc7cd1d8
Thanks, I managed to reproduce it (I had to start Vim in the same dir where the file is).
@hukl: I pushed a fix to my rebar3_abs branch (https://github.com/hcs42/vim-erlang-compiler/commits/rebar3_abs). Could you check whether this fixes the problem for you too? (If not, please run erlang_check again, I added some additional printouts).
Hmm it does not fix the issue for me sadly :/ Here is the output
/Users/hukl/dotfiles/.vim/bundle/vim-erlang-compiler/compiler/erlang_check.erl --outdir . src/weberl_callback.erl -v
Verbose mode on.
Found project root: "/Users/hukl/Downloads/weberl"
Try build system: rebar3
Found build file: ["/Users/hukl/Downloads/weberl"] "/Users/hukl/Downloads/weberl/rebar.lock"
Found build file: ["/Users/hukl/Downloads/weberl"] "/Users/hukl/Downloads/weberl/rebar.config"
rebar.config read: /Users/hukl/Downloads/weberl/rebar.config
rebar3 executable found: /usr/local/bin/rebar3
Absolute path to rebar3 executable: /usr/local/bin/rebar3
Call: QUIET=1 "/usr/local/bin/rebar3" as "default" path
Result: /Users/hukl/Downloads/weberl/_build/default/lib/elli/ebin /Users/hukl/Downloads/weberl/_build/default/lib/weberl/ebin
Code paths: ["/Users/hukl/Downloads/weberl/_build/default/lib/weberl/ebin",
"/Users/hukl/Downloads/weberl/_build/default/lib/elli/ebin",".",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/kernel-5.1.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/stdlib-3.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/xmerl-1.3.12/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/wx-1.8/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/typer-0.9.11/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/tools-2.9/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/syntax_tools-2.1.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/ssl-8.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/ssh-4.4/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/snmp-5.2.4/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/sasl-3.0.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/runtime_tools-1.11/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/reltool-0.7.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/public_key-1.3/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/percept-0.9/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/parsetools-2.1.4/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/otp_mibs-1.1.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/os_mon-2.4.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/orber-3.8.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/observer-2.3/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/mnesia-4.14.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/megaco-3.18.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/inets-6.3.4/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/ic-4.4.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/hipe-3.15.3/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/gs-1.6.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/eunit-2.3.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/et-1.6/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/erts-8.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/erl_interface-3.9.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/erl_docgen-0.6.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/eldap-1.2.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/edoc-0.8.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/diameter-1.12.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/dialyzer-3.0.3/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/debugger-4.2.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/crypto-3.7.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosTransactions-1.3.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosTime-1.2.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosProperty-1.2.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosNotification-1.2.2/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosFileTransfer-1.2.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosEventDomain-1.2.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosEvent-2.2.1/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/compiler-7.0.3/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/common_test-1.13/ebin",
"/usr/local/Cellar/erlang/19.2/lib/erlang/lib/asn1-4.0.4/ebin"]
Compiling: compile:file("/Users/hukl/Downloads/weberl/src/weberl_callback.erl",
[warn_export_all,warn_export_vars,warn_shadow_vars,warn_obsolete_guard,
warn_unused_import,report,debug_info,debug_info,
{outdir,"/Users/hukl/Downloads/weberl/."},
{i,"/Users/hukl/Downloads/weberl/src/../include"}])
any ideas yet? :/
Do you also see the error when you use :make? Do you see the error when you call erlang_check
directly from the shell? Or is the error shown only with Vim's markers when you save the file?
If the errors are shown only with Vim's markers, then please edit line 56 in autoload/erlang_compiler.vim so that we call the script with the verbose flag (note the space character inside the string):
- \ erlang_compiler#GetFlymakeOptions()
+ \ erlang_compiler#GetFlymakeOptions() . ' -v'
Then please start a new Vim, save the problematic file (so that you see the errors), type ":lopen" to open the output of make, and send the whole contents of that Window.
I see the errors right when I open the file and :lopen says right away:
src/weberl_callback.erl|4 error| can't find include lib "elli/include/elli.hrl"
src/weberl_callback.erl|9 error| record req undefined
src/weberl_callback.erl|5 warning| behaviour elli_handler undefined
So I can't tell if calling :make after opening the file fills up :lopen with the three errors or if its still from opening the file.
When I run erlang_check from the shell I don't see errors.
With the suggested '-v' addition to line 56 I get the following output in :lopen when I do a save:
|| Verbose mode on.
Found project root|| "/Users/hukl/Projekte/weberl"
Try build system|| rebar3
Found build file|| ["/Users/hukl/Projekte/weberl"] "/Users/hukl/Projekte/weberl/rebar.lock"
Found build file|| ["/Users/hukl/Projekte/weberl"] "/Users/hukl/Projekte/weberl/rebar.config"
rebar.config read|| /Users/hukl/Projekte/weberl/rebar.config
Code paths|| ["/Users/hukl/Projekte/weberl/_build/default/lib/weberl/ebin",
|| "/Users/hukl/Projekte/weberl/_build/default/lib/elli/ebin",".",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/kernel-5.1.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/stdlib-3.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/xmerl-1.3.12/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/wx-1.8/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/typer-0.9.11/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/tools-2.9/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/syntax_tools-2.1.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/ssl-8.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/ssh-4.4/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/snmp-5.2.4/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/sasl-3.0.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/runtime_tools-1.11/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/reltool-0.7.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/public_key-1.3/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/percept-0.9/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/parsetools-2.1.4/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/otp_mibs-1.1.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/os_mon-2.4.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/orber-3.8.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/observer-2.3/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/mnesia-4.14.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/megaco-3.18.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/inets-6.3.4/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/ic-4.4.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/hipe-3.15.3/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/gs-1.6.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/eunit-2.3.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/et-1.6/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/erts-8.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/erl_interface-3.9.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/erl_docgen-0.6.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/eldap-1.2.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/edoc-0.8.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/diameter-1.12.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/dialyzer-3.0.3/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/debugger-4.2.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/crypto-3.7.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosTransactions-1.3.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosTime-1.2.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosProperty-1.2.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosNotification-1.2.2/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosFileTransfer-1.2.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosEventDomain-1.2.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/cosEvent-2.2.1/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/compiler-7.0.3/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/common_test-1.13/ebin",
|| "/usr/local/Cellar/erlang/19.2/lib/erlang/lib/asn1-4.0.4/ebin"]
Compiling|| compile:file("/Users/hukl/Projekte/weberl/src/weberl_callback.erl",
|| [warn_export_all,warn_export_vars,warn_shadow_vars,warn_obsolete_guard,
|| warn_unused_import,report,debug_info,debug_info,strong_validation,
|| {i,"/Users/hukl/Projekte/weberl/src/../include"}])
These are the other bundles/plugins I'm using:
JavaScript-Indent
ack.vim
ctrlp.vim
delimitMate
django.vim
nerdcommenter
nerdtree
supertab
syntastic
vim-ansible-yaml
vim-erlang-compiler
vim-erlang-tags
vim-go
vim-javascript-syntax
vim-pathogen
vim-tags
and my vimrc is here: https://github.com/hukl/dotfiles/blob/master/.vimrc
maybe some weird interaction with something else?
Oh I have a terrible suspicion - its actually Syntastic which is going crazy there :/
Yep confirmed - I have just disabled syntastic for erlang and now it behaves as expected. I'm so sorry to have wasted your time with this :/
No worries. I was running out of ideas...
@hukl how to disable syntastic for erlang?
let g:syntastic_mode_map = { 'passive_filetypes': ['erlang'] }
It works.
I have a similar problem to the previous -include issue. I'm using rebar3.
In a module I've included the header of a dependency.
-include_lib("elli/include/elli.hrl").
In vim I'm getting a warning for the include_lib statement which says "can't find include lib "elli/include/elli.hrl"
However rebar3 compile works fine.
As suggested by the previous issue I ran
:make
and added a -v to the output which is as followsAny idea what could be the issue?