Must-share information (formatted with Markdown):
-
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- Sonar 8.9.8.54436 enterprise
- sonar-scanner-vsts version 5.4.0
-
what are you trying to achieve
- We analyze c++ projects using azure devops. Since about two weeks our analysis fails:
D:\w\84\s\build_wrapper_output_directory\build-wrapper-dump.json was generated using 6.20.3 build-wrapper version, which does not match analyzer 6.20.4.45706 version.
We can see that build-wrapper-dump.json
is generated.
We can also see that the build-wrapper.log
contains the line
Tue Apr 26 14:26:27 2022: build-wrapper, version 6.20.3 (win-x86-64)
- what have you tried so far to achieve this
- Prepare analysis in Azure Devops with the following config:
#Exclude release solutions
#sonar.exclusions=**/275/s/dev/**
sonar.sourceEncoding=windows-1252
sonar.cfamily.build-wrapper-output=$(build.sourcesDirectory)\build_wrapper_output_directory
sonar.cfamily.threads=4
sonar.projectVersion=$(Build.BuildNumber)
sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml
sonar.cs.vstest.reportsPaths=**/*.trx
sonar.cpp.vscoveragexml.reportsPaths=**/*.coveragexml
sonar.cpp.vstest.reportsPaths=**/*.trx
#Exclude Cpp from build
#sonar.c.file.suffixes=-
#sonar.cpp.file.suffixes=-
#sonar.objc.file.suffixes=-
- We download the build-wrapper from our sonar instance:
$name="build-wrapper-win-x86"
Invoke-WebRequest -URI https://sonar.example.com/static/cpp/build-wrapper-win-x86.zip -OutFile "$name.zip"
Expand-Archive -LiteralPath ".\$name.zip" -DestinationPath build-wrapper
cd $(build.sourcesDirectory)\Dev\Pro
& $(build.sourcesDirectory)\build-wrapper\$name\build-wrapper-win-x86-64.exe --out-dir "$(build.sourcesDirectory)\build_wrapper_output_directory" MSBuild.exe ProCppCodeAnalysis.proj /t:Rebuild
- Run Code Analysis
ERROR: Exception in thread pool-1-thread-1
##[error]java.nio.file.InvalidPathException: Trailing char < > at index 70: D:/w/79/s/Dev/Pro/Src/UserInterface/Modules/InetoptPro/detailtextdlg.h
at sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at sun.nio.fs.WindowsPath.parse(Unknown Source)
at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
at java.nio.file.Paths.get(Unknown Source)
at com.sonar.cpp.jni.FileSystemOperations.realPath(FileSystemOperations.java:40)
at com.sonar.cpp.plugin.CFamilySensor.computeCanonicalPath(CFamilySensor.java:1056)
at java.util.HashMap.computeIfAbsent(Unknown Source)
at com.sonar.cpp.plugin.CFamilySensor.save(CFamilySensor.java:762)
at com.sonar.cpp.plugin.CFamilySensor.lambda$process$8(CFamilySensor.java:736)
at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.nio.file.InvalidPathException: Trailing char < > at index 70: D:/w/79/s/Dev/Pro/Src/UserInterface/Modules/InetoptPro/detailtextdlg.h
at sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at sun.nio.fs.WindowsPath.parse(Unknown Source)
at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
at java.nio.file.Paths.get(Unknown Source)
at com.sonar.cpp.jni.FileSystemOperations.realPath(FileSystemOperations.java:40)
at com.sonar.cpp.plugin.CFamilySensor.computeCanonicalPath(CFamilySensor.java:1056)
at java.util.HashMap.computeIfAbsent(Unknown Source)
at com.sonar.cpp.plugin.CFamilySensor.save(CFamilySensor.java:762)
at com.sonar.cpp.plugin.CFamilySensor.lambda$process$8(CFamilySensor.java:736)
at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
##[error]at java.lang.Thread.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
-
So overall it seems that sonar provides us build-wrapper version 6.20.3 but the analysis seems to expect 6.20.4 ?
-
In addition we have the strange exception that does not happen during a normal build