Making OpenJDK builds easier
Dr Andrew John Hughes
ahughes at redhat.com
Wed Dec 1 20:39:28 UTC 2010
On 11:04 Wed 01 Dec , Kelly O'Hair wrote:
> Adding a CC to build-dev...
> On Dec 1, 2010, at 8:21 AM, Erwin Vervaet wrote:
> > Hello all,
> > I'd like to bring up the topic of the ease of building the OpenJDK.
> > Let me start with a bit of background. I attended an interesting
> > OpenJDK talk by Dalibor at Devoxx 2010 earlier this month and
> > decided I should check out the OpenJDK project. This of course meant
> > grabbing the source code and building it!
> > 1) Grabbing the code
> > I immediately found info on how to install Mercurial and clone the
> > Mercurial repo on openjdk.org. The Achilles heel here is of course
> > the Forest extension. The main problem I had was finding Forest
> > since the original Forest repo is no longer available (http://hg.akoha.org/hgforest/
> > ).
> > [Rant] This whole Forest deal feels a bit amateurish. Since Forest
> > seems to be a discontinued project maybe the OpenJDK project should
> > just grab control of it and let users download forest.py directly
> > from openjdk.org itself? That would also allow the Forest
> > installation instructions on openjdk.org to be simpler and more to
> > the point [/Rant]
> This forest extension has worked fine for many years, but with each
> new Mercurial 1.+ release it tends to get broken.
> I need to update the README-builds.html on this, I will file a CR so
> it does not get forgotten.
> The term forest probably came from the extension itself and it was
> probably a mistake to use that term, water under the bridge.
> What we really have with OpenJDK is a set of nested repositories, many
> of which can be used independently. We in general like that
> The forest extension, in my opinion, initially had a chance of
> becoming a formal part of Mercurial when we started using it, but that
> potential is gone now.
> I myself would like to remove our dependence on the forest extension
> completely and do something on the order of:
> hg clone http://hg.openjdk.java.net/jdk7/jdk7 yourjdk7
> cd yourjdk7 && make source
> Where the top Makefile would populate the rest of your nested
> repositories and potentially get the jaxp/jaxws sources too. That
> replaces fclone.
> The rest of the forest commands are nothing more than a traversal of
> the repositories and repeating the same action on each, easily
> scripted or make targets can be provided.
> (I use 'makefile' loosely here, it's the functionality that is
> important, an ant script might work too, but usually I know you have
It's also much quicker than fclone if it doesn't search too.
Please use a Makefile or even just a simple shell script. Having to use
Ant just to checkout is an insane dependency.
Most of us regular hackers have already worked round this already
with our local scripts or whatever. So this should be something
easy for newbies.
> > 2) Building the code
> > Again I quickly found the "OpenJDK Build README" on openjdk.org (http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html
> > ) and prepped my system for a build. Doing 'make sanity' told me
> > everything was fine, so I tried 'make'. This runs into a problem
> > because the build needs to download jaxp/jaxws/jaf code drops from
> > the Internet and this is not allowed by default. After a bit of
> > googling I issued a 'make ALLOW_DOWNLOADS=true' command. Next
> > problem: the java.net download locations in the build system are
> > fubar. After a bit more googling and investigation I patched two
> > properties files (see attached patch) and now 'make
> > ALLOW_DOWNLOADS=true' created my first OpenJDK 7 build!
> > [Rant] That problem with the java.net download locations should
> > obviously be fixed (maybe the attached patch can be my first OpenJDK
> > contribution ;-) Secondly, the "OpenJDK Build README" should mention
> > the ALLOW_DOWNLOADS flag, or maybe ALLOW_DOWNLOADS should even be
> > "true" by default. [/Rant]
> (What attached patch? But it doesn't matter, the links are being
> changed with the changesets:
> http://hg.openjdk.java.net/jdk7/build/jaxp/rev/d1cb3e473c32 and http://hg.openjdk.java.net/jdk7/build/jaxws/rev/f258bef45f3b
> they just haven't been integrated into the master jdk7/jdk7 area
> yet. The OpenJDK6 was fixed too.)
> This ALLOW_DOWNLOADS was purposely defaulted to 'off' because in
> general, when a build depends on web downloads, it's not as reliable a
> build process.
> I was also seeing a great deal of frustration when the download did
> not work due to proxy issues or whatever.
> The README-builds.html file should probably have made that clear, my
> apologies. Another CR for me.
While you're at it, get rid of the binary plugs from the README-builds.html
in 7 as in 6 (and ideally, just delete them altogether as Dalibor suggested).
> The java.net change was an unusual event and the older links should
> have been forwarded from the get go, but were not.
> It has been suggested multiple times that perhaps the jaxp and jaxws
> repositories could just be deleted and the process
> moved to the top level Makefile, where my above 'make source' idea
> starts making even more sense.
+1 for that idea. And it would be just a simple case of adding everything from the
jaxp and jaxws directories into the top-level repository. The downside is you'd lose
the history. So the repos should be kept somewhere even if they are no longer used.
> > My 2c:
> > The process of grabbing the source code and making your first
> > OpenJDK should be as simple as possible. Making this super simple
> > makes getting into OpenJDK hacking much more pleasant since you
> > don't get bogged down in a bunch of stupid issues right from the
> > start.
> I can't agree with you more, but if these were the only issues you ran
> into, I'm actually quite pleased.
> Not saying they should have happened, and that they will be dealt
> with, but...
> you should try building it on Windows, I suspect your Rants would be
> RANTS and 'stupid' would be a bunch of 4 letter words. :^(
> I'll try and see what I can do to address these issues.
BTW, using IcedTea7 handles all these little niggles for you. You do:
$ hg clone http://icedtea.classpath.org/hg/icedtea
$ cd icedtea
It's even easier if you just download the latest release tarball from
http://icedtea.classpath.org/download/source/icedtea-1.13.tar.gz but you
probably want something newer than that offers.
> > Erwin Vervaet
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and IcedTea
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
More information about the build-dev