I have just hit an issue with the SonarCloudAnalyze@1 task on Azure Pipelines, just after starting to use some source generators on my C# project. The full log is here; the part where it fails is:
WARN: File 'Generators\Generators.CommandGenerator\EditorTabViewModel.CommandGenerator.cs' referenced by the protobuf 'CopyPasteTokenInfo' does not exist in the analysis context
WARN: File 'Generators\Generators.CommandGenerator\IconTabViewModel.CommandGenerator.cs' referenced by the protobuf 'CopyPasteTokenInfo' does not exist in the analysis context
WARN: File 'Generators\Generators.CommandGenerator\MainWindowViewModel.CommandGenerator.cs' referenced by the protobuf 'CopyPasteTokenInfo' does not exist in the analysis context
INFO: Importing results from 5 proto files in 'D:\a\1\.sonarqube\out\15\output-cs'
INFO: Importing results from 5 proto files in 'D:\a\1\.sonarqube\out\4\output-cs'
INFO: Importing 15 Roslyn reports
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 51.309s
INFO: Final Memory: 28M/97M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
java.lang.IllegalArgumentException: URI is not absolute
ERROR: Error during SonarScanner execution
java.lang.IllegalArgumentException: URI is not absolute
##[error]at java.base/java.io.File.<init>(File.java:418)
at java.base/java.io.File.<init>(File.java:418)
##[error]at org.sonarsource.dotnet.shared.sarif.SarifParser10.uriToAbsolutePath(SarifParser10.java:225)
at org.sonarsource.dotnet.shared.sarif.SarifParser10.handleLocation(SarifParser10.java:175)
All those X.CommandGenerator.cs
files come from the source generator I am now using (this source generator is hosted on a separate project in the same repo).
Could these auto-generated files be causing the issue with the scanner? I tried to ignore them via sonar.exclusions=**/*.CommandGenerator.cs
, but it seems it has no effect. The log still says 0 files ignored because of inclusion/exclusion patterns
.