Skip to content

Conversation

@antonsviridov-src
Copy link
Contributor

@antonsviridov-src antonsviridov-src commented Aug 1, 2024

A canonical usage for this is passing --add-opens flags to the launcher of javac to make sure annotation processors work.

To pass these arguments to the launcher, they have to be perfixed with -J – but arguments like this cannot be passed through the argfile that we use for javacOptions (see https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#command-line-argument-files) so we need to pass them to the command itself.

For that purpose, we add a jvmOptions field to scip-java.json config – these options will have -J added to them and passed to the javac command.

The test to verify this behaviour relies on an old version of lombok that requires these options

Additionally, a hidden option --strict-compilation is added to the CLI, to prevent error recovery: sometimes scip-java can just ignore javac errors and produce semanticdb artifacts regardless. This complicates testing, so I need an escape hatch).

Test plan

  • New test to ScipBuildToolSuite

@antonsviridov-src antonsviridov-src changed the title WIP: Allow passing JVM args to javac bypassing the argsfile Allow passing JVM argsto javac in ScipBuildTool Aug 1, 2024
Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

This makes a lot of sense. LGTM 👍🏻

@antonsviridov-src antonsviridov-src merged commit b8c11c4 into main Aug 1, 2024
@antonsviridov-src antonsviridov-src deleted the graph-788-scip-java-and-jdk-17-issue branch August 1, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants