-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no files found from JSON Compilation Database on linux if project contains upper case file names #2691
no files found from JSON Compilation Database on linux if project contains upper case file names #2691
Conversation
… case on linux convert files in JSON Compilation Database to lower case because unifyPath() converted file names to lower case
Hi @kragens, thanks for providing this. This issues seems to be related to #2700? Not sure if your fix works on all operating systems. Reading here https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Troubleshooting-Reports#file-path-issues there are also case-sensitive operating systems where making all lower-case is not working?
Have to check this. Regards, |
@@ -400,7 +401,7 @@ private Iterable<InputFile> getInputFiles(SensorContext context, CxxSquidConfigu | |||
// then analyze only the files contained in the db. | |||
var inputFilesInConfig = squidConfig.getFiles(); | |||
var result = StreamSupport.stream(inputFiles.spliterator(), false) | |||
.filter(f -> inputFilesInConfig.contains(Path.of(f.uri()))) | |||
.filter(f -> inputFilesInConfig.contains(Paths.get((Path.of(f.uri()).toString()).toLowerCase(Locale.getDefault())))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on the operating system and SonarQube Database settings paths can be case-sensitive (also on case-insensitive operating systems). Think making it always lowercase does not work?
Below the solution from the report sensors: sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/CxxReportSensor.java Line 70 in 3980334
sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/CxxReportSensor.java Line 115 in 3980334
|
The problem here is that alle files in inputFilesInConfig were made lowercase by sonar-cxx/cxx-squid/src/main/java/org/sonar/cxx/config/CxxSquidConfiguration.java Line 566 in 3980334
|
Hello @kragens, thx for the hint will have a look to it and try to find out why all is converted to lowercase … |
- the notation of paths in the db can deviate from the notation in the file system. - restoring the spelling of paths from the file system - close SonarOpenCommunity#2691
solved with #2725 |
Hi @kragens , you can test it with |
Tested successfully in release v2.2.0. thanks for fixing it @guwirth |
convert files in JSON Compilation Database to lower case because unifyPath() converted file names to lower case
This change is