Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Conversation

@sauyon
Copy link
Contributor

@sauyon sauyon commented Sep 7, 2020

I'd forgotten quite how long dist-compares take, especially since the kubernetes dependencies aren't being dropped (because codeql doesn't support the lgtm.yml files).

I've put this up for review anyway, since that seemed like a good idea.

@sauyon sauyon changed the title Blejd Build tracing Sep 7, 2020
Copy link
Contributor

@max-schaefer max-schaefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for persisting with this! It's pleasantly simple, I only have a couple of fairly minor questions and suggestions.

@@ -0,0 +1,2 @@
lgtm,codescanning
* The extractor can now be used for build tracing, allowing users to supply a build command when creating databases with the CodeQL CLI or via configuration. It currently only supports projects that use Go modules.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should mention that build tracing is opt-in, but we can add that once we have decided the exact details of how the opting-in works.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sauyon noting this is still to do. Do we have a firm answer on how a user would opt in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that that was likely just the discussion of variable naming.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, in that case mention how it's done in the change-note

Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like all my comments apply to commits that are later improved (consider squashing)

} else if !mimic && args[i] == "--help" {
usage()
os.Exit(0)
} else if args[i] == "--mimic" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For regularity we should accept --mimic=

}
}
} else {
log.Fatalf("Invalid --mimic: no compiler specified")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give an example in the error message, like --mimic must take an argument, e.g. --mimic go

i++
compiler := args[i]
log.Printf("Compiler: %s", compiler)
if i+1 < len(args) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth printing a warning if this isn't true, since the command argument is required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except this one looks real

log.Printf("Intercepting build")
// skip `-o output` and `i`, if applicable
for i+1 < len(args) {
if args[i+1] == "-o" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're skipping these we should skip them wherever they occur in the arg list, not break after the first good argument.

@sauyon sauyon force-pushed the tracing branch 2 times, most recently from b3744ec to 9aab773 Compare September 10, 2020 07:50
@sauyon
Copy link
Contributor Author

sauyon commented Sep 10, 2020

I've applied all the relevant changes and tried to squash to a sensible history.

Performance evaluation was very wobbly. I'm trying again, but may have to throw out the idea of performance testing.

I should probably test on Windows again, all things considered...

@max-schaefer
Copy link
Contributor

As discussed elsewhere, could we rename the environment variable for turning on build tracing from CODEQL_EXTRACTOR_GO_TRACE to CODEQL_EXTRACTOR_GO_BUILD_TRACING for clarity?

@sauyon
Copy link
Contributor Author

sauyon commented Oct 14, 2020

The experiments I ran did nothing to improve the Kubernetes situation, so I think merging this now is a sensible thing to do.

Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highlighted some of Max's outstanding comments, plus one of mine noted below, otherwise as you say let's get this merged. Could you write an issue brain-dumping what you know of the Kubernetes situation?

Co-authored-by: Chris Smowton <smowton@github.com>
@sauyon
Copy link
Contributor Author

sauyon commented Oct 14, 2020

I believe I have now actually addressed all comments.

Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good! @max-schaefer are you happy to drop your block on this?

@max-schaefer
Copy link
Contributor

Yep, let's give this a try!

@smowton
Copy link
Contributor

smowton commented Oct 15, 2020

@sauyon please link the issue here when you've got a writeup

@smowton smowton merged commit 2b07e6a into github:main Oct 15, 2020
@sauyon sauyon deleted the tracing branch November 9, 2020 10:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants