Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] Build fails on Tycho 2.x (was Re: Build is failing when switching to Java 11)

Hi

I am seeing similar problems that at first sight seemed magical; Java works interactively but not on Jenkins.

I was doing a six month catchup so moving from

Java 8 to Java 11
Eclipse 4.16 to 4.18
Tycho 1.4.0 to 2.1.0
Maven 3.0 to 3.6.3
vintage to modern Maven tool versions

After permuting the changes, I eventually found that the only significant and solid difference between old-working and new-broken was the Tycho version.

Somehow Tycho 2.1.0 disrupts the Java compiler activation so that the non-null flow analysis forgets that something is not-null within an if guard or after an assert. But probably not universally since I only get a few rather than hundreds of errors as a result. Possibly something magic has happened to the external annotations path. But ...

https://ci.eclipse.org/ocl/job/ocl-branch-tests/228/console shows the two spurious compiler errors.

Tycho 1.7.0 seems ok.

Tycho 2.0.0 seems to have an intermediate condition whereby many, often bogus, non-check warnings are reported as errors breaking the build.

It would seem that the compiler invocation is somehow broken. If someone can suggest some debug settings to cause the compiler invocation to be logged verbosely, it may prove quite easy to find the problem.

For now, Tycho 2.x is not fit for Eclipse OCL build purposes.

    Regards

        Ed Willink


On 18/11/2020 09:59, Aleksandar Kurtakov wrote:
Can you share a reproducer? Also please make sure you use latest Tycho version in your build as there have been a number of fixes improving work with modular JVM.

On Wed, Nov 18, 2020 at 7:01 AM Kenneth Keefe <kjkeefe@xxxxxxxxxxxx> wrote:
I am working on upgrading my e4 RCP application to Java 11. All the plugins and features compile just fine in the IDE and I can export the product and run it. I'm trying to get the Tycho build working again with the new java version. Unfortunately, I'm getting some strange errors that I can't make sense of. It is almost as if there are two versions of java be used and they are clashing. 

Any suggestions for how to debug these errors?

Thanks,
Ken


[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.1.0:compile (default-compile) on project com.example.core.util: Compilation failure: Compilation failure:
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/saving/OldSaveFileReader.java:[1559]
[ERROR] TheWriteMethod = Current.getClass().getMethod("readObject", ClassParameterArray);
[ERROR]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/SWTResourceManager.java:[162]
[ERROR] image = getImage(clazz.getResourceAsStream(path));
[ERROR]        ^^^^^^^^
[ERROR] The method getImage(java.io.InputStream) in the type SWTResourceManager is not applicable for the arguments (java.io.InputStream)
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[370]
[ERROR] Method getBundleMethod = BundleContextClass.getMethod("getBundle", new Class[0]); //$NON-NLS-1$
[ERROR]                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[374]
[ERROR] Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class});
[ERROR]                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Constructor<capture#8-of ?> to Constructor<?>
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[379]
[ERROR] Method findMethod = PlatformClass.getMethod("find", new Class[]{BundleClass, IPathClass}); //$NON-NLS-1$
[ERROR]                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[391]
[ERROR] Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class});
[ERROR]                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Constructor<capture#19-of ?> to Constructor<?>
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/ResourceManager.java:[395]
[ERROR] Method findMethod = PluginClass.getMethod("find", new Class[]{IPathClass}); //$NON-NLS-1$
[ERROR]                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] /Users/ken/gitlab/mainExample/bundles/com.example.core.util/src/com/example/core/util/saving/OldSaveFileWriter.java:[825]
[ERROR] TheWriteMethod = Current.getClass().getMethod("writeObject", ClassParameterArray);
[ERROR]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from Method to Method
[ERROR] 8 problems (8 errors)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :com.example.core.util
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user


--
Alexander Kurtakov
Red Hat Eclipse Team

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user

Virus-free. www.avast.com

Back to the top