[Github-comments] [geany/geany] "make check" unittests fail on Windows (#2677)

Enrico Tröger notifications at xxxxx
Fri Dec 11 14:00:52 UTC 2020


> From what I understood, when you change line endings from CRLF to LF in the test, this diff goes away. But then it means that the CRLFs in the test are the cause of the missing tags and there's some problem with parsing.

You are completely right.
I was somewhat confused because the generated tags within Geany were always fine regardless of the line endings of the source file.
But when generating a tags file from the command line, I can see clearly the difference (as in the testsuite diff).

> @eht16 Oh and one more important thing - I think there's a difference when you run a unit test and when you simply open a file in Geany. When you open a file in Geany, ctags parses the buffer from Scintilla we pass to it using MIO_TYPE_MEMORY. But when you run a unit test, I think ctags parses the file using MIO_TYPE_FILE (I haven't actually checked it but I think this is the case). With MIO_TYPE_MEMORY you get completely platform-independent code because it just runs C code that simulates file operations. But when you use MIO_TYPE_FILE, the MIO library delegates the file operations to the corresponding OS calls and the result can differ based on what platform you use and I believe this could be our case.

I thought we use MIO_TYPE_FILE for the initial read when opening a file in Geany. But we do not.
So, yes, my assumption was wrong.

https://gist.github.com/eht16/998aae6eaf0da2cc2b45f998bf05606e this is `tests/ctags/3184782.sql`.
This is actually interesting as there seem to be CRCRLF line endings, maybe this is part of the problem.

It also seems that not just SQL, Matlab and TeX parsers are affected, to verify I changed one of the C test files to CRLF line endings and it failed too.

I won't have access to the my Windows machine for the next weeks (and much time at all). But I was able to reproduce the behavior when cross-compiling in a Docker container which makes it more easy to debug and it is way faster :). I'll try to share the Dockerfile and build script soon.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2677#issuecomment-743207921
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20201211/001501a4/attachment.htm>


More information about the Github-comments mailing list