From 31ad195dc3343bf5ce08dc68e1296daf9429672f Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Fri, 24 May 2024 14:41:23 +0200 Subject: [PATCH 1/9] C#: Add binlog support to buildless with source generator support --- .../Semmle.Autobuild.CSharp/BUILD.bazel | 1 + .../CSharpAutobuilder.cs | 4 +- .../Semmle.Autobuild.CSharp.csproj | 1 + .../StandaloneBuildRule.cs | 4 +- csharp/codeql-extractor.yml | 6 + .../BUILD.bazel | 2 +- .../Semmle.Extraction.CSharp/BUILD.bazel | 1 + .../Extractor/BinaryLogAnalyser.cs | 23 +++ .../Extractor/Extractor.cs | 146 ++++++++++++++---- .../Extractor/Options.cs | 8 + .../Extractor/TracingAnalyser.cs | 7 +- .../Semmle.Extraction.CSharp/paket.references | 2 +- .../Extractor/ExtractorMode.cs | 1 + csharp/paket.dependencies | 1 + csharp/paket.lock | 21 +++ csharp/paket.main.bzl | 6 + .../all-platforms/binlog/Files.expected | 5 + .../all-platforms/binlog/Files.ql | 5 + .../all-platforms/binlog/Program.cs | 9 ++ .../all-platforms/binlog/global.json | 5 + .../all-platforms/binlog/test.csproj | 10 ++ .../all-platforms/binlog/test.py | 5 + .../Assemblies.expected | 6 + 23 files changed, 237 insertions(+), 42 deletions(-) create mode 100644 csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogAnalyser.cs create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/Files.expected create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/Files.ql create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/Program.cs create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/global.json create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/test.csproj create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/test.py diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp/BUILD.bazel b/csharp/autobuilder/Semmle.Autobuild.CSharp/BUILD.bazel index ee232650da61..99cf29e52207 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp/BUILD.bazel +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp/BUILD.bazel @@ -13,6 +13,7 @@ codeql_csharp_binary( "//csharp/autobuilder/Semmle.Autobuild.Shared", "//csharp/extractor/Semmle.Extraction.CSharp", "//csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching", + "//csharp/extractor/Semmle.Extraction.CSharp.Driver:bin/Semmle.Extraction.CSharp.Driver", "//csharp/extractor/Semmle.Extraction.CSharp.Standalone:bin/Semmle.Extraction.CSharp.Standalone", "//csharp/extractor/Semmle.Util", "@paket.main//microsoft.build", diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs b/csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs index 96532de153c5..61487eb43858 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs @@ -13,8 +13,10 @@ public class CSharpAutobuildOptions : AutobuildOptionsShared { private const string buildModeEnvironmentVariable = "CODEQL_EXTRACTOR_CSHARP_BUILD_MODE"; internal const string ExtractorOptionBuildless = "CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS"; + internal const string ExtractorOptionBinlog = "CODEQL_EXTRACTOR_CSHARP_OPTION_BINLOG"; public bool Buildless { get; } + public string? Binlog { get; } public override Language Language => Language.CSharp; @@ -29,7 +31,7 @@ public CSharpAutobuildOptions(IBuildActions actions) : base(actions) actions.GetEnvironmentVariable(ExtractorOptionBuildless).AsBool("buildless", false) || actions.GetEnvironmentVariable(buildModeEnvironmentVariable)?.ToLower() == "none"; - + Binlog = actions.GetEnvironmentVariable(ExtractorOptionBinlog); } } diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp/Semmle.Autobuild.CSharp.csproj b/csharp/autobuilder/Semmle.Autobuild.CSharp/Semmle.Autobuild.CSharp.csproj index 7c4f1d681773..515fecd5bec6 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp/Semmle.Autobuild.CSharp.csproj +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp/Semmle.Autobuild.CSharp.csproj @@ -6,6 +6,7 @@ + diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp/StandaloneBuildRule.cs b/csharp/autobuilder/Semmle.Autobuild.CSharp/StandaloneBuildRule.cs index 5b844e6cf6c8..e0e40213895f 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp/StandaloneBuildRule.cs +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp/StandaloneBuildRule.cs @@ -10,7 +10,9 @@ internal class StandaloneBuildRule : IBuildRule { public BuildScript Analyse(IAutobuilder builder, bool auto) { - return BuildScript.Create(_ => Semmle.Extraction.CSharp.Standalone.Program.Main([])); + return builder.Options.Binlog is string binlog + ? BuildScript.Create(_ => Semmle.Extraction.CSharp.Driver.Main(["--binlog", binlog])) + : BuildScript.Create(_ => Semmle.Extraction.CSharp.Standalone.Program.Main([])); } } } diff --git a/csharp/codeql-extractor.yml b/csharp/codeql-extractor.yml index 6c3285c412b9..43c4adaafbf9 100644 --- a/csharp/codeql-extractor.yml +++ b/csharp/codeql-extractor.yml @@ -65,3 +65,9 @@ options: - progress+++ type: string pattern: "^(off|errors|warnings|(info|progress)|(debug|progress\\+)|(trace|progress\\+\\+)|progress\\+\\+\\+)$" + binlog: + title: Binlog + description: > + [EXPERIMENTAL] The value is a path to the MsBuild binary log file that should be extracted. + This option only works when `--build-mode none` is also specified. + type: string diff --git a/csharp/extractor/Semmle.Extraction.CSharp.Driver/BUILD.bazel b/csharp/extractor/Semmle.Extraction.CSharp.Driver/BUILD.bazel index 1689f4520047..d13d2288d650 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.Driver/BUILD.bazel +++ b/csharp/extractor/Semmle.Extraction.CSharp.Driver/BUILD.bazel @@ -8,7 +8,7 @@ codeql_csharp_binary( srcs = glob([ "*.cs", ]), - visibility = ["//csharp:__pkg__"], + visibility = ["//csharp:__subpackages__"], deps = [ "//csharp/extractor/Semmle.Extraction.CSharp", ], diff --git a/csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel b/csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel index 0281521ef761..f5d36340bd63 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel +++ b/csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel @@ -19,6 +19,7 @@ codeql_csharp_library( "//csharp/extractor/Semmle.Extraction", "//csharp/extractor/Semmle.Extraction.CSharp.Util", "//csharp/extractor/Semmle.Util", + "@paket.main//basic.compilerlog.util", "@paket.main//microsoft.build", "@paket.main//microsoft.codeanalysis.csharp", ], diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogAnalyser.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogAnalyser.cs new file mode 100644 index 000000000000..c59966072db3 --- /dev/null +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogAnalyser.cs @@ -0,0 +1,23 @@ +using Microsoft.CodeAnalysis.CSharp; +using Semmle.Util; +using Semmle.Util.Logging; + +namespace Semmle.Extraction.CSharp +{ + public class BinaryLogAnalyser : Analyser + { + public BinaryLogAnalyser(IProgressMonitor pm, ILogger logger, PathTransformer pathTransformer, IPathCache pathCache, bool addAssemblyTrapPrefix) + : base(pm, logger, pathTransformer, pathCache, addAssemblyTrapPrefix) + { + } + + public void Initialize(string cwd, string[] args, string outputPath, CSharpCompilation compilationIn, CommonOptions options) + { + compilation = compilationIn; + ExtractionContext = new ExtractionContext(cwd, args, outputPath, [], Logger, PathTransformer, ExtractorMode.BinaryLog, options.QlTest); + this.options = options; + LogExtractorInfo(); + SetReferencePaths(); + } + } +} diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs index 4d87bddbb543..8ea00e4282cf 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs @@ -8,6 +8,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using Basic.CompilerLog.Util; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Text; @@ -102,55 +103,134 @@ public static ExitCode Run(string[] args) try { - if (options.ProjectsToLoad.Any()) + var canonicalPathCache = CanonicalPathCache.Create(logger, 1000); + var pathTransformer = new PathTransformer(canonicalPathCache); + + if (options.BinaryLogPath is string binlogPath) { - AddSourceFilesFromProjects(options.ProjectsToLoad, options.CompilerArguments, logger); + logger.LogInfo(" Running binary log analysis."); + return RunBinaryLogAnalysis(analyzerStopwatch, options, binlogPath, logger, canonicalPathCache, pathTransformer); } - - var compilerVersion = new CompilerVersion(options); - if (compilerVersion.SkipExtraction) + else { - logger.LogWarning($" Unrecognized compiler '{compilerVersion.SpecifiedCompiler}' because {compilerVersion.SkipReason}"); - return ExitCode.Ok; + logger.LogInfo(" Running tracing analysis."); + return RunTracingAnalysis(analyzerStopwatch, options, logger, canonicalPathCache, pathTransformer); } + } + catch (Exception ex) // lgtm[cs/catch-of-all-exceptions] + { + logger.LogError($" Unhandled exception: {ex}"); + return ExitCode.Errors; + } + } - var workingDirectory = Directory.GetCurrentDirectory(); - var compilerArgs = options.CompilerArguments.ToArray(); + private static ExitCode RunBinaryLogAnalysis(Stopwatch stopwatch, Options options, string binlogPath, ILogger logger, CanonicalPathCache canonicalPathCache, PathTransformer pathTransformer) + { + logger.LogInfo($"Reading compiler calls from binary log {binlogPath}"); + try + { + using var fileStream = new FileStream(binlogPath, FileMode.Open, FileAccess.Read, FileShare.Read); + using var reader = BinaryLogReader.Create(fileStream); - var canonicalPathCache = CanonicalPathCache.Create(logger, 1000); - var pathTransformer = new PathTransformer(canonicalPathCache); + // Filter out compiler calls that aren't interesting for examination + static bool filter(CompilerCall compilerCall) + { + return compilerCall.IsCSharp && + compilerCall.Kind == CompilerCallKind.Regular; + } - using var analyser = new TracingAnalyser(new LogProgressMonitor(logger), logger, pathTransformer, canonicalPathCache, options.AssemblySensitiveTrap); + var allCompilationData = reader.ReadAllCompilationData(filter); + var allFailed = true; - var compilerArguments = CSharpCommandLineParser.Default.Parse( - compilerVersion.ArgsWithResponse, - workingDirectory, - compilerVersion.FrameworkPath, - compilerVersion.AdditionalReferenceDirectories - ); + logger.LogInfo($" Found {allCompilationData.Count} compilations in binary log"); - if (compilerArguments is null) + foreach (var compilationData in allCompilationData) { - var sb = new StringBuilder(); - sb.Append(" Failed to parse command line: ").AppendList(" ", compilerArgs); - logger.LogError(sb.ToString()); - ++analyser.CompilationErrors; - return ExitCode.Failed; - } + if (compilationData.GetCompilationAfterGenerators() is not CSharpCompilation compilation) + { + logger.LogError(" Compilation data is not C#"); + continue; + } - if (!analyser.BeginInitialize(compilerVersion.ArgsWithResponse)) - { - logger.LogInfo("Skipping extraction since files have already been extracted"); - return ExitCode.Ok; + var compilerCall = compilationData.CompilerCall; + var diagnosticName = compilerCall.GetDiagnosticName(); + logger.LogInfo($" Processing compilation {diagnosticName}"); + var compilerArgs = compilerCall.GetArguments(); + var args = reader.ReadCommandLineArguments(compilerCall); + + using var analyser = new BinaryLogAnalyser(new LogProgressMonitor(logger), logger, pathTransformer, canonicalPathCache, options.AssemblySensitiveTrap); + + var exit = Analyse(stopwatch, analyser, options, + references => [() => compilation.References.ForEach(r => references.Add(r))], + (analyser, syntaxTrees) => [() => syntaxTrees.AddRange(compilation.SyntaxTrees)], + (syntaxTrees, references) => compilation, + (compilation, options) => analyser.Initialize(compilerCall.ProjectDirectory, compilerArgs?.ToArray() ?? [], TracingAnalyser.GetOutputName(compilation, args), compilation, options), + () => { }); + + switch (exit) + { + case ExitCode.Ok: + allFailed &= false; + logger.LogInfo($" Compilation {diagnosticName} succeeded"); + break; + case ExitCode.Errors: + allFailed &= false; + logger.LogWarning($" Compilation {diagnosticName} had errors"); + break; + case ExitCode.Failed: + logger.LogWarning($" Compilation {diagnosticName} failed"); + return ExitCode.Failed; + } } + return allFailed ? ExitCode.Failed : ExitCode.Ok; + } + catch (IOException ex) + { + logger.LogError($"Failed to open binary log: {ex.Message}"); + return ExitCode.Failed; + } + } + + private static ExitCode RunTracingAnalysis(Stopwatch analyzerStopwatch, Options options, ILogger logger, CanonicalPathCache canonicalPathCache, PathTransformer pathTransformer) + { + if (options.ProjectsToLoad.Any()) + { + AddSourceFilesFromProjects(options.ProjectsToLoad, options.CompilerArguments, logger); + } - return AnalyseTracing(workingDirectory, compilerArgs, analyser, compilerArguments, options, analyzerStopwatch); + var compilerVersion = new CompilerVersion(options); + if (compilerVersion.SkipExtraction) + { + logger.LogWarning($" Unrecognized compiler '{compilerVersion.SpecifiedCompiler}' because {compilerVersion.SkipReason}"); + return ExitCode.Ok; } - catch (Exception ex) // lgtm[cs/catch-of-all-exceptions] + + var workingDirectory = Directory.GetCurrentDirectory(); + var compilerArgs = options.CompilerArguments.ToArray(); + using var analyser = new TracingAnalyser(new LogProgressMonitor(logger), logger, pathTransformer, canonicalPathCache, options.AssemblySensitiveTrap); + var compilerArguments = CSharpCommandLineParser.Default.Parse( + compilerVersion.ArgsWithResponse, + workingDirectory, + compilerVersion.FrameworkPath, + compilerVersion.AdditionalReferenceDirectories + ); + + if (compilerArguments is null) { - logger.LogError($" Unhandled exception: {ex}"); - return ExitCode.Errors; + var sb = new StringBuilder(); + sb.Append(" Failed to parse command line: ").AppendList(" ", compilerArgs); + logger.LogError(sb.ToString()); + ++analyser.CompilationErrors; + return ExitCode.Failed; + } + + if (!analyser.BeginInitialize(compilerVersion.ArgsWithResponse)) + { + logger.LogInfo("Skipping extraction since files have already been extracted"); + return ExitCode.Ok; } + + return AnalyseTracing(workingDirectory, compilerArgs, analyser, compilerArguments, options, analyzerStopwatch); } private static void AddSourceFilesFromProjects(IEnumerable projectsToLoad, IList compilerArguments, ILogger logger) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Options.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Options.cs index 4fafffe98333..7f3815520d62 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Options.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Options.cs @@ -32,6 +32,11 @@ public sealed class Options : CommonOptions /// public bool AssemblySensitiveTrap { get; private set; } = false; + /// + /// The path to the binary log file, or null if unspecified. + /// + public string? BinaryLogPath { get; set; } + public static Options CreateWithEnvironment(string[] arguments) { var options = new Options(); @@ -65,6 +70,9 @@ public override bool HandleOption(string key, string value) case "load-sources-from-project": ProjectsToLoad.Add(value); return true; + case "binlog": + BinaryLogPath = value; + return true; default: return base.HandleOption(key, value); } diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/TracingAnalyser.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/TracingAnalyser.cs index c1250cf385c8..1139d7cdd9a6 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/TracingAnalyser.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/TracingAnalyser.cs @@ -107,11 +107,8 @@ private bool LogRoslynArgs(IEnumerable roslynArgs) /// /// Determine the path of the output dll/exe. /// - /// Information about the compilation. - /// Cancellation token required. - /// The filename. - private static string GetOutputName(CSharpCompilation compilation, - CSharpCommandLineArguments commandLineArguments) + internal static string GetOutputName(CSharpCompilation compilation, + CommandLineArguments commandLineArguments) { // There's no apparent way to access the output filename from the compilation, // so we need to re-parse the command line arguments. diff --git a/csharp/extractor/Semmle.Extraction.CSharp/paket.references b/csharp/extractor/Semmle.Extraction.CSharp/paket.references index 70cd7de8821f..d53881096fdf 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/paket.references +++ b/csharp/extractor/Semmle.Extraction.CSharp/paket.references @@ -1,3 +1,3 @@ Microsoft.Build Microsoft.CodeAnalysis.CSharp - +Basic.CompilerLog.Util \ No newline at end of file diff --git a/csharp/extractor/Semmle.Extraction/Extractor/ExtractorMode.cs b/csharp/extractor/Semmle.Extraction/Extractor/ExtractorMode.cs index 52ef15f52d4d..cc1f5cc04132 100644 --- a/csharp/extractor/Semmle.Extraction/Extractor/ExtractorMode.cs +++ b/csharp/extractor/Semmle.Extraction/Extractor/ExtractorMode.cs @@ -12,5 +12,6 @@ public enum ExtractorMode Standalone = 1, Pdb = 2, QlTest = 4, + BinaryLog = 8, } } diff --git a/csharp/paket.dependencies b/csharp/paket.dependencies index ea6ba369f6d0..dab8c5a2a09c 100644 --- a/csharp/paket.dependencies +++ b/csharp/paket.dependencies @@ -4,6 +4,7 @@ source https://api.nuget.org/v3/index.json # behave like nuget in choosing transitive dependency versions strategy: min +nuget Basic.CompilerLog.Util nuget Mono.Posix.NETStandard nuget Newtonsoft.Json nuget xunit diff --git a/csharp/paket.lock b/csharp/paket.lock index 0d935eb5c3d4..dd01f431483c 100644 --- a/csharp/paket.lock +++ b/csharp/paket.lock @@ -3,7 +3,19 @@ STRATEGY: MIN RESTRICTION: == net8.0 NUGET remote: https://api.nuget.org/v3/index.json + Basic.CompilerLog.Util (0.7.8) + MessagePack (>= 2.5.129) + Microsoft.CodeAnalysis (>= 4.9.2) + Microsoft.CodeAnalysis.CSharp (>= 4.9.2) + Microsoft.CodeAnalysis.VisualBasic (>= 4.9.2) + Microsoft.Extensions.ObjectPool (>= 7.0.13) + MSBuild.StructuredLogger (>= 2.2.235) Humanizer.Core (2.14.1) + MessagePack (2.5.129) + MessagePack.Annotations (>= 2.5.129) + Microsoft.NET.StringTools (>= 17.6.3) + System.Runtime.CompilerServices.Unsafe (>= 6.0) + MessagePack.Annotations (2.5.129) Microsoft.Build (17.8.3) Microsoft.Build.Framework (>= 17.8.3) Microsoft.NET.StringTools (>= 17.8.3) @@ -14,6 +26,11 @@ NUGET System.Security.Principal.Windows (>= 5.0) System.Threading.Tasks.Dataflow (>= 7.0) Microsoft.Build.Framework (17.8.3) + Microsoft.Build.Utilities.Core (17.5) + Microsoft.Build.Framework (>= 17.5) + Microsoft.NET.StringTools (>= 17.5) + System.Collections.Immutable (>= 6.0) + System.Configuration.ConfigurationManager (>= 6.0) Microsoft.CodeAnalysis (4.9.2) Microsoft.CodeAnalysis.CSharp.Workspaces (4.9.2) Microsoft.CodeAnalysis.VisualBasic.Workspaces (4.9.2) @@ -43,6 +60,7 @@ NUGET System.IO.Pipelines (>= 8.0) System.Threading.Channels (>= 8.0) Microsoft.CodeCoverage (17.9) + Microsoft.Extensions.ObjectPool (7.0.13) Microsoft.NET.StringTools (17.8.3) Microsoft.NET.Test.Sdk (17.9) Microsoft.CodeCoverage (>= 17.9) @@ -60,6 +78,9 @@ NUGET System.Runtime (>= 4.3) Microsoft.Win32.SystemEvents (7.0) Mono.Posix.NETStandard (1.0) + MSBuild.StructuredLogger (2.2.235) + Microsoft.Build.Framework (>= 17.5) + Microsoft.Build.Utilities.Core (>= 17.5) Newtonsoft.Json (13.0.3) System.Collections.Immutable (8.0) System.Composition (8.0) diff --git a/csharp/paket.main.bzl b/csharp/paket.main.bzl index 17adaf8504c4..a3e778088cd3 100644 --- a/csharp/paket.main.bzl +++ b/csharp/paket.main.bzl @@ -7,9 +7,13 @@ def main(): nuget_repo( name = "paket.main", packages = [ + {"name": "Basic.CompilerLog.Util", "id": "Basic.CompilerLog.Util", "version": "0.7.8", "sha512": "sha512-l4HWgecvjVCLOYNbdo7NiW+icYbOmPolc6xYacawIb8OKGBdncAR4gECP9NzRcOqKqe+Y6bp/zym1MyWMtUmbQ==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "net462": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "net47": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "net471": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "net472": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "net48": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "net5.0": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "net6.0": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "net7.0": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "net8.0": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "netcoreapp2.1": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "netcoreapp2.2": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "netcoreapp3.0": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "netcoreapp3.1": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"], "netstandard2.1": ["MSBuild.StructuredLogger", "MessagePack", "Microsoft.CodeAnalysis", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.Extensions.ObjectPool"]}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Humanizer.Core", "id": "Humanizer.Core", "version": "2.14.1", "sha512": "sha512-yzqGU/HKNLZ9Uvr6kvSc3wYV/S5O/IvklIUW5WF7MuivGLY8wS5IZnLPkt7D1KW8Et2Enl0I3Lzg2vGWM24Xsw==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, + {"name": "MessagePack", "id": "MessagePack", "version": "2.5.129", "sha512": "sha512-wpw2dHkE5AcvMYKE4MrWuoeZ2jeaneDlqAgplxm6yKqPXeUVI2h5DPrKjsljnJSNRZOm3tunasw18Q9xj/3UoA==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "net462": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "net47": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "net471": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "net472": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "net48": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "net5.0": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "net6.0": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Runtime.CompilerServices.Unsafe"], "net7.0": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Runtime.CompilerServices.Unsafe"], "net8.0": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp2.1": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp2.2": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp3.0": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp3.1": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"], "netstandard2.1": ["MessagePack.Annotations", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Runtime.CompilerServices.Unsafe"]}, "targeting_pack_overrides": [], "framework_list": []}, + {"name": "MessagePack.Annotations", "id": "MessagePack.Annotations", "version": "2.5.129", "sha512": "sha512-mr12dLr06Kp7Ra7+GUXHbuxt/gbi6RPGPw1mpSvZsubs7hJxzHDtYTb5KKuseu5cpzOUDfsGcaW+Bo0+lqCFAA==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.Build", "id": "Microsoft.Build", "version": "17.8.3", "sha512": "sha512-jRz++ltVTU9xGAYSnI7fGwLIsg/AwINaxlXaJrcMszO+fyh1xJ8gKZkDz10foT/5y26jZC6G93wyp85NVHc+lA==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Reflection.MetadataLoadContext", "System.Security.Principal.Windows", "System.Threading.Tasks.Dataflow", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net48": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Reflection.MetadataLoadContext", "System.Security.Principal.Windows", "System.Threading.Tasks.Dataflow", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Reflection.MetadataLoadContext", "System.Security.Principal.Windows", "System.Threading.Tasks.Dataflow", "System.Reflection.Metadata"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.Build.Framework", "id": "Microsoft.Build.Framework", "version": "17.8.3", "sha512": "sha512-xDOoj8lpNohM0Sieo4sJ47m/3SAquclF8wFZeAYYuDRHc8hII4XWPhSafFmw5A4TMGOyV08Z1TrrqES9HxMB3Q==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "net462": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "net47": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "net471": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "net472": ["System.Runtime.CompilerServices.Unsafe"], "net48": ["System.Runtime.CompilerServices.Unsafe"], "net5.0": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "net6.0": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "net7.0": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "netcoreapp2.1": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "netcoreapp2.2": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "netcoreapp3.0": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "netcoreapp3.1": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"], "netstandard2.1": ["System.Runtime.CompilerServices.Unsafe", "System.Security.Principal.Windows"]}, "targeting_pack_overrides": [], "framework_list": []}, + {"name": "Microsoft.Build.Utilities.Core", "id": "Microsoft.Build.Utilities.Core", "version": "17.5.0", "sha512": "sha512-La1NFQ7SVz1pVGEUnG15BQG26jJkRMCiitySBXLhuTYf9IG6eZ5j5UFjnM4EFKSVKbictRv+D/F0dQtsCiK9ag==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "net462": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "net47": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "net471": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "net472": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager"], "net48": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager"], "net5.0": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "net6.0": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "net7.0": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager"], "net8.0": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "netcoreapp2.1": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "netcoreapp2.2": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "netcoreapp3.0": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "netcoreapp3.1": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"], "netstandard2.1": ["Microsoft.Build.Framework", "Microsoft.NET.StringTools", "System.Collections.Immutable", "System.Configuration.ConfigurationManager", "System.Security.Permissions"]}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.CodeAnalysis", "id": "Microsoft.CodeAnalysis", "version": "4.9.2", "sha512": "sha512-CJh/yj/ZWnDn0qRDovqeb7qhXl4MDFR5CELAQ2B5K9dcEC6JPg7Fkm2ADRiBM4UF7ub+n6fkiE5+/+GPD5WbFg==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "net462": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "net47": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "net471": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "net472": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "net48": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "net5.0": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "net6.0": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "net7.0": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "net8.0": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "netcoreapp2.1": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "netcoreapp2.2": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "netcoreapp3.0": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "netcoreapp3.1": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"], "netstandard2.1": ["Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.VisualBasic.Workspaces"]}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.CodeAnalysis.Analyzers", "id": "Microsoft.CodeAnalysis.Analyzers", "version": "3.3.4", "sha512": "sha512-I+Riw6/6WjNICydoiNpDjN/GGP7u4XsL6VsI9lG/OjFufH3flvSEy/fxNhGDVGwZWwq/5BlnqX+LH2dmheaPfg==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.CodeAnalysis.Common", "id": "Microsoft.CodeAnalysis.Common", "version": "4.9.2", "sha512": "sha512-XCtqPQdnoqfrBSidFWIESm8exXVHF4yPY94e84St2PVZPc2bGeQNXdFNwadu1Bd2sr/bAgM5B0UHbCqBz+/SeQ==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net462": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net47": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net471": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net472": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net48": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net5.0": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net6.0": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net7.0": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "net8.0": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp2.1": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp2.2": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp3.0": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "netcoreapp3.1": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"], "netstandard2.1": ["Microsoft.CodeAnalysis.Analyzers", "System.Collections.Immutable", "System.Reflection.Metadata", "System.Runtime.CompilerServices.Unsafe"]}, "targeting_pack_overrides": [], "framework_list": []}, @@ -19,6 +23,7 @@ def main(): {"name": "Microsoft.CodeAnalysis.VisualBasic.Workspaces", "id": "Microsoft.CodeAnalysis.VisualBasic.Workspaces", "version": "4.9.2", "sha512": "sha512-v07rvZvckHiPLDzKXFs9AXfEGsDeTvR+N9YHO9wQqboXgms4HCv0fTrZOOgqM/aVS7racJKRo1tf62UfjqMeEw==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "net462": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "net47": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "net471": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "net472": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "net48": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "net5.0": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "net6.0": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "net7.0": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "net8.0": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "netcoreapp2.1": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "netcoreapp2.2": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "netcoreapp3.0": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "netcoreapp3.1": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"], "netstandard2.1": ["Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.VisualBasic", "Microsoft.CodeAnalysis.Workspaces.Common"]}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.CodeAnalysis.Workspaces.Common", "id": "Microsoft.CodeAnalysis.Workspaces.Common", "version": "4.9.2", "sha512": "sha512-DieswZYcYVGDPeT6m7M4i+0aKkjSgyjmI9z9HJEDSRZdvXfKYLEKwmlFGUTyzFS4brnyMCwLSiw2KWVAydpzVA==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "net462": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "net47": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "net471": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "net472": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "net48": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "net5.0": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "net6.0": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "net7.0": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "net8.0": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "netcoreapp2.1": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "netcoreapp2.2": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "netcoreapp3.0": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "netcoreapp3.1": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"], "netstandard2.1": ["Microsoft.CodeAnalysis.Common", "Humanizer.Core", "System.Composition", "System.IO.Pipelines", "System.Threading.Channels"]}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.CodeCoverage", "id": "Microsoft.CodeCoverage", "version": "17.9.0", "sha512": "sha512-QEb48Z408yBfe/f156te98pfHwjvLOKl+UC1Pzg7KH1PDXXgk8KN8ZOEdYGrAiG43pC99Oo39bCb2R5WE+e5VA==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, + {"name": "Microsoft.Extensions.ObjectPool", "id": "Microsoft.Extensions.ObjectPool", "version": "7.0.13", "sha512": "sha512-N66kAzKBfcs4zIX/iVMUOhfn8Xv3Ye1QpLGS8IUSpCHa+Vxh2ZsdDiqd0Y2m7ryPU6FU2LOTnZ+0ymmm83vC6w==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.NET.StringTools", "id": "Microsoft.NET.StringTools", "version": "17.8.3", "sha512": "sha512-3N/Ika66JZeORrIZ68fap6M0LSQ9+SQz277NxjA/dxETnR3dZwJXj67jAAc4FkijG6w//QzrC5NEregtIVjz1w==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": ["System.Runtime.CompilerServices.Unsafe"], "net48": ["System.Runtime.CompilerServices.Unsafe"], "net5.0": ["System.Runtime.CompilerServices.Unsafe"], "net6.0": ["System.Runtime.CompilerServices.Unsafe"], "net7.0": ["System.Runtime.CompilerServices.Unsafe"], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["System.Runtime.CompilerServices.Unsafe"], "netcoreapp2.1": ["System.Runtime.CompilerServices.Unsafe"], "netcoreapp2.2": ["System.Runtime.CompilerServices.Unsafe"], "netcoreapp3.0": ["System.Runtime.CompilerServices.Unsafe"], "netcoreapp3.1": ["System.Runtime.CompilerServices.Unsafe"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["System.Runtime.CompilerServices.Unsafe"], "netstandard2.1": ["System.Runtime.CompilerServices.Unsafe"]}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.NET.Test.Sdk", "id": "Microsoft.NET.Test.Sdk", "version": "17.9.0", "sha512": "sha512-1WsHeRGhVUDonn7uT+vAGkYmJF57QTR+0PDpoIvDPq+vJtaNzrUHJbPFrU3aV+y68D+0wlj4QRop5fzvxFBJkA==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": ["Microsoft.CodeCoverage"], "net47": ["Microsoft.CodeCoverage"], "net471": ["Microsoft.CodeCoverage"], "net472": ["Microsoft.CodeCoverage"], "net48": ["Microsoft.CodeCoverage"], "net5.0": ["Microsoft.TestPlatform.TestHost", "Microsoft.CodeCoverage"], "net6.0": ["Microsoft.TestPlatform.TestHost", "Microsoft.CodeCoverage"], "net7.0": ["Microsoft.TestPlatform.TestHost", "Microsoft.CodeCoverage"], "net8.0": ["Microsoft.TestPlatform.TestHost", "Microsoft.CodeCoverage"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": ["Microsoft.TestPlatform.TestHost", "Microsoft.CodeCoverage"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.NETCore.Platforms", "id": "Microsoft.NETCore.Platforms", "version": "1.1.1", "sha512": "sha512-mDUJD1eLXIzmUnWCzWlmNQZGDp/cVGT8KyhzMcJNk2nlfdFUOoZai9idT8/FacJr8Nv8zhAmdf39FHm5qWUoGQ==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, @@ -28,6 +33,7 @@ def main(): {"name": "Microsoft.Win32.Primitives", "id": "Microsoft.Win32.Primitives", "version": "4.3.0", "sha512": "sha512-Nm8Hp51y9tYcK3xD6qk43Wjftrg1mdH24CCJsTb6gr7HS21U1uA+CKPGEtUcVZbjU1y8Kynzm5eoJ7Pnx5gm8A==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "net6.0": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "net7.0": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "net8.0": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netcoreapp1.0": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netcoreapp1.1": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netcoreapp2.0": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netcoreapp2.1": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netcoreapp2.2": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netcoreapp3.0": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netcoreapp3.1": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netstandard1.4": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netstandard1.5": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netstandard1.6": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netstandard2.0": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"], "netstandard2.1": ["Microsoft.NETCore.Platforms", "Microsoft.NETCore.Targets", "System.Runtime"]}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Microsoft.Win32.SystemEvents", "id": "Microsoft.Win32.SystemEvents", "version": "7.0.0", "sha512": "sha512-GO6SWx/wSZIFvxOn67Y6OiIGdz9JGCg5CRDDbSAAvBDQeZFbybu9sEOUb9w/vUlQv+A2XakTFZg9Ug1w+tgbWQ==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Mono.Posix.NETStandard", "id": "Mono.Posix.NETStandard", "version": "1.0.0", "sha512": "sha512-RtGiutQZJAmajvQ0QvBvh73VJye85iW9f9tjZlzF88idLxNMo4lAktP/4Y9ilCpais0LDO0tpoICt9Hdv6wooA==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, + {"name": "MSBuild.StructuredLogger", "id": "MSBuild.StructuredLogger", "version": "2.2.235", "sha512": "sha512-9ige0SOByBirmeIYZ3fwlwbnXrYZA2trdZV7Mad8z7FiuGbVNOVkGYrzln/+G1eIvmRh9J0pt6xBLwqIYaMxyQ==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "net462": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "net47": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "net471": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "net472": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "net48": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "net5.0": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "net6.0": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "net7.0": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "net8.0": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "netcoreapp2.1": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "netcoreapp2.2": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "netcoreapp3.0": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "netcoreapp3.1": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"], "netstandard2.1": ["Microsoft.Build.Framework", "Microsoft.Build.Utilities.Core"]}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "Newtonsoft.Json", "id": "Newtonsoft.Json", "version": "13.0.3", "sha512": "sha512-mbJSvHfRxfX3tR/U6n1WU+mWHXswYc+SB/hkOpx8yZZe68hNZGfymJu0cjsaJEkVzCMqePiU6LdIyogqfIn7kg==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": [], "net462": [], "net47": [], "net471": [], "net472": [], "net48": [], "net5.0": [], "net6.0": [], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": [], "netcoreapp2.1": [], "netcoreapp2.2": [], "netcoreapp3.0": [], "netcoreapp3.1": [], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": [], "netstandard2.1": []}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "System.Collections.Immutable", "id": "System.Collections.Immutable", "version": "8.0.0", "sha512": "sha512-BXqVkcIrhimvvem6q2ChWkuW6XYYirvb6FlhvuwaMoBqBdpcr4nehJBKP65Tw40UqcUM6oDoODsecM0yjZ6AUw==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["System.Runtime.CompilerServices.Unsafe"], "net462": ["System.Runtime.CompilerServices.Unsafe"], "net47": ["System.Runtime.CompilerServices.Unsafe"], "net471": ["System.Runtime.CompilerServices.Unsafe"], "net472": ["System.Runtime.CompilerServices.Unsafe"], "net48": ["System.Runtime.CompilerServices.Unsafe"], "net5.0": ["System.Runtime.CompilerServices.Unsafe"], "net6.0": ["System.Runtime.CompilerServices.Unsafe"], "net7.0": [], "net8.0": [], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["System.Runtime.CompilerServices.Unsafe"], "netcoreapp2.1": ["System.Runtime.CompilerServices.Unsafe"], "netcoreapp2.2": ["System.Runtime.CompilerServices.Unsafe"], "netcoreapp3.0": ["System.Runtime.CompilerServices.Unsafe"], "netcoreapp3.1": ["System.Runtime.CompilerServices.Unsafe"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["System.Runtime.CompilerServices.Unsafe"], "netstandard2.1": ["System.Runtime.CompilerServices.Unsafe"]}, "targeting_pack_overrides": [], "framework_list": []}, {"name": "System.Composition", "id": "System.Composition", "version": "8.0.0", "sha512": "sha512-/AZ/S+sX6awiSeSvOv7997aiwbU6HCcOBJDLecdYQJjDo+4nYCrWwWKQQIZ38VZ6BLh1pDmcYFPZockIuoRIYw==", "sources": ["https://api.nuget.org/v3/index.json"], "dependencies": {"net11": [], "net20": [], "net30": [], "net35": [], "net40": [], "net403": [], "net45": [], "net451": [], "net452": [], "net46": [], "net461": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "net462": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "net47": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "net471": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "net472": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "net48": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "net5.0": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "net6.0": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "net7.0": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "net8.0": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "netcoreapp1.0": [], "netcoreapp1.1": [], "netcoreapp2.0": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "netcoreapp2.1": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "netcoreapp2.2": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "netcoreapp3.0": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "netcoreapp3.1": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "netstandard": [], "netstandard1.0": [], "netstandard1.1": [], "netstandard1.2": [], "netstandard1.3": [], "netstandard1.4": [], "netstandard1.5": [], "netstandard1.6": [], "netstandard2.0": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"], "netstandard2.1": ["System.Composition.AttributedModel", "System.Composition.Convention", "System.Composition.Hosting", "System.Composition.Runtime", "System.Composition.TypedParts"]}, "targeting_pack_overrides": [], "framework_list": []}, diff --git a/csharp/ql/integration-tests/all-platforms/binlog/Files.expected b/csharp/ql/integration-tests/all-platforms/binlog/Files.expected new file mode 100644 index 000000000000..03e3212cb773 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/Files.expected @@ -0,0 +1,5 @@ +| Program.cs:0:0:0:0 | Program.cs | +| System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | +| obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | +| obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | obj/Debug/net8.0/test.AssemblyInfo.cs | +| obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | obj/Debug/net8.0/test.GlobalUsings.g.cs | diff --git a/csharp/ql/integration-tests/all-platforms/binlog/Files.ql b/csharp/ql/integration-tests/all-platforms/binlog/Files.ql new file mode 100644 index 000000000000..bea5557a25f1 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/Files.ql @@ -0,0 +1,5 @@ +import csharp + +from File f +where f.fromSource() +select f diff --git a/csharp/ql/integration-tests/all-platforms/binlog/Program.cs b/csharp/ql/integration-tests/all-platforms/binlog/Program.cs new file mode 100644 index 000000000000..2c75e62d019d --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/Program.cs @@ -0,0 +1,9 @@ +using System.Text.RegularExpressions; + +var dummy = "dummy"; + +partial class Test +{ + [GeneratedRegex("abc|def", RegexOptions.IgnoreCase, "en-US")] + private static partial Regex AbcOrDefGeneratedRegex(); +} diff --git a/csharp/ql/integration-tests/all-platforms/binlog/global.json b/csharp/ql/integration-tests/all-platforms/binlog/global.json new file mode 100644 index 000000000000..5c3fd64fbd12 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "8.0.101" + } +} diff --git a/csharp/ql/integration-tests/all-platforms/binlog/test.csproj b/csharp/ql/integration-tests/all-platforms/binlog/test.csproj new file mode 100644 index 000000000000..91b464afeacc --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/test.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/csharp/ql/integration-tests/all-platforms/binlog/test.py b/csharp/ql/integration-tests/all-platforms/binlog/test.py new file mode 100644 index 000000000000..fd1af1571a25 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/test.py @@ -0,0 +1,5 @@ +import subprocess +from create_database_utils import * + +subprocess.check_call(["dotnet", "build", "/bl:test.binlog"]) +run_codeql_database_create([], lang="csharp", extra_args=["--build-mode=none", "-Obinlog=test.binlog"]) diff --git a/csharp/ql/integration-tests/posix-only/standalone_dependencies_executing_runtime/Assemblies.expected b/csharp/ql/integration-tests/posix-only/standalone_dependencies_executing_runtime/Assemblies.expected index 7becadc8aa1f..c2742cebc573 100644 --- a/csharp/ql/integration-tests/posix-only/standalone_dependencies_executing_runtime/Assemblies.expected +++ b/csharp/ql/integration-tests/posix-only/standalone_dependencies_executing_runtime/Assemblies.expected @@ -1,5 +1,9 @@ +| [...]/Basic.CompilerLog.Util.dll | | [...]/Humanizer.dll | +| [...]/MessagePack.Annotations.dll | +| [...]/MessagePack.dll | | [...]/Microsoft.Build.Framework.dll | +| [...]/Microsoft.Build.Utilities.Core.dll | | [...]/Microsoft.Build.dll | | [...]/Microsoft.CSharp.dll | | [...]/Microsoft.CodeAnalysis.CSharp.Workspaces.dll | @@ -8,6 +12,7 @@ | [...]/Microsoft.CodeAnalysis.VisualBasic.dll | | [...]/Microsoft.CodeAnalysis.Workspaces.dll | | [...]/Microsoft.CodeAnalysis.dll | +| [...]/Microsoft.Extensions.ObjectPool.dll | | [...]/Microsoft.NET.StringTools.dll | | [...]/Microsoft.VisualBasic.Core.dll | | [...]/Microsoft.VisualBasic.dll | @@ -16,6 +21,7 @@ | [...]/Microsoft.Win32.SystemEvents.dll | | [...]/Mono.Posix.NETStandard.dll | | [...]/Newtonsoft.Json.dll | +| [...]/StructuredLogger.dll | | [...]/System.AppContext.dll | | [...]/System.Buffers.dll | | [...]/System.Collections.Concurrent.dll | From dcd84f47a4ae094abe8f16763fe2579077e1dda8 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Thu, 13 Jun 2024 16:31:01 +0200 Subject: [PATCH 2/9] Improve source archiving to handle non-existent files --- .../extractor/Semmle.Extraction/TrapWriter.cs | 29 +++++-------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction/TrapWriter.cs b/csharp/extractor/Semmle.Extraction/TrapWriter.cs index 5134c6e638e3..e551dd3b9eaa 100644 --- a/csharp/extractor/Semmle.Extraction/TrapWriter.cs +++ b/csharp/extractor/Semmle.Extraction/TrapWriter.cs @@ -115,19 +115,6 @@ public void Archive(string originalPath, PathTransformer.ITransformedPath transf ArchivePath(fullInputPath, transformedPath, inputEncoding); } - /// - /// Archive a file given the file contents. - /// - /// The path of the file. - /// The contents of the file. - public void Archive(PathTransformer.ITransformedPath inputPath, string contents) - { - if (string.IsNullOrEmpty(archive)) - return; - - ArchiveContents(inputPath, contents); - } - /// /// Try to move a file from sourceFile to destFile. /// If successful returns true, @@ -209,23 +196,21 @@ public void Emit(ITrapEmitter emitter) /// If the output path in the source archive would /// exceed the system path limit of 260 characters. private void ArchivePath(string fullInputPath, PathTransformer.ITransformedPath transformedPath, Encoding inputEncoding) - { - var contents = File.ReadAllText(fullInputPath, inputEncoding); - ArchiveContents(transformedPath, contents); - } - - private void ArchiveContents(PathTransformer.ITransformedPath transformedPath, string contents) { var dest = FileUtils.NestPaths(logger, archive, transformedPath.Value); - var tmpSrcFile = Path.GetTempFileName(); - File.WriteAllText(tmpSrcFile, contents, utf8); try { + var contents = File.ReadAllText(fullInputPath, inputEncoding); + var tmpSrcFile = Path.GetTempFileName(); + File.WriteAllText(tmpSrcFile, contents, utf8); + FileUtils.MoveOrReplace(tmpSrcFile, dest); } catch (Exception ex) { - // If this happened, it was probably because the same file was compiled multiple times. + // If this happened, it was probably because + // - the same file was compiled multiple times, or + // - the file doesn't exist (due to wrong #line directive or because it's an in-memory source generated AST). // In any case, this is not a fatal error. logger.LogWarning("Problem archiving " + dest + ": " + ex); } From fb0520c74a7722102fa71754dd10d6691eba5eff Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Mon, 17 Jun 2024 13:59:35 +0200 Subject: [PATCH 3/9] C#: Adjust trap location, database ID and archiving of generated sources --- .../Semmle.Extraction.CSharp/Entities/File.cs | 9 ++- .../Extractor/Analyser.cs | 3 +- .../Extractor/BinaryLogAnalyser.cs | 12 +++- .../Extractor/Extractor.cs | 12 +++- .../Semmle.Extraction/Entities/File.cs | 3 +- .../Extractor/BinaryLogExtractionContext.cs | 60 +++++++++++++++++ .../extractor/Semmle.Extraction/TrapWriter.cs | 65 +++++++++---------- .../all-platforms/binlog/Files.expected | 2 +- 8 files changed, 124 insertions(+), 42 deletions(-) create mode 100644 csharp/extractor/Semmle.Extraction/Extractor/BinaryLogExtractionContext.cs diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Entities/File.cs b/csharp/extractor/Semmle.Extraction.CSharp/Entities/File.cs index e0940191a314..9a2d0475c585 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Entities/File.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Entities/File.cs @@ -34,7 +34,14 @@ public override void Populate(TextWriter trapFile) lineCounts.Total++; trapFile.numlines(this, lineCounts); - Context.TrapWriter.Archive(originalPath, TransformedPath, text.Encoding ?? System.Text.Encoding.Default); + if (BinaryLogExtractionContext.GetAdjustedPath(Context.ExtractionContext, originalPath) is not null) + { + Context.TrapWriter.ArchiveContent(rawText, TransformedPath); + } + else + { + Context.TrapWriter.Archive(originalPath, TransformedPath, text.Encoding ?? System.Text.Encoding.Default); + } } } else if (IsPossiblyTextFile()) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Analyser.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Analyser.cs index 646dde1606e9..45228e8b81d8 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Analyser.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Analyser.cs @@ -185,7 +185,8 @@ private void DoExtractTree(SyntaxTree tree) { var stopwatch = new Stopwatch(); stopwatch.Start(); - var sourcePath = tree.FilePath; + var sourcePath = BinaryLogExtractionContext.GetAdjustedPath(ExtractionContext, tree.FilePath) ?? tree.FilePath; + var transformedSourcePath = PathTransformer.Transform(sourcePath); var trapPath = transformedSourcePath.GetTrapPath(Logger, options.TrapCompression); diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogAnalyser.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogAnalyser.cs index c59966072db3..6026778f2f7e 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogAnalyser.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogAnalyser.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Microsoft.CodeAnalysis.CSharp; using Semmle.Util; using Semmle.Util.Logging; @@ -11,10 +12,15 @@ public BinaryLogAnalyser(IProgressMonitor pm, ILogger logger, PathTransformer pa { } - public void Initialize(string cwd, string[] args, string outputPath, CSharpCompilation compilationIn, CommonOptions options) + public void Initialize( + string cwd, string[] args, string outputPath, CSharpCompilation compilation, + IEnumerable generatedSyntaxTrees, + string compilationIdentifier, CommonOptions options) { - compilation = compilationIn; - ExtractionContext = new ExtractionContext(cwd, args, outputPath, [], Logger, PathTransformer, ExtractorMode.BinaryLog, options.QlTest); + base.compilation = compilation; + ExtractionContext = new BinaryLogExtractionContext( + cwd, args, outputPath, generatedSyntaxTrees, compilationIdentifier, + Logger, PathTransformer, options.QlTest); this.options = options; LogExtractorInfo(); SetReferencePaths(); diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs index 8ea00e4282cf..2c5f5fe618d5 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs @@ -158,13 +158,23 @@ static bool filter(CompilerCall compilerCall) var compilerArgs = compilerCall.GetArguments(); var args = reader.ReadCommandLineArguments(compilerCall); + // Generated syntax trees are always added to the end of the list of syntax trees. + var generatedSyntaxTrees = compilation.SyntaxTrees.Skip(compilationData.Compilation.SyntaxTrees.Count()); + using var analyser = new BinaryLogAnalyser(new LogProgressMonitor(logger), logger, pathTransformer, canonicalPathCache, options.AssemblySensitiveTrap); var exit = Analyse(stopwatch, analyser, options, references => [() => compilation.References.ForEach(r => references.Add(r))], (analyser, syntaxTrees) => [() => syntaxTrees.AddRange(compilation.SyntaxTrees)], (syntaxTrees, references) => compilation, - (compilation, options) => analyser.Initialize(compilerCall.ProjectDirectory, compilerArgs?.ToArray() ?? [], TracingAnalyser.GetOutputName(compilation, args), compilation, options), + (compilation, options) => analyser.Initialize( + compilerCall.ProjectDirectory, + compilerArgs?.ToArray() ?? [], + TracingAnalyser.GetOutputName(compilation, args), + compilation, + generatedSyntaxTrees, + diagnosticName, + options), () => { }); switch (exit) diff --git a/csharp/extractor/Semmle.Extraction/Entities/File.cs b/csharp/extractor/Semmle.Extraction/Entities/File.cs index b703362feb8e..dda965920ae1 100644 --- a/csharp/extractor/Semmle.Extraction/Entities/File.cs +++ b/csharp/extractor/Semmle.Extraction/Entities/File.cs @@ -8,7 +8,8 @@ protected File(Context cx, string path) : base(cx, path) { originalPath = path; - transformedPathLazy = new Lazy(() => Context.ExtractionContext.PathTransformer.Transform(originalPath)); + var adjustedPath = BinaryLogExtractionContext.GetAdjustedPath(Context.ExtractionContext, originalPath) ?? path; + transformedPathLazy = new Lazy(() => Context.ExtractionContext.PathTransformer.Transform(adjustedPath)); } protected readonly string originalPath; diff --git a/csharp/extractor/Semmle.Extraction/Extractor/BinaryLogExtractionContext.cs b/csharp/extractor/Semmle.Extraction/Extractor/BinaryLogExtractionContext.cs new file mode 100644 index 000000000000..5e3ac901bb01 --- /dev/null +++ b/csharp/extractor/Semmle.Extraction/Extractor/BinaryLogExtractionContext.cs @@ -0,0 +1,60 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.CodeAnalysis; +using Semmle.Util.Logging; + +namespace Semmle.Extraction +{ + public class BinaryLogExtractionContext : ExtractionContext + { + private readonly IEnumerable generatedSyntaxTrees; + private readonly string compilationIdentifier; + private readonly string generatedFolderName; + + public BinaryLogExtractionContext(string cwd, string[] args, string outputPath, + IEnumerable generatedSyntaxTrees, string compilationIdentifier, + ILogger logger, PathTransformer pathTransformer, bool isQlTest) + : base(cwd, args, outputPath, [], logger, pathTransformer, ExtractorMode.BinaryLog, isQlTest) + { + this.generatedSyntaxTrees = generatedSyntaxTrees; + this.compilationIdentifier = compilationIdentifier; + + // Compute a unique folder name for the generated files: + generatedFolderName = "generated"; + + if (Directory.Exists(generatedFolderName)) + { + var counter = 0; + do + { + generatedFolderName = $"generated{counter++}"; + } + while (Directory.Exists(generatedFolderName)); + } + } + + private string? GetAdjustedPath(string path) + { + var syntaxTree = generatedSyntaxTrees.FirstOrDefault(t => t.FilePath == path); + if (syntaxTree is null) + { + return null; + } + + return Path.Join(generatedFolderName, compilationIdentifier, path); + } + + public static string? GetAdjustedPath(ExtractionContext extractionContext, string sourcePath) + { + if (extractionContext.Mode.HasFlag(ExtractorMode.BinaryLog) + && extractionContext is BinaryLogExtractionContext binaryLogExtractionContext + && binaryLogExtractionContext.GetAdjustedPath(sourcePath) is string adjustedPath) + { + return adjustedPath; + } + + return null; + } + } +} diff --git a/csharp/extractor/Semmle.Extraction/TrapWriter.cs b/csharp/extractor/Semmle.Extraction/TrapWriter.cs index e551dd3b9eaa..6baf55f7647a 100644 --- a/csharp/extractor/Semmle.Extraction/TrapWriter.cs +++ b/csharp/extractor/Semmle.Extraction/TrapWriter.cs @@ -105,14 +105,42 @@ public TrapWriter(ILogger logger, PathTransformer.ITransformedPath outputfile, s /// The transformed path to the input file. /// The encoding used by the input file. public void Archive(string originalPath, PathTransformer.ITransformedPath transformedPath, Encoding inputEncoding) + { + Archive(() => + { + var fullInputPath = Path.GetFullPath(originalPath); + return File.ReadAllText(fullInputPath, inputEncoding); + }, transformedPath); + } + + public void ArchiveContent(string contents, PathTransformer.ITransformedPath transformedPath) + { + Archive(() => contents, transformedPath); + } + + private void Archive(Func getContent, PathTransformer.ITransformedPath transformedPath) { if (string.IsNullOrEmpty(archive)) + { return; + } - // Calling GetFullPath makes this use the canonical capitalisation, if the file exists. - var fullInputPath = Path.GetFullPath(originalPath); + var dest = FileUtils.NestPaths(logger, archive, transformedPath.Value); + try + { + var tmpSrcFile = Path.GetTempFileName(); + File.WriteAllText(tmpSrcFile, getContent(), utf8); - ArchivePath(fullInputPath, transformedPath, inputEncoding); + FileUtils.MoveOrReplace(tmpSrcFile, dest); + } + catch (Exception ex) + { + // If this happened, it was probably because + // - the same file was compiled multiple times, or + // - the file doesn't exist (due to wrong #line directive or because it's an in-memory source generated AST). + // In any case, this is not a fatal error. + logger.LogWarning("Problem archiving " + dest + ": " + ex); + } } /// @@ -185,37 +213,6 @@ public void Emit(ITrapEmitter emitter) emitter.EmitTrap(Writer); } - /// - /// Attempts to archive the specified input file to the normal area of the source archive. - /// The file's path must be sufficiently short so as to render the path of its copy in the - /// source archive less than the system path limit of 260 characters. - /// - /// The full path to the input file. - /// The transformed path to the input file. - /// The encoding used by the input file. - /// If the output path in the source archive would - /// exceed the system path limit of 260 characters. - private void ArchivePath(string fullInputPath, PathTransformer.ITransformedPath transformedPath, Encoding inputEncoding) - { - var dest = FileUtils.NestPaths(logger, archive, transformedPath.Value); - try - { - var contents = File.ReadAllText(fullInputPath, inputEncoding); - var tmpSrcFile = Path.GetTempFileName(); - File.WriteAllText(tmpSrcFile, contents, utf8); - - FileUtils.MoveOrReplace(tmpSrcFile, dest); - } - catch (Exception ex) - { - // If this happened, it was probably because - // - the same file was compiled multiple times, or - // - the file doesn't exist (due to wrong #line directive or because it's an in-memory source generated AST). - // In any case, this is not a fatal error. - logger.LogWarning("Problem archiving " + dest + ": " + ex); - } - } - private static string TrapExtension(CompressionMode compression) { switch (compression) diff --git a/csharp/ql/integration-tests/all-platforms/binlog/Files.expected b/csharp/ql/integration-tests/all-platforms/binlog/Files.expected index 03e3212cb773..7c795989ba8e 100644 --- a/csharp/ql/integration-tests/all-platforms/binlog/Files.expected +++ b/csharp/ql/integration-tests/all-platforms/binlog/Files.expected @@ -1,5 +1,5 @@ | Program.cs:0:0:0:0 | Program.cs | -| System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | +| generated/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | generated/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | | obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | | obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | obj/Debug/net8.0/test.AssemblyInfo.cs | | obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | obj/Debug/net8.0/test.GlobalUsings.g.cs | From b22f5f557acf481d05a22f1765b4a61ba54d0f70 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Fri, 21 Jun 2024 09:19:40 +0200 Subject: [PATCH 4/9] Fix failed extraction handling --- .../extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs index 2c5f5fe618d5..07bf43211a6d 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs @@ -189,7 +189,7 @@ static bool filter(CompilerCall compilerCall) break; case ExitCode.Failed: logger.LogWarning($" Compilation {diagnosticName} failed"); - return ExitCode.Failed; + break; } } return allFailed ? ExitCode.Failed : ExitCode.Ok; From 1ae40c95b15d0e1f8dee8222cd94623627d42910 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Fri, 21 Jun 2024 10:10:36 +0200 Subject: [PATCH 5/9] Change binlog test to have colliding generated file locations --- .../all-platforms/binlog/Files.expected | 12 ++++--- .../binlog/{Program.cs => a/A.cs} | 0 .../all-platforms/binlog/{ => a}/test.csproj | 0 .../all-platforms/binlog/b/B.cs | 9 ++++++ .../all-platforms/binlog/b/test.csproj | 10 ++++++ .../all-platforms/binlog/test.py | 2 +- .../all-platforms/binlog/test.sln | 31 +++++++++++++++++++ 7 files changed, 59 insertions(+), 5 deletions(-) rename csharp/ql/integration-tests/all-platforms/binlog/{Program.cs => a/A.cs} (100%) rename csharp/ql/integration-tests/all-platforms/binlog/{ => a}/test.csproj (100%) create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/b/B.cs create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/b/test.csproj create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/test.sln diff --git a/csharp/ql/integration-tests/all-platforms/binlog/Files.expected b/csharp/ql/integration-tests/all-platforms/binlog/Files.expected index 7c795989ba8e..8b3aae7617b7 100644 --- a/csharp/ql/integration-tests/all-platforms/binlog/Files.expected +++ b/csharp/ql/integration-tests/all-platforms/binlog/Files.expected @@ -1,5 +1,9 @@ -| Program.cs:0:0:0:0 | Program.cs | +| a/A.cs:0:0:0:0 | a/A.cs | +| a/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | a/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | +| a/obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | a/obj/Debug/net8.0/test.AssemblyInfo.cs | +| a/obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | a/obj/Debug/net8.0/test.GlobalUsings.g.cs | +| b/B.cs:0:0:0:0 | b/B.cs | +| b/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | b/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | +| b/obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | b/obj/Debug/net8.0/test.AssemblyInfo.cs | +| b/obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | b/obj/Debug/net8.0/test.GlobalUsings.g.cs | | generated/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | generated/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | -| obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | -| obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | obj/Debug/net8.0/test.AssemblyInfo.cs | -| obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | obj/Debug/net8.0/test.GlobalUsings.g.cs | diff --git a/csharp/ql/integration-tests/all-platforms/binlog/Program.cs b/csharp/ql/integration-tests/all-platforms/binlog/a/A.cs similarity index 100% rename from csharp/ql/integration-tests/all-platforms/binlog/Program.cs rename to csharp/ql/integration-tests/all-platforms/binlog/a/A.cs diff --git a/csharp/ql/integration-tests/all-platforms/binlog/test.csproj b/csharp/ql/integration-tests/all-platforms/binlog/a/test.csproj similarity index 100% rename from csharp/ql/integration-tests/all-platforms/binlog/test.csproj rename to csharp/ql/integration-tests/all-platforms/binlog/a/test.csproj diff --git a/csharp/ql/integration-tests/all-platforms/binlog/b/B.cs b/csharp/ql/integration-tests/all-platforms/binlog/b/B.cs new file mode 100644 index 000000000000..2c75e62d019d --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/b/B.cs @@ -0,0 +1,9 @@ +using System.Text.RegularExpressions; + +var dummy = "dummy"; + +partial class Test +{ + [GeneratedRegex("abc|def", RegexOptions.IgnoreCase, "en-US")] + private static partial Regex AbcOrDefGeneratedRegex(); +} diff --git a/csharp/ql/integration-tests/all-platforms/binlog/b/test.csproj b/csharp/ql/integration-tests/all-platforms/binlog/b/test.csproj new file mode 100644 index 000000000000..91b464afeacc --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/b/test.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/csharp/ql/integration-tests/all-platforms/binlog/test.py b/csharp/ql/integration-tests/all-platforms/binlog/test.py index fd1af1571a25..deca02b731bf 100644 --- a/csharp/ql/integration-tests/all-platforms/binlog/test.py +++ b/csharp/ql/integration-tests/all-platforms/binlog/test.py @@ -1,5 +1,5 @@ import subprocess from create_database_utils import * -subprocess.check_call(["dotnet", "build", "/bl:test.binlog"]) +subprocess.check_call(["dotnet", "build", "test.sln", "/bl:test.binlog"]) run_codeql_database_create([], lang="csharp", extra_args=["--build-mode=none", "-Obinlog=test.binlog"]) diff --git a/csharp/ql/integration-tests/all-platforms/binlog/test.sln b/csharp/ql/integration-tests/all-platforms/binlog/test.sln new file mode 100644 index 000000000000..56a8bc1280b8 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/test.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "a", "a\test.csproj", "{B130424A-95E8-4D13-B996-7284832892B2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "b", "b\test.csproj", "{DCD99DF2-8FA0-4E4B-A18E-C4AA9DF27DEA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B130424A-95E8-4D13-B996-7284832892B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B130424A-95E8-4D13-B996-7284832892B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B130424A-95E8-4D13-B996-7284832892B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B130424A-95E8-4D13-B996-7284832892B2}.Release|Any CPU.Build.0 = Release|Any CPU + {DCD99DF2-8FA0-4E4B-A18E-C4AA9DF27DEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DCD99DF2-8FA0-4E4B-A18E-C4AA9DF27DEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DCD99DF2-8FA0-4E4B-A18E-C4AA9DF27DEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DCD99DF2-8FA0-4E4B-A18E-C4AA9DF27DEA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0A7E95FD-097D-4B6D-916F-0D0176AD1265} + EndGlobalSection +EndGlobal From 0b41d5121a77bb27efeae7ad3e8ae929905a10bd Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Fri, 21 Jun 2024 10:11:45 +0200 Subject: [PATCH 6/9] Compute unique identifier (folder path) for each compilation --- .../Extractor/Extractor.cs | 16 ++++++++++++++-- csharp/extractor/Semmle.Util/FileUtils.cs | 19 +++++++++++++------ .../all-platforms/binlog/Files.expected | 3 ++- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs index 07bf43211a6d..e968ef239422 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs @@ -154,8 +154,20 @@ static bool filter(CompilerCall compilerCall) var compilerCall = compilationData.CompilerCall; var diagnosticName = compilerCall.GetDiagnosticName(); - logger.LogInfo($" Processing compilation {diagnosticName}"); + logger.LogInfo($" Processing compilation {diagnosticName} at {compilerCall.ProjectDirectory}"); var compilerArgs = compilerCall.GetArguments(); + + var compilationIdentifierPath = string.Empty; + try + { + compilationIdentifierPath = FileUtils.ConvertPathToSafeRelativePath( + Path.GetRelativePath(Directory.GetCurrentDirectory(), compilerCall.ProjectDirectory)); + } + catch (ArgumentException exc) + { + logger.LogWarning($" Failed to get relative path for {compilerCall.ProjectDirectory} from current working directory {Directory.GetCurrentDirectory()}: {exc.Message}"); + } + var args = reader.ReadCommandLineArguments(compilerCall); // Generated syntax trees are always added to the end of the list of syntax trees. @@ -173,7 +185,7 @@ static bool filter(CompilerCall compilerCall) TracingAnalyser.GetOutputName(compilation, args), compilation, generatedSyntaxTrees, - diagnosticName, + Path.Combine(compilationIdentifierPath, diagnosticName), options), () => { }); diff --git a/csharp/extractor/Semmle.Util/FileUtils.cs b/csharp/extractor/Semmle.Util/FileUtils.cs index 4d9052bcc4ea..92087645fd1c 100644 --- a/csharp/extractor/Semmle.Util/FileUtils.cs +++ b/csharp/extractor/Semmle.Util/FileUtils.cs @@ -113,17 +113,24 @@ private static async Task DownloadFileAsync(string address, string filename) public static void DownloadFile(string address, string fileName) => DownloadFileAsync(address, fileName).GetAwaiter().GetResult(); + public static string ConvertPathToSafeRelativePath(string path) + { + // Remove all leading path separators / or \ + // For example, UNC paths have two leading \\ + path = path.TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); + + if (path.Length > 1 && path[1] == ':') + path = path[0] + "_" + path.Substring(2); + + return path; + } + public static string NestPaths(ILogger logger, string? outerpath, string innerpath) { var nested = innerpath; if (!string.IsNullOrEmpty(outerpath)) { - // Remove all leading path separators / or \ - // For example, UNC paths have two leading \\ - innerpath = innerpath.TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - - if (innerpath.Length > 1 && innerpath[1] == ':') - innerpath = innerpath[0] + "_" + innerpath.Substring(2); + innerpath = ConvertPathToSafeRelativePath(innerpath); nested = Path.Combine(outerpath, innerpath); } diff --git a/csharp/ql/integration-tests/all-platforms/binlog/Files.expected b/csharp/ql/integration-tests/all-platforms/binlog/Files.expected index 8b3aae7617b7..bf3694ff9caa 100644 --- a/csharp/ql/integration-tests/all-platforms/binlog/Files.expected +++ b/csharp/ql/integration-tests/all-platforms/binlog/Files.expected @@ -6,4 +6,5 @@ | b/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | b/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | | b/obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | b/obj/Debug/net8.0/test.AssemblyInfo.cs | | b/obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | b/obj/Debug/net8.0/test.GlobalUsings.g.cs | -| generated/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | generated/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | +| generated/a/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | generated/a/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | +| generated/b/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | generated/b/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | From 1e2d1ef7157e23afaac064964e6523f2bace5fb8 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Wed, 26 Jun 2024 11:37:07 +0200 Subject: [PATCH 7/9] Use dedicated API to get generated syntax trees --- .../extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs index e968ef239422..7bf2b08985a9 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs @@ -169,9 +169,7 @@ static bool filter(CompilerCall compilerCall) } var args = reader.ReadCommandLineArguments(compilerCall); - - // Generated syntax trees are always added to the end of the list of syntax trees. - var generatedSyntaxTrees = compilation.SyntaxTrees.Skip(compilationData.Compilation.SyntaxTrees.Count()); + var generatedSyntaxTrees = compilationData.GetGeneratedSyntaxTrees(); using var analyser = new BinaryLogAnalyser(new LogProgressMonitor(logger), logger, pathTransformer, canonicalPathCache, options.AssemblySensitiveTrap); From c8927447f50c43824afae37c845e11bafec25bbb Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Fri, 28 Jun 2024 09:40:13 +0200 Subject: [PATCH 8/9] Record diagnostics in binlog extraction test --- .../all-platforms/binlog/diagnostics.expected | 28 +++++++++++++++++++ .../all-platforms/binlog/test.py | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected diff --git a/csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected b/csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected new file mode 100644 index 000000000000..19390ed2af26 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected @@ -0,0 +1,28 @@ +{ + "markdownMessage": "C# analysis with build-mode 'none' completed.", + "severity": "unknown", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/buildless/complete", + "name": "C# analysis with build-mode 'none' completed" + }, + "visibility": { + "cliSummaryTable": true, + "statusPage": false, + "telemetry": true + } +} +{ + "markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.", + "severity": "note", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/buildless/mode-active", + "name": "C# was extracted with build-mode set to 'none'" + }, + "visibility": { + "cliSummaryTable": true, + "statusPage": true, + "telemetry": true + } +} diff --git a/csharp/ql/integration-tests/all-platforms/binlog/test.py b/csharp/ql/integration-tests/all-platforms/binlog/test.py index deca02b731bf..ad36c9599c3b 100644 --- a/csharp/ql/integration-tests/all-platforms/binlog/test.py +++ b/csharp/ql/integration-tests/all-platforms/binlog/test.py @@ -1,5 +1,7 @@ import subprocess from create_database_utils import * +from diagnostics_test_utils import * subprocess.check_call(["dotnet", "build", "test.sln", "/bl:test.binlog"]) run_codeql_database_create([], lang="csharp", extra_args=["--build-mode=none", "-Obinlog=test.binlog"]) +check_diagnostics() From 4db586f17df6dbdf060e51337cb974bc317156ee Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Fri, 28 Jun 2024 09:40:41 +0200 Subject: [PATCH 9/9] Add TSP diagnostic for binlog usage --- .../Semmle.Autobuild.CSharp/CSharpAutobuilder.cs | 14 ++++++++++++++ .../all-platforms/binlog/diagnostics.expected | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs b/csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs index 61487eb43858..36feaec47265 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs @@ -116,6 +116,20 @@ private BuildScript AddBuildlessStartedDiagnostic() markdownMessage: "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.", severity: DiagnosticMessage.TspSeverity.Note )); + + // For the time being we are adding an additional message regarding the binlog usage. In the future, we might want to remove the buildless messages altogether when the binlog option is specified. + if (actions.GetEnvironmentVariable(CSharpAutobuildOptions.ExtractorOptionBinlog) is not null) + { + AddDiagnostic(new DiagnosticMessage( + Options.Language, + "buildless/binlog", + "C# was extracted with the experimental 'binlog' option", + visibility: new DiagnosticMessage.TspVisibility(statusPage: true, cliSummaryTable: true, telemetry: true), + markdownMessage: "C# was extracted with the experimental 'binlog' option.", + severity: DiagnosticMessage.TspSeverity.Note + )); + } + return 0; }); } diff --git a/csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected b/csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected index 19390ed2af26..1a10ae9ded54 100644 --- a/csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected +++ b/csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected @@ -26,3 +26,17 @@ "telemetry": true } } +{ + "markdownMessage": "C# was extracted with the experimental 'binlog' option.", + "severity": "note", + "source": { + "extractorName": "csharp", + "id": "csharp/autobuilder/buildless/binlog", + "name": "C# was extracted with the experimental 'binlog' option" + }, + "visibility": { + "cliSummaryTable": true, + "statusPage": true, + "telemetry": true + } +}