Sonarlint , atmelstudio/ microchip studio support?

Must-share information (formatted with Markdown):
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
what are you trying to achieve
what have you tried so far to achieve this
Sonar Lint version:

SonarLint.VSIX-4.33.1.28913-2019 (1).vsix

SonarQube version:

sonarqube-8.1.0.31237 Developer edition and licensed.

SonarQube Scanner version:

SonarQube Scanner 4.2.0.1873

What I try to achive

As team we try to get SonarLint working on visual studio 2019 community edition or in Microchip studio which previous is known as atmel studio. Atmel studio is based on the visual studio suite So in theory the plug-in should work. But the installer of sonarlint tells that it cannot find a suitable product to install sonarlint into.
What I achieved so far:

I edited the vsix file for forcing support, but this didnt work.
Try to update visual studio and reinstall the plugin but still I get a error.

The question

My question is does SonarLint support atmel studio or will we need another tool or product for this issue. We would like a tool that works from within the IDE without to much configration or creating scripts.

The best use case would be:
Scan in the IDE for errors and report them to the SonarQube webui ( Developer edition)
We think the SonarLint plugin has this capabilty but we dont know how to make use of it or how to use it. We suspect this is a configuration/ user error of us.

Does the sonarLint plugin only works on a licensed visualstudio professional and or ultimate/enterprise edition or does it also work on the community edition?

Hello Ralph,

I am not very familiar with Microchip Studio but I found this possibly related entry on their support website. Could you check if the steps described would let you install SonarLint ?

Please let us know,
Thanks
Damien

@Damien_Urruty
Thanks for your input unfortunaltely it didnt work I get
image

4-5-2021 10:22:18 - Microsoft VSIX Installer
4-5-2021 10:22:18 - -------------------------------------------
4-5-2021 10:22:18 - Initializing Install...
4-5-2021 10:22:18 - Extension Details...
4-5-2021 10:22:18 - 	Identifier      : SonarLint.b986f788-6a16-4a3a-a68b-c757f6b1b7d5
4-5-2021 10:22:18 - 	Name            : SonarLint for Visual Studio 2019
4-5-2021 10:22:18 - 	Author          : SonarSource
4-5-2021 10:22:18 - 	Version         : 4.33.1.28913
4-5-2021 10:22:18 - 	Description     : Roslyn based static code analysis: Find and instantly fix nasty bugs and code smells in C#, VB.Net, C, C++ and JS.
4-5-2021 10:22:18 - 	Locale          : en-US
4-5-2021 10:22:18 - 	MoreInfoURL     : http://vs.sonarlint.org/
4-5-2021 10:22:18 - 	InstalledByMSI  : False
4-5-2021 10:22:18 - 	SupportedFrameworkVersionRange : [4.6,)
4-5-2021 10:22:18 - 
4-5-2021 10:22:20 - 	SignedBy        : Sonarsource SA
4-5-2021 10:22:20 - 	Certificate Info : [Subject]
  CN=Sonarsource SA, O=Sonarsource SA, L=GENÈVE, C=CH

[Issuer]
  CN=Symantec Class 3 SHA256 Code Signing CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US

[Serial Number]
  17EF71F9FA5FF72F2C504248CEF5F950

[Not Before]
  17-9-2019 02:00:00

[Not After]
  16-10-2021 01:59:59

[Thumbprint]
  0EA334E388568CE222CB035D0CDA4B6EF8A7F087

4-5-2021 10:22:20 - 	Supported Products : 
4-5-2021 10:22:20 - 		Microsoft.VisualStudio.Community
4-5-2021 10:22:20 - 			Version : [16.0,17.0)
4-5-2021 10:22:20 - 
4-5-2021 10:22:20 - 	References      : 
4-5-2021 10:22:20 - 
4-5-2021 10:22:20 - Searching for applicable products...
4-5-2021 10:22:20 - Found installed product - Global Location
4-5-2021 10:22:20 - Found installed product - AtmelStudio
4-5-2021 10:22:20 - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
   bij VSIXInstaller.App.InitializeInstall(Boolean isRepairSupported)
   bij VSIXInstaller.App.InitializeInstall()
   bij System.Threading.Tasks.Task.InnerInvoke()
   bij System.Threading.Tasks.Task.Execute()

Note I found a way to open up the vsix file, cause its just a zip file. but after editing the 16.0,17.0 to 12.0, This would give support for all versions I get the following error and I cant fix that
image

What is the version of Microchip Studio you are using ? And on which version of Visual Studio is it based on ? The problem might be that you try to install SonarLint for Visual Studio 2019 on an IDE that accepts only VS 2015 or VS 2017 extensions.

You could have a try with SonarLint for Visual Studio 2015 or SonarLint for Visual Studio 2017.

As a last note, I also want to state that we don’t officially support Microchip Studio, so we can’t ensure it will work out of the box. We are interested to hear from you if you managed to install and use the extension though.

Thanks
Damien

@Damien_Urruty

I tried it immediately (2015,2017), it didnt work :open_mouth:
this is the version we use:
image

@ralphvbair a couple of initial questions:

  • which language(s) are you using? C++?
  • if C++, does the Sonar CFamily analyzer support the compiler you are using? The list of supported compilers is here.

Unfortunately, that does not necessarily follow. My guess is that Atmel Studio is using the Visual Studio standalone shell to provide the basic window management, menus and command support. That’s definitely not the same as saying Atmel Studio is therefore the same as Visual Studio Community Edition - Community Edition probably contains lot of additional components that do not ship in Atmel Studio (and probably can’t be shipped for licensing reasons).

It might be possible to tweak the SonarLint VSIX installer so that it recognises Atmel Studio as a valid installation target, but again it doesn’t follow that it will work as expected. The C++ analysis in SonarLint depends on the Microsoft C++ project system component being present in IDE. If that component is not present in Atmel Studio then SonarLint won’t be able to analyse any C/C++ code.

SonarLint does not push results to SonarQube. The only way to push results to SonarQube is using one of the Sonar scanners (and if you are analysing C/C++ you would need the Build Wrapper too).

Dear @duncanp

You right about that for using the plugin. It wasnt also possible to convert a .atsln to a .sln for visual studio.

The strange part is I checked the compiler supported and we using the compiler:

arm-none-eabi-gcc.exe"  -x c -mthumb -D__SAME51J20A__ -DDEBUG 

The supported compilers tells me:

Supported Compilers
Any version of Clang, GCC, and Microsoft C/C++ compilers
Any version of Intel compiler for Linux and macOS
**ARM5 and ARM6 compilers**
IAR compilers for ARM, Atmel AVR32, Atmel AVR, Renesas H8, Renesas RL78, Renesas RX, Renesas V850, Texas Instruments MSP430, and for 8051
QNX compilers
Texas Instruments compilers on Windows and macOS for ARM, C2000, C6000, C7000, MSP430, and PRU
Wind River Diab and GCC compilers
Compilers based wholly on **GCC** including for instance Linaro GCC are also supported

The compiler output tells me
End of search list.
GNU C99 (Atmel build: 508) version 6.3.1 20170620 (release) [ARM/embedded-6-branch revision 249437] (arm-none-eabi)
compiled by GNU C version 4.7.4, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version 0.15

So this should work right?

This is related to:
analysing issue atmel project with sonar scanner using the build wrapper tool

Edit:
Its solved. it was wrong build command that the build wrapper didnt accept.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.