Skip to content
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

Plugin Verifier should verify against the bundled JBR #1611

Open
JojOatXGME opened this issue May 3, 2024 · 1 comment
Open

Plugin Verifier should verify against the bundled JBR #1611

JojOatXGME opened this issue May 3, 2024 · 1 comment
Assignees

Comments

@JojOatXGME
Copy link

Describe the need of your request

When the Plugin Verifier verifies the compatibility of a plugin with a given IDE, it should also verify the compatibility of the plugin against the JBR that comes with the given IDE.

Proposed solution

Remove the -runtime-dir command line argument given to the plugin verifier.

From the README.md of the Plugin Verifier:

  • -runtime-dir (-r)

    The path to the directory containing Java runtime JAR files (JDK).
    If not specified, the embedded JDK from the provided IDE parameter will be used.
    If the IDE does not contain an embedded JDK, the JAVA_HOME environment variable will be used to resolve the Java runtime.

As far as I am aware, the IDE distributions downloaded for the Plugin Verifier should usually have a bundled JBR. Also note that in contrast to all the other usages of RuntimeAware, the JBR is not actually used as a runtime in this context. The PluginVerifier uses the JBR directory to resolve classes used by the plugin, so it can verify whether the used classes, methods, and fields exist in the given IDE/JBR.

Alternatives you've considered

It might make sense to provide an explicit option to use a different JBR as the one bundled with the IDE. I am also not sure if we can really assume that all IDEs downloaded for the Plugin Verifier have a bundled JBR. So, it might also make sense to test whether they have one, and fallback to the JBR used by the other tasks.

Additional context

No response

@hsz
Copy link
Member

hsz commented May 30, 2024

Those are valid points — passing the runtimeDirectory to Plugin Verifier makes it use the JBR bundled with the IntelliJ Platform you use for building the plugin, not the one bundled within the IDE distribution picked for the verification.

Still, the case when the picked IDE has no JBR bundled is possible.

@novotnyr Can we introduce a -fallback-runtime-dir so we could use provided Java Runtime when IDE has no JBR present?

As I see, currently we use provided Runtime, then check for the bundled one:

https://github.com/JetBrains/intellij-plugin-verifier/blob/9cfbae0088934c03b40253b6000c7ce6c521e3cc/intellij-plugin-verifier/verifier-intellij/src/main/java/com/jetbrains/pluginverifier/jdk/JdkDescriptorProviders.kt#L25-L28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants