Closed KuddLim closed 6 years ago
Thanks for the report. I can't quite see what's going wrong. Could you create a minimal reproduction of the issue that you could share?
I cannot give you my project repository but give you some hints:
Here's a part of my build output.
[build] [8/71] .... [build] [9/71] .... [build] [10/71] Building CXX object SubDir/SubLib/CMakeFiles/SubLib.dir/SubLib_unity.cpp.o
Build process seems going well until [10/71] but after that no build log is producing.
And..
At that point, there's error in vscode developer console. : "Error: Illegal argument: character must be non-negative"
When I try to build my project again, vscode tells "A CMake task is already running. Stop it before trying to configure" and no build task is starting. : But there's no running tasks (checked with "Tasks : Show Running Tasks" from command pallete)
I guess CMake task is not closing properly in some situation. To reproduce this error, I set up example project but failed to reproduce with this one.
Like I said, I cannot give you the project causing thie issue. However I can describe that.
thank you.
I have a hypothesis: When you build the project from an external command line, how many lines of output are produced? There was an earlier issue in the project where a huge amount of output would cause the build process to lock up.
My project has 552 source files and number of lines of output is : 1,869.
FYI, I use Ninja as build system. (Ninja buffers build output)
Those ~2K lines might cause the issue. I'll look into bringing back an old work-around.
I have quite the same issue when using CMake (Unix Makefiles).
My environment:
Everything works fine until I add the following line to the CMakeLists.txt file: set_property(SOURCE ${SOURCES} PROPERTY COMPILE_FLAGS ${CXX_WARNING_FLAGS})
The end result is that CMake-Tools extension doesn't seem to get indication that the build is done. The following log output is missing: [build] Build finished with exit code 0 , the extension is stuck and the taskbar is showing progress bar at 100%. The X Stop button does nothing and when trying to rebuild, I get that same error message "A CMake task is already running. Stop it before trying to configure"
The project builds fine with CMake from the terminal.
Adding warning flags? Sounds like you're causing more output in the panel, a similar possible cause. How many lines of output does your build produce with those warning flags set?
Lines of output:
Project contains 33 source files being compiled.
However, in my case it doesn't seem to be related to the number of output lines produced. I did the following test:
If you can think of any workaround, I would be happy to test it out.
Could you by chance create a minimal reproduction case?
Unfortunately I cannot send the failing project to you as it's company proprietary code. I have tried to get the same behavior on other projects but with no success... The exact same setup (CMakeLists.txt) for another project (with less sources) are working just fine.
Here's some exerts from the log:
With the property flag setting removed (ok case): 2018-05-02T12:37:00.620Z [info] [build] [100%] Built target ia_camera_relay 2018-05-02T12:37:00.628Z [info] [build] Build finished with exit code 0 2018-05-02T12:37:00.628Z [debug] [extension] [2611] cmake.build finished (returned 0)
With the property flag set (fail case): 2018-05-02T12:38:10.036Z [info] [build] [100%] Built target ia_camera_relay
Correction to my earlier comment, when the extension is "stuck" at 100% the Stop button do work, it doesn't remove the progress bar but I can rerun the CMake build again after pressing it. The following log output is generated when pressing that button: 2018-05-02T12:47:04.043Z [debug] [extension] [2031] cmake.stop started 2018-05-02T12:47:04.052Z [debug] [extension] [2031] cmake.stop finished (returned true)
Is there any chance you could run the extension in a debugger and try to work this out? If not, I can try to find a reproduction of the issue. I still think it is related to output being too much.
I debugged the extension and I think I found out why it fails in my case.
Part of the output from CMake in my build setup when reporting a warning: /opt/pleora/ebus_sdk/Ubuntu-x86_64/include/PvGenICamLib.h:66:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
proc.js
diagnostics.js
This causes the Promise (proc.js:43) to never complete and the aync wait (driver.js:580) to never fire and therefore the extension will not exit the build.
I removed the -1 from the parseInt(column) on line 252 as a workaround and now the build exits nicely. Also the warnings are listed in the Problems tab :+1: Although, the column is now off by one...
Excellent find! I can add a test case for this and all.
I'm curious about the line numbers though... I have to do that arithmetic because VSCode stores its line numbers in a different way than some compilers emit. Does the warning pragma actually appear on the first line?
I didn't include the whole output from the build. The warning line was just the first line to match the GCC compiler RegEx and cause this problem.
Before the line about the pragma warning, there was 5-6 lines showing the "call stack" i.e. through which files it goes before hitting the file causing the warning message. After that it showed the actual "offending" line causing the warning and on the last line the caret (^) referring to the column location.
I'm not sure why gcc is using 0 for the first character (column) on the line (instead of 1).
This should be fixed in the next release. Thanks for the help.
[[Thanks for your contribution! To make things easier, please fill out the template below, and delete any text marked in double square brackets.]]
[[If you have a question/suggestion/issue that doesn't fit this template, feel free to delete the template and write any free text.]]
[[Please delete any unused sections.]]
Brief Issue Summary
Build stops when compiling c++ projects. When I run ninja in gnome-terminal, it works well.
After last update of cmake-tools / vscode, I cannot build my project. It seems to be build process going well, but after some time there's no new build logs. There is no compiler (cc1plus) and cmake process exist at that moment.
[[For behavioral issues and feature requests/enhancements, use a list of steps to describe the problem or suggested behavior. For example:]]
I cannot give you my source code because it is company property. But I can give you verbose logs from vscode:
Platform and Versions
[[For issues, fill out the following. Otherwise delete this section.]]