TI C2000 compiler with SonarQube Entreprise 10.3

Environment:
SonarQube Entreprise 10.3 with Github
Windows 10

Hello,
I’m trying to use SonarQube Entreprise with Github action on a C project using TI C2000 compiler.

But my problem is I don’t know how to set my action to use the C2000 compiler on my project.
I didn’t find documentation or example.

What is the command to set the C2000 in my *.yml file ? (like uses: microsoft/setup-msbuild@v1.0.2 for msbuild).

Thanks for your support.

1 Like

Dear @Jcfjcf77400,

May I ask what is the exact version of your compiler?

One example showing how to integrate a C project on Windows using a GitHub action and MSBuild is available here.

  • The first step is to use the build-wrapper (after msbuild, your build project-specific build commands should be used):
build-wrapper-win-x86-64 --out-dir build-wrapper-out-dir msbuild sonar_scanner_example.vcxproj /t:rebuild /nodeReuse:false
  • The second step is to run the sonar-scanner:
sonar-scanner --define sonar.cfamily.build-wrapper-output="build-wrapper-out-dir"

There are other examples available.

If you have access to a similar environment locally (Windows; MSBuild; the source code of your project, the sonar scanner, and the build-wrapper), I would kindly suggest trying downloading and running the scanner and build-wrapper on your machine first to be able to more rapidly iterate. Once correct settings are found locally, it would be easier to port them to GitHub actions.

Also, if you wish to integrate a GitHub action anyway, I would like you to try out one of the projects already shared to validate your environment. Once a dummy project has been integrated, it will be easier to integrate yours.

Finally, this existing thread might be of interest to you.

Hello Lukas,

Thanks for your answer.

But in fact I don’t want to use Msbuild compiler, but I want to use Texas Instrument C2000 compiler (from code composer studio).

My question is what are the steps in the *.yaml file necessary to configure and use this compiler to compile.

Because SonarQube entreprise 10.3 is in a Server, not in my local machine.

I think I need to install this compiler in the server to use it, but I didn’t find examples for this compiler.

For example for MSbuild, we use this command: uses: microsoft/setup-msbuild@v1.0.2 (we use from a repo)

Is similar command exist for CI2000 compiler?

Thanks.

Hello @Jcfjcf77400,

I only saw your answer yesterday.

The scanner is a separate component used to scan the source code. Once the scanning is done, the results are sent to SonarQube Server as part of an analysis report.

This scanner component can be installed locally on your machine. I would suggest you do so eventually.

In order for the scanner to be able to scan C code, a build command is required. This build command is independent of Sonar. I suspect that the full command is hidden within Code Composer Studio. The build command would need to be extracted from Code Composer, perhaps by looking at the Console view.

Once the correct build has been found, it can be wrapped around the build-wrapper. It would look something like:

build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory $your-build-command-here

Then the scanner could be executed.

sonar-scanner

Depending on your situation, there may be a GitHub Action that could be used. But before GitHub Action is used (which abstracts away the underlying complexity and the scanner), I would try out the manual method.

I hope that helps,

Best,