When building a CMake based project with clang from KDevelop the warnings produced by Clang are getting partially trunkated in the build output view. See the attached screenshots for the output in the build output view and in a separate terminal. --- clang version 3.3 (branches/release_33 183898) Target: x86_64-unknown-linux-gnu Thread model: posix Qt: 4.8.4 KDE Development Platform: 4.10.5 "release 4" KDevelop: 4.5.60 Reproducible: Always Steps to Reproduce: 1. have a CMake/Make-based project with some buggy code 2. build it with Clang 3. see the actual warning messages of Clang being partially trunkated 4. build the project in a separate terminal to see the warnings about your buggy code Works fine for GCC.
Created attachment 80937 [details] Screenshot of KDevelop's build output view showing the bug
Created attachment 80938 [details] Actual output of build process in separate terminal
Odd, I cannot reproduce this. But for me, I get clang outputting color escape sequences which we do not support. Maybe thats related? I.e. this is what it outputs for me in our output view: [1m/home/milian/projects/kde4/kdevplatform/shell/tests/sessioncontrollertest.cpp:90:43: [0m[0;1;31merror: [0m[1mno viable conversion from 'const QString' to 'const ISessionLock::Ptr' (aka 'const QSharedPointer<KDevelop::ISessionLock>')[0m m_sessionCtrl->deleteSession( name ); [0;1;32m ^~~~ [0m[1m/usr/include/qt4/QtCore/qsharedpointer_impl.h:480:12: [0m[0;1;30mnote: [0mcandidate constructor not viable: no known conversion from 'const QString' to 'const QSharedPointer<KDevelop::ISessionLock> &' for 1st argument[0m inline QSharedPointer(const QSharedPointer<T> &other) : BaseClass(other) { } [0;1;32m ^
Actually, my issue was due to me defining CC/CXX with -fcolor-diagnostics since I'm using it through ccache. Do you happen to do something similar?
That in deed is the problem. It works fine without the -fcolor-diagnostics argument passed to clang via ccache. Also without using ccache at all. I'm using these two scripts for calling clang through ccache: $ cat /usr/local/bin/clang #!/bin/bash CCACHE_CPP2=yes /usr/bin/ccache /usr/bin/clang -Qunused-arguments -fcolor-diagnostics "$@" $ cat /usr/local/bin/clang++ #!/bin/bash CCACHE_CPP2=yes /usr/bin/ccache /usr/bin/clang++ -Qunused-arguments -fcolor-diagnostics "$@"
OK, then I'll rephrase the bug title here. Not sure though whether we really want to implement escape sequences. maybe the color ones would be enough though, who knows...
Would still be a nice junior job, in case we want to implement this. Marking as such.
I was looking into changing my debug outputs to use color, couldn't get it to work, and found this one -- concluding that the Kdevelop "Debug" toolview simply doesn't support color escape sequences... However, I noticed that the "Build" toolview apparently does support them: when configuring a project I always seem to get a "-- Configuring done" in green... Are these two toolviews releated and would it really be a "junior project" to port the feature from the "Build" to the "Debug" one?
@Claus: We're coloring this output using of pattern matching (see ./outputview/outputfilteringstrategies.cpp). I'd still love to see us interpreting (or stripping color codes). So, if you want to work on that...
Git commit 9991a24e3d543f015380ce4f8c3d2dfca377aba4 by Kevin Funk. Committed on 17/12/2015 at 11:58. Pushed by kfunk into branch '5.0'. OutputView: Filter ANSI sequences Summary: Hardcoding the filter function in the outputmodel for now. Not making this a filter strategy on purpose, it doesn't fit into the current architecture. Stripping ANSI sequences is merely a QString->QString transformation, while the filtering strategies do a QString->FilteredItem transformation. Related: bug 113128 FIXED-IN: 5.0 Subscribers: apol, kdevelop-devel Projects: #kdevelop Differential Revision: https://phabricator.kde.org/D660 M +15 -1 outputview/outputmodel.cpp M +63 -0 util/kdevstringhandler.cpp M +6 -0 util/kdevstringhandler.h M +19 -0 util/tests/test_stringhandler.cpp M +2 -0 util/tests/test_stringhandler.h http://commits.kde.org/kdevplatform/9991a24e3d543f015380ce4f8c3d2dfca377aba4
*** Bug 359229 has been marked as a duplicate of this bug. ***