-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C# POC: Add binary log based extraction #16581
Conversation
catch (Exception ex) // lgtm[cs/catch-of-all-exceptions] | ||
{ | ||
logger.Log(Severity.Error, " Unhandled exception: {0}", ex); | ||
return ExitCode.Errors; | ||
} |
Check notice
Code scanning / CodeQL
Generic catch clause Note
public BinaryLogExtractor(string cwd, string[] args, string outputPath, ILogger logger, PathTransformer pathTransformer, CommonOptions options) | ||
: base(cwd, args, outputPath, [], logger, pathTransformer) | ||
{ | ||
Mode = ExtractorMode.BinaryLog; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
Mode = ExtractorMode.BinaryLog; | ||
if (options.QlTest) | ||
{ | ||
Mode |= ExtractorMode.QlTest; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
@@ -115,29 +185,28 @@ function RegisterExtractorPack(id) | |||
end | |||
end | |||
if match then | |||
local injections = { '-p:UseSharedCompilation=false', '-p:EmitCompilerGeneratedFiles=true' } | |||
-- TODO: Add real temporary file name | |||
local injections = { '-bl:codeql_' .. RandomString(15) .. '.binlog' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing -bl
to dotnet run
doesn't seem to do anything, but it makes the extractor fail due to the non existent binlog file.
DCA test results don't look good. We're losing a lot of alerts. |
@@ -1,10 +1,28 @@ | |||
function RegisterExtractorPack(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another approach would be running the database creation without any command, so running the autobuilder, but with a new extractor option specifying the binlog path. And then the autobuilder could start the extractor with the given path.
if (builder.Options.Binlog is string binlog) | ||
{ | ||
return BuildScript.Create(_ => Semmle.Extraction.CSharp.Driver.Main(["--binlog", binlog])); | ||
} | ||
else | ||
{ | ||
return BuildScript.Create(_ => Semmle.Extraction.CSharp.Standalone.Program.Main([])); | ||
} |
Check notice
Code scanning / CodeQL
Missed ternary opportunity Note
No description provided.