Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Testing needed: new branch "preprocess" #753

Closed
lcd047 opened this issue Aug 1, 2013 · 18 comments
Closed

Testing needed: new branch "preprocess" #753

lcd047 opened this issue Aug 1, 2013 · 18 comments

Comments

@lcd047
Copy link
Collaborator

lcd047 commented Aug 1, 2013

I just committed a new branch named preprocess. This changes the way syntastic runs the checkers, essentially replacing lmake with the equivalent system and lgetexpr. As a result, error lines can now be preprocessed before being parsed, which can be used to bring some sanity to writing errorformats, and elliminates the need for some of the external auxilliary scripts (see html/validator for an example). Shell quoting now works as expected (that part was a major pain with lmake), and <NUL> characters in checkers' output are now automatically translated to <NL>s.

Please test as many checkers as possible, and report any problems in this thread. Thanks in advance!

Edit: I'm particularly interested in hearing from people using Windows. Does this work at all?

@slycelote
Copy link

@lcd047 I get the following error message on Windows with preprocess branch:

Error detected while processing function <SNR>25_UpdateErrors..<SNR>25_CacheErro
rs..11..SyntaxCheckers_cpp_gcc_GetLocList..SyntasticMake..<SNR>25_ReadFile:
line    1:
E484: Can't open file C:\Users\slycelote\AppData\Local\Temp\VIAE9A1.tmp
Error detected while processing function <SNR>25_UpdateErrors..<SNR>25_CacheErro
rs:
line   18:
E170: Missing :endfor
Error detected while processing function <SNR>25_UpdateErrors:
line   10:
E171: Missing :endif 

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 2, 2013

Ah, some code left over from testing, sorry about that! Please try 05dea5f.

@slycelote
Copy link

Strange, still the same message:

Error detected while processing function <SNR>25_UpdateErrors..<SNR>25_CacheErro
rs..11..SyntaxCheckers_cpp_gcc_GetLocList..SyntasticMake..<SNR>25_ReadFile:
line    1:
E484: Can't open file C:\Users\slycelote\AppData\Local\Temp\VIAE9A1.tmp
Error detected while processing function <SNR>25_UpdateErrors..<SNR>25_CacheErro
rs:
line   18:
E170: Missing :endfor
Error detected while processing function <SNR>25_UpdateErrors:
line   10:
E171: Missing :endif

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 2, 2013

Please set g:syntastic_debug to 1, run the checker, and post the output of :mes. Also, please post the output of:

:echo &shellpipe
:echo &shellredir
:echo &shellslash
:echo &shellxquote

@slycelote
Copy link

syntastic: debug: CacheErrors: Invoking checker: gcc
syntastic: debug: SyntasticMake: called with options: {'errorformat': '%-G%f:%s:
,%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%
l: %tarning: %m,%f:%l: %m', 'makeprg': 'g++ -x c++ -fsyntax-only  "..\test.cpp"
-I. -I.. -Iinclude -Iincludes -I../include -I../includes '}
Error detected while processing function <SNR>25_UpdateErrors..<SNR>25_CacheErro
rs..11..SyntaxCheckers_cpp_gcc_GetLocList..SyntasticMake..<SNR>25_ReadFile:
line    1:
E484: Can't open file C:\Users\slycelote\AppData\Local\Temp\VIB3074.tmp
Error detected while processing function <SNR>25_UpdateErrors..<SNR>25_CacheErro
rs:
line   18:
E170: Missing :endfor
Error detected while processing function <SNR>25_UpdateErrors:
line   10:
E171: Missing :endif 

shellpipe and shellredir: >%s 2>&1
shellslash: 0
shellxquote doesn't output anything

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 2, 2013

Ok, I think I got it now, via some ugly plumbing. Please try 8f40f27.

@slycelote
Copy link

No, still no changes.
I think I got this. system() function on Windows doesn't seem to support shell redirects. I wrote a program test.exe, which outputs command line arguments. If I execute command :let m = system('test.exe >foo.txt'), then m variable contains the string 'test.exe' (i.e. argv[0]), and there is no foo.txt file. If I do the same in Linux, m is empty and foo.txt contains the name of executable.

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 3, 2013

Hmm. Looking at the sources, this seems to happen because system() catches command output with > redirection, not pipes, and on Windows a second > takes precedence over ours. This might work then: e6091a9.

@slycelote
Copy link

No, still the same error. I tried prepending '&' to shellredir variable at line 362 of syntastic.vim (thought it might be a misprint, I don't know much about vim scripts though), to no avail.

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 3, 2013

Sigh Ok, I give up, I have no idea how to make it work with readfile().

Please try this version: ac87fd1. It uses plain system(), and thus doesn't solve the initial problem. It's still better than master, because of the sane quoting and preprocessing functions.

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 3, 2013

For what it's worth, ghcmod-vim mentioned in #317 uses vimproc to achieve sane inter-process communication, and vimproc in turn delegates the problem to a dynamic library written in C. This is too restrictive for too little gain for syntastic. :(

@slycelote
Copy link

Yes, I can confirm that this branch now works on Windows and Linux. Tested with Haskell and C++ checkers.

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 3, 2013

Ok, thanks.

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 7, 2013

I take it there are no other problems left? ;) I'd like to merge this to master. If anybody sees any reason against it, now would be a good time to speak.

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 9, 2013

I'm planning to merge this tomorrow morning. Last chance to complain.

@lcd047
Copy link
Collaborator Author

lcd047 commented Aug 10, 2013

Done.

@arecarn
Copy link

arecarn commented Oct 4, 2013

Usin Windows gVim 7.4.27, on the main branch of syntastic

I seem to be getting a similar error as slycelote, when using the python syntax checker.

  Error detected while processing function <SNR>63_UpdateErrors..<SNR>63_CacheErrors..47..SyntaxCheckers_python_python_GetLocList..SyntasticMake:
line   28:
E484: Can't open file C:/Users/arecarn/AppData/Local/Temp/VIoB307.tmp
Error detected while processing function <SNR>63_UpdateErrors..<SNR>63_CacheErrors:
line   25:
E170: Missing :endfor
Error detected while processing function <SNR>63_UpdateErrors:
line   10:
E171: Missing :endif

@lcd047
Copy link
Collaborator Author

lcd047 commented Oct 5, 2013

@arecarn This may look the same, but it isn't related. Please upgrade syntastic to master HEAD, and if you still have problems post a new issue. If you do, please explain what you did, what you expected to happen, and what happened instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants