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

[WIP] Run tests against javac bits #3167

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

fbricon
Copy link
Contributor

@fbricon fbricon commented May 27, 2024

The idea is to run

mvn clean verify -Pjavac

But for some reason I run into:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.8:validate-classpath (default-validate-classpath) on project org.eclipse.jdt.ls.tests: Execution default-validate-classpath of goal org.eclipse.tycho:tycho-compiler-plugin:4.0.8:validate-classpath failed: org.osgi.framework.BundleException: Bundle org.eclipse.jdt.ls.tests cannot be resolved:org.eclipse.jdt.ls.tests [293]
[ERROR] Unresolved requirement: Require-Bundle: org.eclipse.jdt.core.javac

@akurtakov @mickaelistria what am I missing?

@fbricon fbricon force-pushed the javac-poc-tests branch 3 times, most recently from 046db5d to db2819f Compare May 27, 2024 22:36
@fbricon
Copy link
Contributor Author

fbricon commented May 27, 2024

I got the tests running in https://ci.eclipse.org/ls/job/jdt-ls-javac/

Comment on lines +8 to +11
Bundle-RequiredExecutionEnvironment: JavaSE-23
Import-Package: org.osgi.framework;version="1.3.0",
org.eclipse.jdt.internal.javac,
org.eclipse.jdt.internal.javac.dom
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of tweaking the MANIFEST.MF, you can consider adding the javac bundle as extraRequirement with target-platform-configuration block in the pom.xml. This bit of customization could also be encapsulated in the javac profile, so it can be easier to merge later.

pom.xml Outdated
<profile>
<id>javac</id>
<properties>
<tycho.testArgLine>--add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -DICompilationUnitResolver=org.eclipse.jdt.core.dom.JavacCompilationUnitResolver -DCompilationUnit.DOM_BASED_OPERATIONS=true -DAbstractImageBuilder.compiler=org.eclipse.jdt.internal.javac.JavacCompiler</tycho.testArgLine>
Copy link
Contributor

Choose a reason for hiding this comment

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

This now also needs

--add-opens jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets.snippet=ALL-UNNAMED --add-opens jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets=ALL-UNNAMED

Comment on lines +24 to +43
<compilerArgs combine.self="override">
<arg>--add-exports</arg>
<arg>java.base/java.lang=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
</compilerArgs>
Copy link
Contributor

Choose a reason for hiding this comment

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

This might possibly be removed

Signed-off-by: Fred Bricon <fbricon@gmail.com>
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Signed-off-by: Fred Bricon <fbricon@gmail.com>
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