-
Couldn't load subscription status.
- Fork 410
Check CODEQL_EXTRACTOR_GO_BUILD_TRACING and treat Go as a traced language #222
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
Conversation
|
The Go PR linked above has been merged |
|
@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? |
|
@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
aada19f
Compare
Co-authored-by: Max Schaefer <54907921+max-schaefer@users.noreply.github.com>
aada19f to
2e550bb
Compare
|
This isn't working unfortunately. Were the Go tracing changes in CodeQL CLI v2.3.2? |
|
Yes. Could you give an example of how you're trying to run it? |
There's an exmaple in the intergration test I add in this PR: https://github.com/github/codeql-action/pull/222/files#diff-3a1fea4e5bb8f47ffb16d851debf4b504b20e782df9dc03336b120d14126147d |
|
This seems to be an error originating in Javascript ( |
|
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 |
|
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? |
|
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. |
|
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. |
|
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. |
|
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 |
|
I note during the compile command the printed environment has an unresolved variable in the LD_PRELOAD variable ( |
|
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" |
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? |
|
I thought it might be that, just checking on the off chance a On the last question I'll defer to @sauyon |
|
Changing to |
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.
😆 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