尝试在32位C ++ / MFC解决方案上运行sonar-runner时出现错误:
Sonar Runner:无法解压缩Microsoft Compiler的版本
这是输出:
11:56:44.856 INFO - 18645 files indexed
11:57:02.381 INFO - Quality profile for c: Sonar way
11:57:02.381 INFO - Quality profile for cpp: Sonar way
11:57:02.540 INFO - cpp EVALUATION [Expiration: 2015-10-13, Server: *]
11:57:02.540 INFO - Sensor Lines Sensor
11:57:02.747 INFO - Sensor Lines Sensor (done) | time=207ms
11:57:02.747 INFO - Sensor QProfileSensor
11:57:02.749 INFO - Sensor QProfileSensor (done) | time=2ms
11:57:02.750 INFO - Sensor InitialOpenIssuesSensor
11:57:02.754 INFO - Sensor InitialOpenIssuesSensor (done) | time=4ms
11:57:02.755 INFO - Sensor ProjectLinksSensor
11:57:02.759 INFO - Sensor ProjectLinksSensor (done) | time=4ms
11:57:02.759 INFO - Sensor VersionEventsSensor
11:57:02.764 INFO - Sensor VersionEventsSensor (done) | time=5ms
11:57:02.764 INFO - Sensor SquidSensorC
11:57:02.766 INFO - C/C++ Preprocessor in silent mode. Relaunch the analysis wi
th "sonar.verbose=true" to see issues encountered by the preprocessor.
11:57:03.214 INFO - Using build-wrapper output: E:\dev\ProjectDir\build
-wrapper-out\build-wrapper-dump.json
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 28.126s
Final Memory: 17M/200M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to extract version of Microsoft Compiler
环境:
任何可能导致此问题的想法?
答案 0 :(得分:1)
build-wrapper生成一个名为'build-wrapper-dump.json'的文件。如果您打开此文件,您会看到顶部有一个名为“捕获”的部分。看起来可能是这样的:
"captures":[
{
"compiler":"msvc-cl",
"executable":"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\x86_amd64\\CL.exe",
"stdout":"",
"stderr":""
}
虽然看起来像这样:
"captures":[
{
"compiler":"msvc-cl",
"executable":"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\x86_amd64\\CL.exe",
"stdout":"usage: cl [ option... ] filename... [ \/link linkoption... ]\r\n",
"stderr":"Microsoft (R) C\/C++ Optimizing Compiler Version 18.00.40629 for x64\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n"
}
要获取缺少的值,您需要从Visual Studio命令提示符执行构建包装器。此命令提示符设置一些额外的环境变量。希望这会有所帮助。