Skip to content

Use manual build mode for java-kotlin in codeql.yml #865

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

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

redsun82
Copy link

No description provided.

# Only scan the plugin directory as the rest of the code is just sample code
working-directory: plugin
run: |
./gradlew -p plugin --no-daemon --no-build-cache --console=plain --no-configuration-cache -x test -x check
Copy link
Owner

Choose a reason for hiding this comment

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

This won't inject the init script that the autobuilder uses though. Don't we want the init script to configure Gradle correctly?

Copy link
Author

@redsun82 redsun82 Apr 25, 2025

Choose a reason for hiding this comment

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

calling github/codeql-action/init changes the environment variables in a way that anything done in between it and the finalize action will be analyzed by CodeQL. Technically it uses LD_PRELOAD on Linux, and INSERT_DYLD_LIBRARIES on macOS. On windows there is another slightly different mechanism, and we do require running commands under a special runner. On macOS we may need a runner as well if the build is not wrapped into a non-system runner (so ./gradlew would work). On Linux it just works 🙂

Copy link
Owner

Choose a reason for hiding this comment

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

I added a bit more to the concerns I have with this solution here:

github/codeql#19374 (comment)

I'm willing to accept this solution for now, but I think long-term this is masking a larger problem and is leaving build speed on the ground because of how the build-cache is entirely disabled

Copy link
Author

Choose a reason for hiding this comment

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

ah, I see what you meant now, that's a gradle init script I wasn't aware of.

Copy link
Owner

Choose a reason for hiding this comment

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

I'll merge this for now, but I think the larger problem still remains regarding caching. Thanks for the help!

@JLLeitschuh JLLeitschuh added the skip news This PR does not require new changelog entry label Apr 25, 2025
@JLLeitschuh JLLeitschuh merged commit a1d111e into JLLeitschuh:chore/JLL/advanced_codeql Apr 29, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news This PR does not require new changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants