Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 84914 - Bootstrap build
Summary: Bootstrap build
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Releng (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Kim Moir CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-10 12:06 EST by Andrew Overholt CLA
Modified: 2005-04-15 16:03 EDT (History)
1 user (show)

See Also:


Attachments
patch to build.xml to build jdtcore.jar and jdtCompilerAdapter.jar (1.84 KB, patch)
2005-02-10 12:08 EST, Andrew Overholt CLA
no flags Details | Diff
New patch for CVS head from Ben Konrath (2.05 KB, patch)
2005-02-10 13:30 EST, Andrew Overholt CLA
no flags Details | Diff
double stage bootstrap patch (3.71 KB, patch)
2005-02-14 18:05 EST, Ben Konrath CLA
no flags Details | Diff
patch to fix some issues with the current bootstrap (10.17 KB, patch)
2005-03-08 21:58 EST, Ben Konrath CLA
no flags Details | Diff
patch to remove unnecessary "basedir" in jar ant task (646 bytes, patch)
2005-03-16 15:20 EST, Andrew Overholt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Overholt CLA 2005-02-10 12:06:44 EST
Background:

Traditionally, buildable source distributions do not include any binary files. 
This ensures that builds are reproducible, auditable, and there is a choice of
tools used in the building process.

Current situation:

Currently, there are a few jars in the srcIncluded zips that I don't think
should be there.  Specifically, jdtcore.jar and jdtCompilerAdapter.jar.  These
jars can be built using the source that is part of the zip.  I understand that
these are needed to build the rest of Eclipse, but in a compiler bootstrapping
situation such as this, it is customary to build all parts necessary from
source.  I've attached a patch to the main build.xml in the srcIncluded zip
which builds all parts necessary for the aforementioned jars and places them in
the root of the exploded zip.  They can then be used to build the rest of
Eclipse (including themselves).
Comment 1 Andrew Overholt CLA 2005-02-10 12:08:28 EST
Created attachment 17826 [details]
patch to build.xml to build jdtcore.jar and jdtCompilerAdapter.jar

Note that when this patch is applied, jdtcore.jar and jdtCompilerAdapter.jar
should be removed from srcFetch and srcIncluded zips as they will no longer be
necessary.
Comment 2 Andrew Overholt CLA 2005-02-10 12:09:25 EST
If possible, it'd be great if we could get this in for 3.1M5.
Comment 3 Andrew Overholt CLA 2005-02-10 13:30:02 EST
Created attachment 17828 [details]
New patch for CVS head from Ben Konrath
Comment 4 Kim Moir CLA 2005-02-10 14:25:37 EST
The jdtcore jars included in the src build are from a stable build, in this case
3.1 M4.  We want the source build to replicate the real eclipse build process so
it should use the same compiler.  Thus it will not use the compiler source from
the current build, but rather the compiler that was actually used in the build.

In order implement this, we'll need to 
compile the compiler using javac
using the resulting binary to recompile the compiler source
use the resulting binary to compile eclipse

We'll incorporate this as time permits.
Comment 5 Ben Konrath CLA 2005-02-11 00:04:19 EST
Hi Kim,

I'm a bit confused by the second paragraph in comment #4. Could you please
provide an example to help explain? 

IMHO replicating the build process by providing a stable compiler does not offer
a signification advantage. If someone wants to build a stable Eclipse, I think
that they should build from an M-build or a true stable release. The way I
understand it is that even if Eclipse is built with a compiler from a stabilized
build, the projects that are compiled when using Eclipse will still use the
unstable compiler - this includes runtime workbenches if developing plugins. 
Also, this change would not affect the eclipse.org builds since the srcIncluded
and srcFetch zips are not used in the build process (as far as I can tell).

Andrew and I talked about adding a conditional variable to the "bootstrap"
target so that it is only run if the user sets conditional variable to be true.
The bootstrap target would have to be changed to delete the jdt jars, build them
and then move them to correct place. The idea is that only people who know what
they are doing would set this conditional variable. Personally I don't really
like this method because it keeps the binary jars included unnecessarily in the
source distribution. 

Comments?
Comment 6 Kim Moir CLA 2005-02-11 09:40:55 EST
Eclipse is built using a stable jdtcore compiler.  The second paragraph in
comment #4 refers to the fact that we use the jdtcore compiler to compile
eclipse.  However, in order to create the jdtcore compiler from source, we
compile the compiler souce using javac.  This will give use a binary jdtcore
compiler.  But it's not the same as the one that was used to create eclipse
because it wasn't created using jdtcore, but javac. So we have to take the
jdtcore compiler created using javac, and apply it against the compiler source
again to create a new jdtcore compiler that was created using the first jdtcore
compiler. This binary can be used to compile the eclipse source build.  This is
the recommended approach by the jdtcore team.

We are taking this approach because we want the source builds to use the same
process that is used in the regular build.  Using this methodology, if people
open bugs with respect to their source builds we can be sure that they are valid
bugs and not problems arising as a result of the way that eclipse was compiled.
 Also, we want to ensure that external contributors can use the same process for
producing ports of eclipse that can be included on eclipse.org.  For instance,
HP provided a hpux-motif-ai64 drop for 3.0.1.

We won't add a conditional variable to the build script to build the compiler
from source.  It would be better to change the scripts to compile the compiler
from source by default and remove the binary jars.
Comment 7 Ben Konrath CLA 2005-02-14 18:05:13 EST
Created attachment 17939 [details]
double stage bootstrap patch

Hi Kim, 

I changed the patch to bootstrap the compiler in the following way:

* use javac to build jdtcore.jar and jdtCompilerAdapter.jar
* use these two "freshly-built" jars to build jdtcore.jar and
  jdtCompilerAdapter.jar again
* move the new jars in place to build eclipse

The patch requires that jdtcore.jar and jdtComplierAdapter.jar not be present
in the root of the unpacked zip. The CLASSPATH should still be set to include
these so that the ECJ is picked up during the second stage of the bootstrap. I
also remove the "-encoding ISO-8859-1" from the compilerArgs as I don't think
that it is required and it made the patch a little easier.

It would be great if you take a look at this after 3.1M5 is released. Thanks.
Comment 8 Andrew Overholt CLA 2005-02-25 14:11:16 EST
Comment on attachment 17828 [details]
New patch for CVS head from Ben Konrath

Ben's patch is newer than this.
Comment 9 Kim Moir CLA 2005-03-02 13:57:30 EST
Bootstrap source builds will be created as of builds > N20050303

I used a different approach from the patch because I was having a lot of
classpath issues within ant. Suggestions for improvement are always welcome :-)

The changes are in the HEAD stream of org.eclipse.releng.eclipsebuilder/sdk
Comment 10 Ben Konrath CLA 2005-03-08 21:58:57 EST
Created attachment 18570 [details]
patch to fix some issues with the current bootstrap

Hi Kim,

I just looked at your solution and most of it looks good. The attached patch
addresses the issues I found. Here is a changelog of the patch:

* export ANT_OPTS on a separate line which makes it more portable (build)
* removed unnecessary export ORIGCLASSPATH (build)
* some formatting fixes (all)
* removed duplicate javac line (compilejdtcore.xml)
* removed the <and> statements within the <condition> statements because they
  not necessary now that there is only one jar
* compilejdtcore.xml and the main build.xml now fail if 
  org.eclipse.jdt.core.JDTCompilerAdapter cannot be found
* copy the ECJ (Eclipse Complier for Java) from current build instead of using
  pre-zipped source
* change jdtcore.jar to ecj.jar because it's technically not jdtcore.jar

Comments?
Comment 11 Andrew Overholt CLA 2005-03-16 15:19:36 EST
The jar line in compilejdtcore.xml differs from that in
compilejdtcorewithjavac.xml in this way (ignoring the ../):

-                <jar jarfile="../jdtcore.jar" basedir="${destdir}">
+                <jar jarfile="jdtcore.jar">

This seems to be causing things to be added twice to the jar.  Removing the
"basedir" property seems to fix it.  I'll attached a patch.
Comment 12 Andrew Overholt CLA 2005-03-16 15:20:23 EST
Created attachment 18864 [details]
patch to remove unnecessary "basedir" in jar ant task
Comment 13 Kim Moir CLA 2005-03-16 15:27:20 EST
reopening
Comment 14 Kim Moir CLA 2005-04-14 11:36:10 EDT
Added all patches except the parts that use the compiler from the build.  We
will continue to use the stable compiler to build eclipse.
Comment 15 Ben Konrath CLA 2005-04-15 16:03:36 EDT
Hi Kim, 

Thanks for applying those changes. As far as this compiler thing goes, I really
think that it's important for the included compiler to build Eclipse only
because Eclipse is the perfect test case for that compiler. But I guess we'll
have to agree to disagree on this issue :)