Uh oh!
There was an error while loading. Please reload this page.
Check CODEQL_EXTRACTOR_GO_BUILD_TRACING and treat Go as a traced language - #222
Conversation
smowton
commented
Oct 21, 2020
The Go PR linked above has been merged |
Uh oh!
There was an error while loading. Please reload this page.
robertbrignull
commented
Oct 22, 2020
@smowton, @max-schaefer, it'll have to wait until we have a dist to test with, but how would I test that this is working? Do I just enable the env var and check that things still work as before? Do you have a demo project that could be built? |
max-schaefer
commented
Oct 22, 2020
@sauyon is probably best placed to answer that question. Manual testing should be fairly straightforward: you can tell from the log whether it did build tracing or not. Automated testing could be a little trickier. |
37788dd to
aada19fCompareCo-authored-by: Max Schaefer <54907921+max-schaefer@users.noreply.github.com>
aada19f to
2e550bbComparerobertbrignull
commented
Oct 30, 2020
This isn't working unfortunately. Were the Go tracing changes in CodeQL CLI v2.3.2? |
smowton
commented
Oct 30, 2020
Yes. Could you give an example of how you're trying to run it? |
robertbrignull
commented
Nov 2, 2020
There's an exmaple in the intergration test I add in this PR: https://github.com/github/codeql-action/pull/222/files#diff-3a1fea4e5bb8f47ffb16d851debf4b504b20e782df9dc03336b120d14126147d |
sauyon
commented
Nov 2, 2020
This seems to be an error originating in Javascript ( |
robertbrignull
commented
Nov 2, 2020
The (slightly hacky) way that the codeql-action deals with tracing builds is it runs I think what's happening here that's causing the failure is that the |
sauyon
commented
Nov 2, 2020
We definitely don't unset any variables intentionally. If a traced command is passed the autobuilder is never called anyway, right? Is there something we need to add to the tracer configuration? |
smowton
commented
Nov 3, 2020
I got to the bottom of this -- the problem is your action is still using CodeQL 2.3.0: I confirmed that the needed ODASA env variable is set by CodeQL 2.3.2 but not 2.3.0. |
robertbrignull
commented
Nov 4, 2020
Ah right, I know why this isn't working even though the latest released bundle should be for 2.3.2. It's because the bundle is also included in the actions environment as a performance improvement, and that one is still at 2.3.0 so it's using that in preference instead of downloading a new one. I'll look at working around this. |
robertbrignull
commented
Nov 4, 2020
On second thought, even if I do work around it here, we still can't release this change until 2.3.2 has reached https://github.com/actions/virtual-environments/ as otherwise it'll break for other users. I think this PR has to wait until the next actions environment update happens. |
robertbrignull
commented
Nov 13, 2020
So CodeQL 2.3.2 is now live, so I've updated, but unfortunately it still fails. It gets further this time and now fails because it says "no code was seen during the build". I did a test at https://github.com/github/codeql-action/runs/1395477783?check_suite_focus=true where I insert a call to Is my call to |
smowton
commented
Nov 13, 2020
I note during the compile command the printed environment has an unresolved variable in the LD_PRELOAD variable ( |
smowton
commented
Nov 13, 2020
Ah also, even if that is ok, looks like when our compiler wrapper is called it only handles Do you know where the extractor's logs are sent to when it's run as a compiler wrapper in this way? If this is happening you should see log entries like "Non-build command '...'; skipping" |
robertbrignull
commented
Nov 13, 2020
It's a bit mad but I think that's how it's meant to work, with the explicit unesolved
I think this is the real issue. I'll try to update it. I wasn't sure the best way to do a minimal Go program. Something else, I note in the CodeQL output from Should this be changed when Go build tracing is enabled? |
smowton
commented
Nov 13, 2020
I thought it might be that, just checking on the off chance a On the last question I'll defer to @sauyon |
robertbrignull
commented
Nov 13, 2020
Changing to |
chrisgavin
left a comment
There was a problem hiding this comment.
😆 I think I spent more time reading the discussion than reading the code.
Looks pretty simple. Thanks for the test!
I think this should be all that's necessary to support
CODEQL_EXTRACTOR_GO_BUILD_TRACING.Shouldn't do anything yet. When github/codeql-go#324 is merged and we have a CodeQL bundle containing it then we can test this.
Merge / deployment checklist