Concurrent MSBuild SonarQube Scans

124 views
Skip to first unread message

dan.ro...@gmail.com

unread,
Feb 13, 2018, 7:54:57 PM2/13/18
to SonarQube
Is there a workaround to allow concurrent MSBuild scans? We have CI running multiple jobs concurrently which seems to break SonarQube MSBuild scanner, which assumes it "owns" the targets file in the below stacktrace.
Unhandled Exception: System.IO.IOException: The file 'C:\Users\sgdebugger\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets' already exists.
   at
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at
System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at
System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   at
SonarQube.TeamBuild.PreProcessor.TargetsInstaller.CopyIfDifferent(String sourcePath, IEnumerable`1 destinationDirs, ILogger logger)
   at SonarQube.TeamBuild.PreProcessor.TargetsInstaller.InternalCopyTargetsFile(ILogger logger)
   at SonarQube.TeamBuild.PreProcessor.TargetsInstaller.InstallLoaderTargets(ILogger logger, String workDirectory)
   at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.InstallLoaderTargets(ProcessedArgs args)
   at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs localSettings)
   at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args)
   at SonarQube.Bootstrapper.BootstrapperClass.PreProcess()
   at SonarQube.Bootstrapper.BootstrapperClass.Execute()
   at SonarQube.Bootstrapper.Program.Execute(String[] args, ILogger logger)
   at SonarQube.Bootstrapper.Program.Main(String[] args)
   at SonarQube.Old.Bootstrapper.Program.Main(String[] args)

Amaury Leve

unread,
Feb 14, 2018, 4:19:38 AM2/14/18
to dan.ro...@gmail.com, SonarQube
Hi Dan,

The target is copied under the user MSBuild ImportBefore folder so if you can use multiple accounts for your parallel build they should work.

Alternatively (not tested), you could try to manually copy the target in the system ImportBefore it might be working.

Cheers,
Amaury

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/b7ebb10f-da13-4a85-93ed-10fe8636c243%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 

dan.ro...@gmail.com

unread,
Feb 14, 2018, 10:52:15 AM2/14/18
to SonarQube
Thanks, Amaury! That works.

Amaury Leve

unread,
Feb 14, 2018, 11:06:41 AM2/14/18
to dan.ro...@gmail.com, SonarQube
Out of curiosity which of the 2 solutions is working for you?


For more options, visit https://groups.google.com/d/optout.

dan.ro...@gmail.com

unread,
Feb 15, 2018, 9:43:52 PM2/15/18
to SonarQube
We’re going with the multi-user approach. It was the easiest mod to slot into our existing CI setup.

Amaury Leve

unread,
Feb 16, 2018, 3:11:17 AM2/16/18
to dan.ro...@gmail.com, SonarQube
Ok! Thanks for letting me know.

On Fri, Feb 16, 2018 at 3:43 AM <dan.ro...@gmail.com> wrote:
We’re going with the multi-user approach. It was the easiest mod to slot into our existing CI setup.

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages