I am using Windose 7, compiler for CCS 3.3 using TI 2000 for SonarCloud.
Last time I failed to compile due to using the wrong compiler, and now I am still getting the same error as before after changing to the above compiler.
Here are the problems I encountered.
17:45:58.818 INFO: 0/114 files marked as unchanged
17:45:58.819 INFO: Cache: 0/0 hits, 125 bytes
17:45:58.820 INFO: 0 compilation units analyzed
17:45:59.547 INFO: ------------------------------------------------------------------------
17:45:59.548 INFO: EXECUTION FAILURE
17:45:59.551 INFO: ------------------------------------------------------------------------
17:45:59.552 INFO: Total time: 1:25.570s
17:45:59.881 INFO: Final Memory: 39M/134M
17:45:59.881 INFO: ------------------------------------------------------------------------
17:45:59.882 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found empty. Please make sure that:
* you are using the latest version of the build-wrapper and the CFamily analyzer
* your compiler is supported
* you are wrapping your build correctly
* you are wrapping a full/clean build
* if you are building your project inside a Docker container, build-wrapper is wrapping the build process inside the container and not wrapping the external Docker process
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
I can provide files for build-wrapper.log, build-wrapper-dump.json, SonarCloud.bat
I hope this problem can be solved.
Thank you in advance.
I’m not familiar with the build process for C2000, but here are things you should be able to check:
Is the command in sonarCloud.bat doing a clean build? All files must be compiled for build-wrapper to see the compiler invocations and record the necessary information for the analysis.
It seems other people use eclipsec.exe to build C2000 projects from the command line. I also found this documentation about eclipsec.exe, but you may have to upgrade your CCS version.
If you figure out how to do a clean build with CCS 3.3, it is possible build-wrapper may still not work. In that case, I would encourage you to upgrade if you can since this version wasn’t updated since 2009.
Umm. Sorry can you explain more clearly, what is “clean build”.
I see more different compiler have different “clean build” write method,
How do I know how to write “Clean build” in CCS or eclipsec ?
your recommendation, I will discuss with my supervisor.
By clean build, I mean all intermediate and output files were deleted, leaving only the project and component files before doing the actual build. The exact process depends on the build tools. You can find some examples in our documentation, but they are not specific to CCS. Unfortunately, I’m unfamiliar with CCS to provide a solution that works out of the box. But the documentation I shared previously for modern CCS versions should cover this.
I’m glad you could make some progress on the issue. Let’s try to figure out the rest.
To fully understand what you mean, could you share the build-wapper.log and build-wapper-dump.json and the entire output from the scanner invocation? You can use the same private thread if you think sensitive data is in those files.
Thanks for the files. I see the build wrapper database looks better now.
However, I also need the entire output from the scanner invocation to understand the issue you’re facing. You can find the instructions to run the scanner with the build wrapper output on this page: Analysis Steps Using Build Wrapper.
Looking at them, I see you run the scanner from the TI installation directory and that your project lives in a subdirectory on your desktop. This is not compatible with the instruction to run the scanner:
Execute the SonarScanner (sonar-scanner) from the root directory of your project.
You will find other similar requirements on the page I linked previously. The best would be to run both the build wrapper and the scanner from the root of your project. This simplifies how you can refer to the build wrapper output in your sonar-project.properties since the path has to be relative.
You can also find information on how the analysis scope can be defined and how this impacts the selection of files to analyze here:
Thank you for teaching me the importance of location.
I have put my code in the same folder as sonar-project.properties, and after several attempts, I have the same fault, and at the end of the analysis it runs the following fault.
An error occurred while analyzing the following compilation unit:
A file named “sonar-cfamily-reproducer.zip” has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
The "sonar-cfamily-reproducer.zip " I have sent it to you from the PM.
Sorry my questions are very many and complicated, and my English is not that good, it takes a little time to understand, thank you again for helping me solve the problem!
I finally had the time to look at the files you shared.
There are a few things worth sharing here. First, there’s this warning:
was generated using build-wrapper version 6.38,
which does not match the analyzer version 126.96.36.199440.
Please download the matching version from the server
I recommend regenerating the build wrapper output with the mentioned version. While it will not address your current problem, this will avoid other unrelated issues in the future.
The other thing is on our side: unfortunately, at the moment, the error message is not clear, and we need to improve it. Essentially, you are still using a fairly old version (CCS v7 was released more than 5 years ago if I’m not mistaken) that we don’t support. With [CPP-3940] - Jira, we aim at improving the error message, but that ticket doesn’t aim at supporting that old compiler version.
We also have [CPP-3986] - Jira to record requests to support older compiler versions.
Thankfully, I believe upgrading to a recent version of CCS (and thus a supported version of the compiler for C2000) should resolve your issues.
I hope this helps, and do let me know if you face other issues.
I’ve read your reply and I think I will discuss with my supervisor again whether to use the newer CCS version or not, for now it should just be a change of version and everything will run smoother after that!
Thank you for your help this period, I have learned a few things.