Hi,
I got an error on running my sonar-scanner sources:
java.nio.file.InvalidPathException: Trailing char < > at index 75: E:\BuildAgent\work\c76803df29afe460\KE\sources\\\Common\KEService_defines.h
and I see that in build log trailing space in the of a file, but it is missing in the filename.
The error is reproduced on sonar-scanner v4.6.2.2472 and v4.7.0.2747.
Can someone help?
Colin
(Colin)
August 8, 2022, 9:51am
2
What version of SonarQube are you using?
[14:03:24] : [Step 6/7] 14:03:24.764 DEBUG: ‘KE\sources\Common\KEService_defines.h’ indexed with language ‘cpp’
[14:03:42] : [Step 6/7] 14:03:42.522 DEBUG: ‘KE/sources/Common/KEService_defines.h’ generated metadata with charset ‘UTF-8’
In build log I see that path with correct filename
Colin
(Colin)
August 8, 2022, 1:30pm
5
Take a look at this thread – it may not be the file names on the filesystem that is the issue
Nope, the actual file names are fine
The resolving of the includes in c++ causes this issue.
Something like this
#include "detailtextdlg.h "
Will be resolved to a path with trailing whitespaces, which causes the error in WindowsPathParser.
The Issue is solved by executing regex search and replace of all include statements that contained a trailing space, for example, #include "detailtextdlg.h " to #include "detailtextdlg.h"
i.e: our builds are green again
Thank you for help!
The root cause was really in the whitespace in #include this file, we found it and verify fix and now build status is green.
1 Like
Colin
(Colin)
August 11, 2022, 11:07am
9
Thanks for the follow-up! I can also let you know that in the next release of SonarQube, we’ll make sure this no longer fails the analysis .
system
(system)
Closed
August 18, 2022, 11:49am
11
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.