[Soc-coordination] Jigsaw - Report 4

2011-08-01 Thread Guillaume Mazoyer
Status report Jigsaw num. 4 for GSoC 2011
-

We now have all dependencies in Debian to build Jigsaw and running its
tests. So it is time to think about what we can do to package all the
modules. During these weeks I have done some progress about
understanding how Jigsaw works and that is really important to know
how we are going to package it.

First I tried to build Jigsaw with the current OpenJDK 7 packaging.
These packages are based on IcedTea and several tarballs from the
OpenJDK mercurial forest. So basically, I tried to make the same things
but with Jigsaw tarballs instead. Sadly, it didn't work but this was
expected not to work. IcedTea is a really great project which gives us
the tools to build OpenJDK with autotools and stuffs. It also ships
some patches to replace some part of the JDK such as the web plugin
for example. Jigsaw being synchronized with OpenJDK 7 we will probably
reuse the patches from IcedTea and the ones from the Debian packaging
to build Jigsaw.

After that I have spent a lot of time reading documentation and blog
entries about modularizing Java. Mark Reinolds[1] the chief architect
of Java wrote several interesting articles about what people want Jigsaw
to be. I also had to plan my trip to got to DebConf 11 which has just
ended.

We now know that we can create several modules and that gives us the
idea to separate JVM modules from applications specific modules. In
this way, the JDK system directory will contains only JDK modules and
we could put applications specific modules in a directory like
'/usr/share/java/modules'. We also thought about packaging Jigsaw like
a classic JDK so we will be able to mimic the current installation of
JDK6 or JDK7 and install all JDK modules in the same modules library
which will be the base for all other.

Modules libraries can be created with 'jmod create -L modules_library'.
Each modules library, except the top-level one from the JDK, has a
parent. The default is the JDK modules library but we can totally do
something like:

$ jmod create -L first_lib
$ jmod create -L second_lib -P first_lib

With this we will have 2 libraries, the first one is linked to the JDK
library, and the second one is linked to the previoulsy created library.
This is good because we can install modules in a lot of different places
on a file system. But it can also complexify things and that's why I
would like to see only 2 modules libraries in Debian which could be in:

- /usr/lib/jvm/java-8-openjdk/modules ; for the JDK one
- /usr/share/java/modules ; for third party applications modules

Another idea that we mentionned is to automatically generate the
dependencies list of Jigsaw modules in the 'debian/control' file. We
know it is possible because Oracle did that with their own .deb creator.
We coudl also use this kind of things to generate the dependencies list
of a modular Java application. I guess that we should contribute to
javahelper to do such a thing.

Sylvestre Ledru has created a Git repository on Alioth[2] so we can work
together on getting Jigsaw packaged. I have already applied the patch of
Alan Bateman implementing exploded modules. We are still looking for a
new version of this patch which *may* be available soon. The Git
repository contains also a 'debian/' directory which is for now a copy
of the 'debian/' directory of the OpenJDK 7 package.

DebConf 11 was a great opportunity to meet my mentors Tom Marble and
Sylvestre Ledru. We spoke about Jigsaw, its packaging and we found some
ideas which will be followed during the next steps of the project. At
DebConf 11, my mentors and I also gave a talk about our project and
what we have done so far. The slides of this talk[3] are available
online as well as the video[4].

These last weeks were full of brainstorming.
The next steps are to go ahead with the packaging of Jigsaw and try to
obtain .deb as soon as possible. Maybe we are going to use the patches
from IcedTea and OpenJDK 7 package too. We will also need to interact
with upstream to push changes. I also would like to cooperate with people
from IcedTea.

[1] http://mreinhold.org/blog/
[2] git+ssh://git.debian.org/git/pkg-java/jigsaw.git
[3] 
http://wiki.debian.org/SummerOfCode2011/Jigsaw?action=AttachFiledo=gettarget=jigsaw-dc11.pdf
[4] 
http://meetings-archive.debian.net/pub/debian-meetings/2011/debconf11/low/718_Jigsaw_Progress_in_Debian.ogv


signature.asc
Description: Digital signature
___
Soc-coordination mailing list
Soc-coordination@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/soc-coordination

[Soc-coordination] Jigsaw - Report 3

2011-07-02 Thread Guillaume Mazoyer
 guide but when compiling the module
didn't work. So I tried to understand why and then to fix it. I
eventually compiled and installed my module and here is how I did it:

- mkdir -p src/com.greetings/com/greetings/
- mkdir -p src/org.astro/org/astro/
- mkdir modules
- vim src/com.greetings/module-info.java
- vim src/com.greetings/com/greetings/Hello.java
- vim src/org.astro/module-info.java
- vim src/org.astro/org/astro/World.java
- ./jigsaw/build/linux-amd64/bin/javac -d modules \
  -modulepath ./jigsaw/build/linux-amd64/modules/modules \
  -sourcepath src `find src -name '*.java'`
- jmod create -L mlib
- jmod install modules org.astro com.greetings -L mlib
- java -L mlib -m com.greetings

And here it is, we have a nice hello world module. The documentation
says to put the module-info.java of org.astro in
src/org.astro/org/astro/ but it didn't work for me so I tried to put
it in src/org.astro/ and it worked. Also the quick start guide says
that we have to use the -modulepath option to specify where the
modules are. I first tried to use ./jigsaw/build/linux-amd64/modules/
but javac told me he could not find java.lang so I noticed that
there is a subdirectory called modules in
./jigsaw/build/linux-amd64/modules/ so I used it as module path and it
worked.

Writing a module and seeing how Jigsaw modules are made started to make
me think about the packaging of Jigsaw. Dependencies being available,
knowing how to build and test Jigsaw and seeing how modules are made, I
think that I will soon try to start the packaging of Jigsaw and getting
started with the packaging will be my ultimate goal for the next weeks.

[1] http://www.gnu.org/software/help2man/
[2] http://packages.debian.org/fr/sid/jtreg
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629577
[4] http://icedtea.classpath.org/
[5]
http://icedtea.classpath.org/hg/buildbot/file/c02bdc56dc6e/icedtea/build.sh
[6]
http://icedtea.classpath.org/hg/icedtea6/file/tip/patches/testenv.patch
[7] http://en.wikipedia.org/wiki/Xvfb
[8]
http://cr.openjdk.java.net/~alanb/jigsaw-mp-prototype1/webrev/jdk.patch
[9] http://mail.openjdk.java.net/pipermail/jigsaw-dev/
[10] http://roku.info9.net/~guillaume/jigsaw/patch_jigsaw_02072011.patch
[11] http://openjdk.java.net/projects/jigsaw/doc/quickstart.html

-- 

Guillaume Mazoyer - http://respawner.fr/


signature.asc
Description: Digital signature
___
Soc-coordination mailing list
Soc-coordination@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/soc-coordination

[Soc-coordination] Jigsaw - Report 1

2011-06-03 Thread Guillaume Mazoyer
The beginning of this Google Summer of Code has been busy and pretty
cool. Not a lot of code was produced but I did learn a lot of things.

During this GSoC I will work on the next generation JDK. This means that
I will (and I already have) compile the JDK. That's pretty awesome but
it requires a lot of power. That's why Tom Marble created me an account
on his 8 CPUs machine to help me.
Since I'm probably going to sign some packages, I created a new GPG key
with a 4096 RSA strength.
My old key was:

pub   1024D/F144A319 2008-10-18

And the new key is:

pub   4096R/EE2BBBC7 2011-05-03

I cross signed my keys using this great tutorial[1]

I read some documentation about Jigsaw[2] and watch Tom's talk at
DebConf 10[3]
I have spent a little more than on week to understand the current
OpenJDK packaging to be able to rebuild it. I have learnt from where do
the sources come from. The current packaging is a little hard to
understand. There are sources that come from IcedTea[4], OpenJDK[5], and
more[6].

After being able to rebuild the OpenJDK 6 package, I have downloaded the
source of the OpenJDK 8 and Jigsaw. I used the Mercurial forest to get
the sources.

For OpenJDK 8:
- hg clone http://hg.openjdk.java.net/jdk8/jdk8 jdk8
- cd jdk8  sh get_sources.sh

For Jigsaw:
- hg clone http://hg.openjdk.java.net/jigsaw/jigsaw jigsaw
- cd jigsaw  sh get_sources.sh

I have managed to build the sources of OpenJDK 8 and Jigsaw using the
same steps:
- cd jigsaw
- . jigbuild
- . jdk/make/jdk_generic_profile.sh
- export ALLOW_DOWNLOADS=true
- make sanity
- make all

Jigsaw specific:
- make modules-sanity
- make modules

Each build took several minutes. But they were successful. Tom helped me
a lot to build OpenJDK 8 and Jigsaw by giving me a solution. For
example, after getting the Mercurial forest, there were still missing
source files and the build failed. Tom told me that I needed to export a
environement variable: ALLOW_DOWNLOADS=true.
After building Jigsaw, I was able to see that the version string is not
legal in Debian and that is a real problem.
I have written some simple Hello World examples to compile and run with
Jigsaw. To modularize a program, it needs to contain a module-info.java
files. This file includes the modules needed to run the program and the
main class to run. For a classic hello world, the module-info.java files
looks like:

module test.hello @ 1 {
requires jdk.base @ 7-ea;
class test.hello.Main;
}

Tom gave me some packages to build: jtharness and jtreg. I succesfully
built jtharness using CDBS[7] and its Ant helper but I'll have to
repackage it to use javahelper instead of CDBS. I still don't try to
build jtreg because it requires javahelper to be built.

My next plan is to get jtharness and jtreg packaged with javahelper soon
and understand what modules does what in Jigsaw. Understaning modules
will help me to write some more complex examples. I hope to start
working on Jigsaw a little more soon (when I my internship will end
[next week]).

[1] http://people.debian.org/~anibal/ksp-dc10/ksp-dc10.html
[2] http://openjdk.java.net/projects/jigsaw/
[3] http://penta.debconf.org/dc10_schedule/events/558.en.html
[4] http://icedtea.classpath.org/download/source/
[5] http://download.java.net/openjdk/jdk6/
[6] http://cacaovm.org/
[7] http://roku.info9.net/~guillaume/jtharness/

--

Guillaume Mazoyer


signature.asc
Description: Digital signature
___
Soc-coordination mailing list
Soc-coordination@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/soc-coordination