Closed dbitouze closed 4 years ago
I noticed the warnings while compiling TexStudio too and was planning to cleanup them for a while but did not have the time to provide a proper patch.
The warnings in scriptengine.cpp are caused by the fact the we cast functions that receive references as parameters to functions that receive pointers as parameters. This sort of works because most (probably all) C++ compilers internally implement references as pointers, but nothing guarantees that behavior, so if the compiler changes the implementation the scriptengine code may start crashing.
So even though it is not a problem at the moment, I guess it is better to fix those warnings. Using a reinterpret cast to remove the warnings is not a good approach since it doesn't fix the real problem that would be a crash if the compiler changes the internal implementation.
Unless someone else plans to fix the scriptengine warnings I will try to prepare a patch in about a week.
The linker warnings seem to be caused by the fact that it finds 32-bit libraries before it finds the correct 64-bit libraries. Since the incorrect 32-bit libraries are ignored the warnings are harmless. It is not good to silence them since we don't want to ignore real issues. Probably could be fixed in the makefile by changing the linker search path, but should be done carefully in order to avoid breaking the build.
https://github.com/texstudio-org/texstudio/pull/753 is the first set of fixes for the warnings. In a few days I will provide two more patchsets. One for the linker warnings and one for the tests. Most of the test FAILs seem to be caused by running the tests with a non-English locale, but it is a good idea to have then cleaned up.
753 is the first set of fixes for the warnings. In a few days I will provide two more patchsets. One for the linker warnings and one for the tests.
Thanks!
Most of the test FAILs seem to be caused by running the tests with a non-English locale, but it is a good idea to have then cleaned up.
Especially because, if I'm right, it never used to happen before.
The compiler warnings and the failed tests have been fixed so the only remaining issue are the linker warnings where the ld complains that the 32-bit libraries are found before the 64-bit ones. It is mostly a cosmetic issue, but probably worth investigating to see why it happens.
I am unable to reproduce that bug when building on Linux. @dbitouze do you still observe the ld warnings when you use BUILD.sh ? If you do then can you please post here (as an attachment) the Makefile generated by BUILD.sh on your computer?
Currently (TeXstudio 2.12.16 (git 2.12.16-112-g6b082485)):
Makefile
to be found here since not supported by GitHub), FAIL! : LatexParsingTest::test_latexLexing(section command, multi-line optional) 'Token::generalArg == Token::UnknownTokenType' returned FALSE. (incorrect subtype at index 1)
@dbitouze Thank you for the update.
The Makefile link that you posted is not freely accessible. When I click on it I get a login page in French asking for username/password. The easiest way to attach a file in GitHub is by clicking on the text below the window where you write your messages. The text says
Attach files by dragging & dropping, selecting or pasting them.
So please use it to attach the Makefile. Regarding the problem where you say that it is not supported by GitHub, I think you can workaround it by renaming the file, e.g. rename it to mymakefile.txt and then try to attach it. I suspect that GitHub only checks the file extension and changing it to .txt will fix the upload problem.
Regarding the failed test LatexParsingTest::test_latexLexing, thank you. I will take a look.
By the way it when you run TXS for the first time it only executes a subset of all the tests. You can execute all the tests by running it from command line with the option --execute-all-tests, .e.g
./texstudio --execute-all-tests
It does not have to be freshly compiled for that, that is you can execute the tests at any moment not just the first time.
The Makefile link that you posted is not freely accessible.
Sorry. Should be fixed now.
You can execute all the tests by running it from command line with the option --execute-all-tests, .e.g
./texstudio --execute-all-tests
OK. Same result: only a single warning.
It does not have to be freshly compiled for that, that is you can execute the tests at any moment not just the first time.
Good to know, thanks!
Thank you for the Makefile. This time I could download it successfully.
The failed test in LatexParsingTest::test_latexLexing is interesting. I am unable to reproduce this failed test on my computer and at first glance it does not seem to be related to the locale language settings.
So it could be a bug in the latex parser or maybe a bug in the test itself :-) I will try to look into it in more detail in the next 2-3 days.
@dbitouze OK, I think I figured out what is the issue with the linker warnings. It seems that on 64-bit machines the Qt project file incorrectly adds the /usr/lib to the linker path instead of /usr/lib64 but I want to confirm that before I actually suggest a fix.
Can you please run the following command and provide its output:
ls -la /usr/lib/
Here it is: ls-la_usr_lib.txt
@dbitouze
I made a patch that fixes the linker warnings. Can you please try building the linker-warnings branch from my repository:
git clone https://github.com/MeanSquaredError/texstudio.git
cd texstudio
git checkout linker-warnings
./BUILD.sh
And then let me know if you still see the linker warnings during build.
@MeanSquaredError Sorry for the delay.
FAIL! : LatexParsingTest::test_latexLexing(section command, multi-line optional) 'Token::generalArg == Token::UnknownTokenType' returned FALSE. (incorrect subtype at index 1)
@dbitouze Thank you for the feedback. I opened a PR for the linker warnings here https://github.com/texstudio-org/texstudio/pull/796 So now what is left is just to fix that single remaining test error.
@dbitouze I investigated the remaining test fail
FAIL! : LatexParsingTest::test_latexLexing(section command, multi-line optional) 'Token::generalArg == Token::UnknownTokenType' returned FALSE. (incorrect subtype at index 1)
It seems that some of the auto-generated or user .cwl files is messing up the test LatexParsingTest::test_latexLexing(section command, multi-line optional)
Can you please upload an archive (e.g. .zip) of all your auto-generated and user .cwl files. On my Linux/KDE these are located in ~/.config/texstudio/completion/
So something like
zip -r all_cwl.zip ~/.config/texstudio/completion/
should do the trick.
@MeanSquaredError
I investigated the remaining test fail
Thanks!
Can you please upload an archive (e.g. .zip) of all your auto-generated and user .cwl files.
Here it is: all_cwl.zip.
@dbitouze
Can you please run the following command and paste here its output
grep Completion ~/.config/texstudio/texstudio.ini
This should show all settings from the "Completion" section of your configuration file.
@MeanSquaredError
Here it is:
╭─bitouze@drums-bis ~/latex/divers
╰─➤ grep Completion ~/.config/texstudio/texstudio.ini
Editor\Completion=true
Editor\Completion%20Auto%20Insert%20Math=true
Editor\Completion%20Auto%20Insert%20Math%20Start=$
Editor\Completion%20Auto%20Insert%20Math%20Stop=$
Editor\Completion%20Case%20Sensitive=0
Editor\Completion%20Complete%20Common%20Prefix=true
Editor\Completion%20EOW%20Completes=false
Editor\Completion%20Enable%20Tooltip%20Help=true
Editor\Completion%20Enable%20Tooltip%20Preview=true
Editor\Completion%20Files=latex-dev.cwl, latex-document.cwl, latex-mathsymbols.cwl, tex.cwl, yathesis.cwl
Editor\Completion%20Prefered%20Tab=0
Editor\Completion%20Show%20Placeholders=true
Editor\Completion%20Tab%20Relative%20Font%20Size%20Percent=100
Editor\Completion%20Use%20Placeholders=true
Editor\Parentheses%20Completion=true
@dbitouze Thank you for the information. While investigating this issue I came across several other bugs. I will try to prepare a few PRs with fixes in the next couple of days.
The fail in
LatexParsingTest::test_latexLexing(section command, multi-line optional)
is caused by the enabling of the completion file yathesis.cwl in the TXS settings. Disabling it from
Options / Configure TeXstudio / Completion / yathesis.cwl
allows the test to pass correctly.
Now what is left is to add a workaround for the bug...
Environment
During TXS' compilation, run by
sh BUILD.sh
, some warnings appear (not translated, I hope it will be understandable):and
Nevertheless, TXS is built but, when open afterwards, several failed tests appear: