Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] hudson, tycho - Compiling against java 1.5

toolchain.xml must be available on slave in ~/.m2 directory. You can
find sample toolchain.xml and libraries that correspond to restricted
execution environments attached to bug 386649 [1]. Beware that there is
currently an outstanding issue with IBM JDKs tracked as bug 389856 [2]

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=386649
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=389856

--
Regards,
Igor

On 12-09-25 7:05 AM, Laurent Goubet wrote:
Hi all,

One of our plugins cannot be compiled against java 1.6 and has to be
compiled with the javac of jdk 1.5. In short, one of the jdk classes has
changed the signature of one of its methods' generics between the two
versions (see version 1.5 [1] and version 1.6 [2]). AFAIK, the
incompatibility is only at source level and the compiled classes should
work with both the 1.5 and 1.6 runtimes. The problem, however, is "how"
can I force tycho to use the jdk 1.5 compiler when run from the Eclipse
hudson instance?

I read some documentation, most notably
http://www.eclipse.org/tycho/sitedocs/tycho-compiler-plugin/compile-mojo.html
that describes some potentially interesting options. "source" and
"target" are not enough in my case. Telling javac that my sources are in
1.5 is not enough. "fork" seems out of the question when using
tycho-compiler-plugin from version 0.14.1. My builds fail in
"compileOutOfProcess is not supported" which rules out all options that
require forking (compilerVersion, executable, ... and maybe others).

The "useJDK" option was promising... but for the life of me I could not
understand how to provide the accurate "toolchains.xml" to my builds.
Should it be located in the "<home>/.m2" of the hudsonBuild user? A way
seems to exist since I found this option used in one of the eclipse
repositories. See
http://git.eclipse.org/c/cbi/platform-aggregator.git/tree/eclipse-parent/pom.xml?h=JunoSR1_RC1_R4
... and the line just above the use of this option :

|TODO provide CBI-specific wiki that explains how to setup BREE libraries and toolchain.xml|

Yup, the wiki would have helped :).

The only remaining option I could find was to use  the workaround
outlined by Bernd on the forum :
http://www.eclipse.org/forums/index.php/t/201042/ .

     <pluginManagement>
       <plugins>
         <plugin>
           <groupId>org.eclipse.tycho</groupId>
           <artifactId>tycho-compiler-plugin</artifactId>
           <version>${tycho-version}</version>
           <configuration>
             <compilerId>jdt</compilerId>
             <compilerArguments>
<bootclasspath>/shared/common/jdk-1.5.0-22.x86_64/jre/lib/rt.jar</bootclasspath>
             </compilerArguments>
           </configuration>
         </plugin>
     </pluginManagement>

But that seems like a very fragile work around. Not to mention that now,
my tests fail because of the tycho-surefire-plugin
(https://hudson.eclipse.org/hudson/view/Modeling/job/emf-compare-master/322/console)...

If anyone here has any experience with tying tycho/hudson builds to a
specific jdk, any workaround as to how we can provide a toolchains.xml
for our build, or simply some input as to whether this "toolchains.xml"
should be provided for all jobs that would like to use it (it seems to
me like using the BREE of our plugins should be the "default" way of
building our plugins instead of using the jdk 6...), I'd really
appreciate the help :).

Laurent

[1]
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ExecutorService.html#invokeAll%28java.util.Collection%29
[2]
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html#invokeAll%28java.util.Collection%29


_______________________________________________
cross-project-issues-dev mailing list
cross-project-issues-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cross-project-issues-dev



Back to the top