codeql-action: Module Gradle/Java/CodeQL build fails due to "Unknown javac parameter: --add-opens"
I have Gradle Java projects that I’d love to use CodeQL to analyse. However, if I enable CodeQL either in its own workflow or integrated into the main build workflow, then the build fails with error:
Error: Exception in thread "main" Unknown javac parameter: --add-opens
at com.semmle.extractor.java.args.JavaExtractorArgs.parse(JavaExtractorArgs.java:331)
at com.semmle.extractor.java.JavaExtractor.<init>(JavaExtractor.java:187)
at com.semmle.extractor.java.JavaExtractor.main(JavaExtractor.java:482)
The --add-opens
command line option is being introduced by the org.javamodularity.moduleplugin Gradle plugin, which the project is using as its using Java’s module system (a.k.a. Jigsaw).
However, its not javac that’s complaining about the option, but com.semmle.extractor.java.args.JavaExtractorArgs.parse
. The version of java the project is using supports the option. Looks like this could be an issue with the LGTM code…?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (9 by maintainers)
Commits related to this issue
- Use custom build steps Use custom build steps that do NOT build the test code, (which requires a fix to https://github.com/github/codeql-action/issues/1040 to work) — committed to creek-service/creek-base by big-andy-coates 2 years ago
- Try enabling cql on full build ...now that the fix for https://github.com/github/codeql-action/issues/1040 has been released. — committed to creek-service/creek-test by big-andy-coates 2 years ago
- Try enabling cql on full build (#38) ...now that the fix for https://github.com/github/codeql-action/issues/1040 has been released. — committed to creek-service/creek-test by big-andy-coates 2 years ago
- Add `tools: latest` to ensure fix present As per https://github.com/github/codeql-action/issues/1040#issuecomment-1120055880, temporarily add the `tools: latest` line to the config to ensure codeQl v... — committed to creek-service/creek-test by big-andy-coates 2 years ago
- Add `tools: latest` to ensure fix present (#46) As per https://github.com/github/codeql-action/issues/1040#issuecomment-1120055880, temporarily add the `tools: latest` line to the config to ensure co... — committed to creek-service/creek-test by big-andy-coates 2 years ago
I’ll also note that even with the above, you won’t get 2.9.1 just yet because we haven’t yet bumped
latest
to point to 2.9.1 as it is very new. That’s due to happen on Monday, or Tuesday at the latest, assuming we don’t uncover any issues with it.It typically around two weeks for new CodeQL releases to make it into the cache we use to avoid downloading a release every time a workflow is run. You could add
tools: latest
to the parameters passed to theinit
step of your workflow if you would like to make sure it uses 2.9.1 now. This will add around a minute to your workflow’s duration but will ensure you always have the latest version without the couple of weeks delay for it to get into the cache.Good point. Let’s keep this open until a fix is shipped.