Bug 321982 - Clicking on cmake error line does not open the corresponding file
Summary: Clicking on cmake error line does not open the corresponding file
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Output Views (show other bugs)
Version: 4.5.60
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
: 342800 360854 376571 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-07-05 09:32 UTC by Kevin Funk
Modified: 2017-08-23 18:34 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.2.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Funk 2013-07-05 09:32:16 UTC
Error looks like this:

CMake Error at foo/CMakeLists.txt:435 (ADD_LIBRARY):
  Cannot find source file:

    mysourcefile.cpp
(...)

Clicking on line number 1 does not open the corresponding CMakeLists.txt file.


Reproducible: Always
Comment 1 Milian Wolff 2013-07-05 11:35:13 UTC
Someone just needs to add the proper filter to kdevplatform/outputview/outputfilteringstrategies.cpp or let it be supplied by the cmake plugin.
Comment 2 Kevin Funk 2013-07-19 08:30:29 UTC
@Morten: Could you please elaborate what CompilerFilterStrategy::errorInLine is supposed to do?

I'm especially puzzled about this part of that method's body:

                if( curErrFilter.compiler == "cmake" ) { // Unfortunately we cannot know if an error or an action comes first in cmake, and therefore we need to do this
                    if( d->m_currentDirs.empty() ) {
                        d->putDirAtEnd( d->m_buildDir.upUrl().toLocalFile() );
                    }
                }
                item.url = d->urlForFile( regEx.cap( curErrFilter.fileGroup ) );

What is upUrl() doing in there? Are you assuming that the build folder always resides in the source directory? Could you have a look please?
Comment 3 Morten Danielsen Volden 2013-07-24 22:45:27 UTC
Hi Kevin

First, I must apologise for not replying before now ( still haven't  been
able to replace my broken PC ).

Looking at it I think your point is valid. The source dir is not
necessarily the parent dir of the build dir. But frankly I'm a little
uncertain about what to do about it - since the source dir could, in
theory, be located anywhere.

 Any suggestions are welcome.

Regards

Morten






fredag den 19. juli 2013 skrev Kevin Funk :

> https://bugs.kde.org/show_bug.cgi?id=321982
>
> --- Comment #2 from Kevin Funk <kevin@kfunk.org <javascript:;>> ---
> @Morten: Could you please elaborate what
> CompilerFilterStrategy::errorInLine is
> supposed to do?
>
> I'm especially puzzled about this part of that method's body:
>
>                 if( curErrFilter.compiler == "cmake" ) { // Unfortunately
> we
> cannot know if an error or an action comes first in cmake, and therefore we
> need to do this
>                     if( d->m_currentDirs.empty() ) {
>                         d->putDirAtEnd(
> d->m_buildDir.upUrl().toLocalFile() );
>                     }
>                 }
>                 item.url = d->urlForFile( regEx.cap(
> curErrFilter.fileGroup )
> );
>
> What is upUrl() doing in there? Are you assuming that the build folder
> always
> resides in the source directory? Could you have a look please?
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
Comment 4 Todd Nowacki 2014-02-08 01:11:39 UTC
Patch progress/discussion:
https://git.reviewboard.kde.org/r/115506/
Comment 5 Kevin Funk 2017-01-16 18:18:54 UTC
*** Bug 360854 has been marked as a duplicate of this bug. ***
Comment 6 Kevin Funk 2017-01-16 18:18:57 UTC
*** Bug 342800 has been marked as a duplicate of this bug. ***
Comment 7 Kevin Funk 2017-02-17 07:52:56 UTC
*** Bug 376571 has been marked as a duplicate of this bug. ***
Comment 8 Axel Kellermann 2017-08-01 14:33:53 UTC
I had a look at this issue and the solution proposed before. I think the easiest and least invasive way to fix this is to just filter the project directory out of the cmake output. The code change is minimal and just a couple of lines long. I also tried to cover Windows paths in the regex, but I don't have a system to test this properly.

For my patch proposal see: https://phabricator.kde.org/D7040
Comment 9 Morten Danielsen Volden 2017-08-23 16:09:10 UTC
Differential https://phabricator.kde.org/D7040 has been submitted to master branch
Comment 10 Kevin Funk 2017-08-23 18:34:44 UTC
So we consider this fixed? Closing then.

Please reopen if it's not fixed.