Summary: | Gluegen fails to build from source using JDK8 EA b119 | ||
---|---|---|---|
Product: | [JogAmp] Gluegen | Reporter: | Xerxes Rånby <xerxes> |
Component: | core | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | --- | ||
Version: | 2 | ||
Hardware: | All | ||
OS: | all | ||
Type: | --- | SCM Refs: |
1e53a38eb06aa8ff50660fdf7bd8570b27f27c56
|
Workaround: | TRUE | ||
Attachments: | jdk-8-ea-bin-b119-linux-i586-05_dec_2013.gluegen.2.1.3.build.log |
Description
Xerxes Rånby
2013-12-13 09:50:18 CET
A quick analysis reveals that the new annotation tool does not tolerate missing dependencies of the processed java file anymore. I.e. we run the annotation tool on a java file w/ dependencies which are not yet generated and hence not resolvable in the classpath. This has worked w/ Java7. W/ Java6 and Java7, the annotation tool produced the new artifacts despite the warning/error messages of unresolved symbols. Then a later compilation process of ours produces the class files. We will adapt to this behavioral change. Bug 923: Remove dependency of CStruct annotation processor _generation_ and generated_class_user due to Java8 issues. Java8's annotation processor as embedded within javac does not allow referencing not-yet existing generated classes in a class source code which will produce these generated classes via the annotation process. Example: +++ import com.jogamp.gluegen.structgen.CStruct; public class Lala { @CStruct(name="RenderingConfig", header="TestStruct01.h") public RenderingConfig config; } +++ Above example illustrates that the type 'RenderingConfig' does not exist at time of processing the annotation. The type will be created via the annotation process itself. Even though we pass '-proc:only', i.e. skip java compilation, Java8's annotation processing via javac fails in such case. We see this as a bug within javac's annotation processing itself! +++ This workaround splits the annotation process and using the class as generated by the former. To allow this to work, CStruct receives a new field 'jname' allowing to enforce the java-name of the structure using a dummy field type like boolean. @CStruct(name="RenderingConfig", jname="RenderingConfig", header="TestStruct01.h") public boolean dummy; Further more CStruct can be annotated on the package, i.e. 'package-info.java', avoiding the dependency problem altogether. To support multiple header files and types, 'CStructs' has been introduced using an array of 'CStruct'. @CStructs({@CStruct(name="RenderingConfig", header="TestStruct01.h"), @CStruct(name="Pixel", header="TestStruct02.h")}) package com.jogamp.gluegen.test.junit.structgen; Tests: - Build w/ Java7 and Java8 - Validated 'major version 50' (Java 6) class files (OK) |