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

[J11] Prepare Java 11 Support #1182

Open
cdietrich opened this Issue Mar 23, 2018 · 24 comments

Comments

Projects
None yet
4 participants
@cdietrich
Member

cdietrich commented Mar 23, 2018

Xtext should not "explode" with Java 11

  • JavaVersion constant and its from and to conversions
    Wizard
  • new Maven/Gradle Dependencies to JDT we consume needed
  • new ASM needed? (https://dev.eclipse.org/ipzilla/show_bug.cgi?id=17016) #1325 ☑️
  • new Tycho Version needed? yes we need tycho 1.3 #1322
  • Gradle? gradle 4.10.2 should be fine. ☑️
  • Maven?
  • new Guava?
  • new Guice?
  • Function wise (do not explode)

@cdietrich cdietrich added this to the Release_2.15 milestone Mar 23, 2018

@cdietrich

This comment has been minimized.

Member

cdietrich commented Mar 27, 2018

@cdietrich

This comment has been minimized.

@cdietrich cdietrich modified the milestones: Release_2.15, Release_2.16 Aug 16, 2018

@cdietrich

This comment has been minimized.

Member

cdietrich commented Aug 16, 2018

wont ship this with 2.15 so moved to 2.16

@jpaw

This comment has been minimized.

jpaw commented Sep 1, 2018

An upgrade of guice will be required. As a quick test, I changed the guice release from 3.0 to 4.2.0. In xtext-core, then 12 tests fail (but that's less than 1% of all tests :-)).
In xtext-xtend, I also had to upgrade org.eclipse.core.runtime in order to avoid some signature mismatch exception, but afterwards, the resulting xtend-maven-plugin does not show the warnings about illegal reflective access any more when running with Java 10. Java 11 still does not work, so there's more to update, I will keep testing.
(Btw, I used the "no_aop" classifier for guice, this did not make any difference related to the number of failing tests. guice still bundles / repackages cglib and asm, and 4.2.0 still does not use the most recent ones, but with the classifiers "no_aop" and "classes" versions without that are available as well.)

@cdietrich

This comment has been minimized.

Member

cdietrich commented Sep 1, 2018

how did you deal with guice 4.x needing a newer guava? see eclipse/xtext-core#393

@cdietrich

This comment has been minimized.

Member

cdietrich commented Sep 1, 2018

@szarnekow do you know of any ussages of the guice aop part? do you remember which version of guice we use? https://dev.eclipse.org/ipzilla/show_bug.cgi?id=6118 reads like we use the non aop variant at lease eclipse/manifest wise

@jpaw

This comment has been minimized.

jpaw commented Sep 1, 2018

I did not get any exception of the type described in eclipse/xtext-core#393.
Related to the classifiers, I got the information from this discussion: google/guice#1198

@cdietrich

This comment has been minimized.

Member

cdietrich commented Sep 1, 2018

Another thing I don’t know is that such a change would mean for (binary) compatibility and if it would require a Xtext 3.0 @svenefftinge can you share your knowledge with that

@cdietrich

This comment has been minimized.

Member

cdietrich commented Sep 3, 2018

@jpaw did you investigate if this can be done without a guice/guava bump? for java 9 and 10 it was possible. or did you do the bump to get rid of the reflection warnings?

@svenefftinge

This comment has been minimized.

Contributor

svenefftinge commented Sep 3, 2018

We should not bump the major version. Also see discussion here: https://dev.eclipse.org/mhonarc/lists/modeling-pmc/msg04475.html

@jpaw

This comment has been minimized.

jpaw commented Sep 3, 2018

Related to the version bump of guava:
guice used 19.0 until very recently, in commits eface22... (just before the 4.2.0 tag) and in 289073...
apparently mainly to be able to use a newer version of the truth test library (that upgrade was done after the 4.2.0 tag). This would allow the version range [19.0, 20.0 and 22.0) which should work for xtext as well as guice. I rebuilt guice 4.2.0, but with a guava 20.0 dependency, and same results (20.0 is the last guava release which offers Java 6 compatibility).

Related to guice: xtext currently uses 3.0, which does not yet offer the no_aop version. guice 3.x is officially not even compatible with Java 8 (guice 4.0 ff are), so I doubt it will work with Java 11.

With my test builds of the xtext / xtend plugins, I'm currently stuck with "ResourceNotLoaded" or
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.xtext.common.types.access.TypeResource$CannotLoadTypeResourceException: java.lang.UnsupportedOperationException at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException (ResourceSetImpl.java:319) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper (ResourceSetImpl.java:278) at org.eclipse.xtext.resource.XtextResourceSet.getResource (XtextResourceSet.java:265)
I will retest this with emf 2.15.0 as soon as that has been released (current test used emf 2.12.0).

@cdietrich

This comment has been minimized.

Member

cdietrich commented Sep 3, 2018

the current guice (the one consumved via orbit has aop switched off) so you are taking about the maven/gradle dependency?
it was working with java 9 and 10. the question: are we talking about the xtext built itself or projects using xtext?

@jpaw

This comment has been minimized.

jpaw commented Sep 3, 2018

I'm currently mainly interested in using xtext, that is, invoking xtext-maven-plugin and xtend-maven-plugin from a maven build job which is executed by JDK 11.
Of course the fallback would be to run the build with Java 8 and to only use Java 11 at runtime, but that would restrict using Java 9/10/11 features to be used in pure Java projects only.

@cdietrich

This comment has been minimized.

Member

cdietrich commented Sep 3, 2018

I would have expected that would have worked by simply bumping the jdt version (not out yet) and introducing a new entry in the javaversion enum

@cdietrich

This comment has been minimized.

Member

cdietrich commented Oct 9, 2018

we require asm7 and the usage of OpCodes.ASM7 to get this running

@cdietrich

This comment has been minimized.

Member

cdietrich commented Oct 12, 2018

Address javax.annotation.Generated

@cdietrich

This comment has been minimized.

Member

cdietrich commented Oct 25, 2018

we should consider replacing the 3 single jdt plugins we consume from maven with the ecj jar (needs deeper investigation, e.g. how it relates to platform jars)
tycho does the same eclipse/tycho@8368ab9

@chrswk

This comment has been minimized.

chrswk commented Oct 26, 2018

So Java 11 support is planned for 2.16.0, correct? Do you have any idea about the schedule?

@cdietrich

This comment has been minimized.

Member

cdietrich commented Oct 26, 2018

2.16 is planned for 2018-12. We are still lining up for

  • ASM 7 final at maven and eclipse orbit
  • Tycho 1.3
  • Maven Consumable Artifacts for JDT
@chrswk

This comment has been minimized.

chrswk commented Oct 26, 2018

Great, thanks for the information! 👍

cdietrich added a commit to eclipse/xtext-core that referenced this issue Oct 27, 2018

[eclipse/xtext#1182] switch to ecj
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>

cdietrich added a commit to eclipse/xtext-core that referenced this issue Oct 27, 2018

[eclipse/xtext#1182] switch to ecj
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>

cdietrich added a commit to eclipse/xtext-extras that referenced this issue Oct 27, 2018

[eclipse/xtext#1182] switch to ecj
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>

cdietrich added a commit to eclipse/xtext-xtend that referenced this issue Oct 27, 2018

[eclipse/xtext#1182] switch to ecj
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>

cdietrich added a commit to eclipse/xtext-extras that referenced this issue Oct 27, 2018

[eclipse/xtext#1182] switch to ecj
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
@cdietrich

This comment has been minimized.

Member

cdietrich commented Oct 27, 2018

emf.codegen.ecore needs org.eclipse.jdt.core.formatter.CodeFormatter which is not part of ecj

https://repo.eclipse.org/content/repositories/eclipse-staging/org/eclipse/jdt/org.eclipse.jdt.core/ does not contains compiler tool

created https://bugs.eclipse.org/bugs/show_bug.cgi?id=540530

@cdietrich

This comment has been minimized.

Member

cdietrich commented Nov 2, 2018

we need to adress the removal of javax.annotation in tycho.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=539038
adding the following to mydsl.tests

<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<configuration>
					<dependency-resolution>
						<extraRequirements>
							<!-- to get the org.eclipse.osgi.compatibility.state plugin
							if the target platform is Luna or later.
							(backward compatible with kepler and previous versions)
							see https://bugs.eclipse.org/bugs/show_bug.cgi?id=492149 -->
							<requirement>
								<type>eclipse-feature</type>
								<id>org.eclipse.rcp</id>
								<versionRange>0.0.0</versionRange>
							</requirement>
						</extraRequirements>
					</dependency-resolution>
				</configuration>
			</plugin>

seems to help

@cdietrich

This comment has been minimized.

Member

cdietrich commented Nov 2, 2018

plus we might need to change the wizard to activate the modules depending on execution, not the selected java version to be able to build with java 11 against java 8

	<properties>
		<tycho.testArgLine>--add-modules=ALL-SYSTEM</tycho.testArgLine>
	</properties>

cdietrich added a commit to eclipse/xtext-core that referenced this issue Nov 6, 2018

[eclipse/xtext#1182] fixed tests with java 11 agains java 8 target
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>

cdietrich added a commit to eclipse/xtext-core that referenced this issue Nov 6, 2018

Merge pull request #934 from eclipse/cdTestJava11
[eclipse/xtext#1182] fixed tests with java 11 agains java 8 target
@cdietrich

This comment has been minimized.

Member

cdietrich commented Nov 20, 2018

Moved to 2.17 since there is no maven consumable jdt artifacts available

@cdietrich cdietrich modified the milestones: Release_2.16, Release_2.17 Nov 20, 2018

cdietrich added a commit to eclipse/xtext-core that referenced this issue Dec 18, 2018

[eclipse/xtext#1182] added support for java 11 as target
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>

cdietrich added a commit to eclipse/xtext-eclipse that referenced this issue Dec 18, 2018

[eclipse/xtext#1182] added support for java 11 as target
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>

cdietrich added a commit to eclipse/xtext-maven that referenced this issue Dec 18, 2018

[eclipse/xtext#1182] added support for java 11 as target
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment