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

This is correct, Tycho considers toolchain.xml only if it is explicitly
told to. Projects that do not specify useJDK=BREE will not be affected.

--
Regards,
Igor

On 12-09-25 9:22 AM, Laurent Goubet wrote:
This is what I feared. We are back to one of the questions I sneaked
into the first mail then :

If anyone has some input as to whether this "toolchains.xml" should be
provided for all jobs that would like to use it.

Currently, the Eclipse hudson instance launches all builds (at least,
those that use tycho) with the jdk 1.6. This does not satisfies the BREE
that we put in our plugins' MANIFEST.MF. Tycho's option to check the
BREE and use the proper JDK seems like the best choice. However, we
currently have no means to tell tycho to switch to anything other than
the default java when building from the eclipse hudson instance (apart
from the fragile workaround I spoke of in an earlier mail).

If I understand correctly, simply putting the toolchains.xml file in the
hudson user's home/.m2 will not affect any existing build? People that
wish to use this file will have to manually update their parent pom.xml
to specify the <useJDK>BREE</useJDK> compiler option? If so, it might be
nice for the webmasters to add the toolchains.xml file to the correct
location, I can raise a bugzilla for this if the answer to both
questions is "yes" (i.e. it will not impact any existing build) :).

Laurent

On 25/09/2012 15:00, Igor Fedorenko wrote:
You need to create toolchain.xml in ~/.m2 of the user that runs hudson
jobs, which likely means webmaster needs to do this.

--
Regards,
Igor

On 12-09-25 7:46 AM, Laurent Goubet wrote:
Igor,

The problem (I think) is that /my/ '~' directory is not what hudson will
search when I run the hudson job. Isn't the build run with the
'hudsonBuild' user? I've just tried to copy/paste the toolchains.xml
file attached to the bug you've linked to in my own ~/.m2 directory ...
but this resulted in the same failure as when I tried earlier with a
custom toolchains.xml. See the console here [1] or the error message :

Failed to execute goal
org.eclipse.tycho:tycho-compiler-plugin:0.14.1:compile
(default-compile) on project org.eclipse.emf.compare: useJDK = BREE
configured, but no toolchain of type 'jdk' with id 'J2SE-1.5' found.

Did you really manage to get this working when launched from the eclipse
hudson instance? If yes, could you point me to the configuration of your
job so that I can check if mine [2] has the necessary options set?

Alternatively, do you know if I can set my job to be verbose on the
tycho failures? I saw somewhere that tycho can report the path "where"
it looked for the toolchains.xml file, but I don't know how to specify
this switch to the hudson build.

Laurent

[1]
https://hudson.eclipse.org/hudson/view/Modeling/job/emf-compare-master/326/console

[2]
https://hudson.eclipse.org/hudson/view/Modeling/job/emf-compare-master/

On 25/09/2012 13:14, Igor Fedorenko wrote:
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

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




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

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




_______________________________________________
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