Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [justj-dev] Justj project

Hi,

 

Lets move this discussion to mailing list. So I am responding to mailing list now.

 

From the questions I feel There are two paths here. Packaging JRE in the EPP and generate a jre based on components selected in oomph/installer and use it.

 

  1. Packaging in EPP and installer package (Might need some discussions)

In the packaging stage there is a place where product contents are created with all the features and their dependencies. We use this to generate jdeps and in turn required java . Also if we have a folder named jre at the same level as eclipse launcher executable, launcher tries to create jvm using $ECLIPSE_HOME/jre/bin/java. This works in linux and windows not in mac. This could be one way

 

  1. Generation of JRE during the installation. (This is going to be controversial)
    Moving generation of Java to the client side. As an extra task, download latest JDK with jmods on the client machine and generate java based on the jdeps available with us. This way we need not maintain jre in an IU

 

Thanks

Sravan

 

 

From: Daniel Megert <daniel_megert@xxxxxxxxxx>
Sent: 30 April 2020 18:29
To: Ed Merks <
ed.merks@xxxxxxxxx>
Cc: Sravan K Lakkimsetti <
sravankumarl@xxxxxxxxxx>
Subject: Re: [EXTERNAL] Re: Justj project

 

> I wonder if we should be discussing this via the mailing list?

I agree. Especially since JustJ was mentioned in the April newsletter 2 days ago.

Dani

Ed Merks ---30.04.2020 08:13:07---Sravan, I wonder if we should be discussing this via the mailing list?



From: Ed Merks <ed.merks@xxxxxxxxx>
To: Sravan K Lakkimsetti <sravankumarl@xxxxxxxxxx>
Cc: "daniel_megert@xxxxxxxxxx" <daniel_megert@xxxxxxxxxx>
Date: 30.04.2020 08:13
Subject: [EXTERNAL] Re: Justj project





Sravan,

I wonder if we should be discussing this via the mailing list?

  https://accounts.eclipse.org/mailing-list/justj-dev

There are those who will complain about private conversations.  Of course at this point, we're the only ones...

____________________________________

This is a long email with lots of details to answer your question, but at the end there are some "open questions". 

Please be patient while I iron out the details on my prototyping effort and can produce results that can be further/properly tested...

____________________________________

I've been doing a lot of prototyping to automate as much of the processing as possible, so I have quite a bit already working already and tested already...

So you'll see that I have a few "test/prototype" jobs running already on the build server: 

  https://ci.eclipse.org/justj/

For example this one:

  https://ci.eclipse.org/justj/job/SimRel%20jdeps/lastBuild/

It uses jdep on all plugins in the current 2020-06 staging repository.  That produces this list of modules:

https://ci.eclipse.org/justj/job/SimRel%20jdeps/lastSuccessfulBuild/artifact/actual-deps/*view*/

java.base
java.compiler
java.datatransfer
java.desktop
java.instrument
java.logging
java.management
java.naming
java.prefs
java.rmi
java.scripting
java.security.jgss
java.security.sasl
java.sql
java.sql.rowset
java.xml
jdk.jdi
jdk.management
jdk.unsupported
jdk.xml.dom

There's also this job:

  https://ci.eclipse.org/justj/job/Tools/

For this I uploaded a zip of a local git clone with some "releng" JustJ tools that I hope/intend to use.  So you can find that zip here:

  https://ci.eclipse.org/justj/job/Tools/lastSuccessfulBuild/artifact/

So right now the job just unzips this clone and does a Maven/Tycho build that builds the update site for the tools:

  https://ci.eclipse.org/justj/job/Tools/lastSuccessfulBuild/artifact/org.eclipse.justj.tools/releng/org.eclipse.justj.tools.site/target/repository/

The purpose of the tools is to generate the entire scaffolding necessary to build a p2 update site with JREs.   It defines a model that allows the following file to be loaded and that is used to generate the all the necessary structure for building the JREs:

  https://ci.eclipse.org/justj/job/Tools/lastSuccessfulBuild/artifact/org.eclipse.justj.tools/plugins/org.eclipse.justj.codegen/model/justj.jregen/*view*/

This is still a work in progress, but is fully tested locally.  It generates the attached zip file, and that's something you should be able to unzip and build locally.  But the point is it doesn't contain any of the actual JREs, it's just the scaffolding, so the build will not produce something that works until you copy a JRE into the "jre" folder of one of the fragments.

Finally there is this job for actually building the JREs using jlink:

  https://ci.eclipse.org/justj/job/Build%20JREs/

This is of course also a work in progress and produces these results:

  https://ci.eclipse.org/justj/job/Build%20JREs/lastBuild/artifact/

You can view the job configuration to see what it does.  That is the script I'm current working on and I am waiting on this:

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=562477

I.e., I need agents that run natively on Mac and Windows to run jlink natively to produce the Mac and Windows JREs.  (Apparently corporate sponsorship will be needed long term for these agents.)

You'll see the above script curls the JDK from open JDK and curls a recent Eclipse SDK.  It first produces a "full" JRE with all the modules in the JDK.   It also produces a JRE with the minimal hard-coded modules that I computed are needed for the Eclipse Installer.   It also produces a JRE for the modules computed (in the script) to be needed by the Eclipse SDK.  I'm currently trying to understand the size reductions.  What I noticed is that the JRE produced by the full set of "simrel" required modules is only slightly larger (2M) than the minimal set needed for the installer and by the minimal set needed by the Eclipse SDK, so it's probably of little value to produce those smaller variants...

I do already have the above working locally using my Windows machine as well as my Linux and Mac virtual boxes, and I have tested that the Eclipse SDK launches with each of them.

I'm also looking at launching this Ant build.xml:

<?xml version="1.0"?>
<project name="SystemProperty" default="build">
  <target name="build">
    <echo message="--------------"/>
    <echoproperties/>
    <echo message="--------------"/>
  </target>
</project>

I.e., launching that via the Eclipse SDK's antRunner and using the actual jlink-generated JRE, e.g., something like this:

  eclipse/eclipse -application org.eclipse.ant.core.antRunner -nosplash  -emacs -vm jre.simrel.minimal.compressed/bin

This would let me not only test that Eclipse launches with that JRE, but also to see which packages OSGi computes for this JRE:

org.osgi.framework.system.packages=com.sun.jdi, com.sun.jdi.connect, com.sun.jdi.connect.spi, com.sun.jdi.event, com.sun.jdi.request, com.sun.management, com.sun.nio.file, com.sun.tools.attach, com.sun.tools.attach.spi, java.applet, java.awt, java.awt.color, java.awt.datatransfer, java.awt.desktop, java.awt.dnd, java.awt.event, java.awt.font, java.awt.geom, java.awt.im, java.awt.im.spi, java.awt.image, java.awt.image.renderable, java.awt.print, java.beans, java.beans.beancontext, java.io, java.lang, java.lang.annotation, java.lang.constant, java.lang.instrument, java.lang.invoke, java.lang.management, java.lang.module, java.lang.ref, java.lang.reflect, java.lang.runtime, java.math, java.net, java.net.spi, java.nio, java.nio.channels, java.nio.channels.spi, java.nio.charset, java.nio.charset.spi, java.nio.file, java.nio.file.attribute, java.nio.file.spi, java.rmi, java.rmi.activation, java.rmi.dgc, java.rmi.registry, java.rmi.server, java.security, java.security.cert, java.security.interfaces, java.security.spec, java.sql, java.text, java.text.spi, java.time, java.time.chrono, java.time.format, java.time.temporal, java.time.zone, java.util, java.util.concurrent, java.util.concurrent.atomic, java.util.concurrent.locks, java.util.function, java.util.jar, java.util.logging, java.util.prefs, java.util.regex, java.util.spi, java.util.stream, java.util.zip, javax.accessibility, javax.annotation.processing, javax.crypto, javax.crypto.interfaces, javax.crypto.spec, javax.imageio, javax.imageio.event, javax.imageio.metadata, javax.imageio.plugins.bmp, javax.imageio.plugins.jpeg, javax.imageio.plugins.tiff, javax.imageio.spi, javax.imageio.stream, javax.lang.model, javax.lang.model.element, javax.lang.model.type, javax.lang.model.util, javax.management, javax.management.loading, javax.management.modelmbean, javax.management.monitor, javax.management.openmbean, javax.management.relation, javax.management.remote, javax.management.timer, javax.naming, javax.naming.directory, javax.naming.event, javax.naming.ldap, javax.naming.ldap.spi, javax.naming.spi, javax.net, javax.net.ssl, javax.print, javax.print.attribute, javax.print.attribute.standard, javax.print.event, javax.rmi.ssl, javax.script, javax.security.auth, javax.security.auth.callback, javax.security.auth.kerberos, javax.security.auth.login, javax.security.auth.spi, javax.security.auth.x500, javax.security.cert, javax.security.sasl, javax.sound.midi, javax.sound.midi.spi, javax.sound.sampled, javax.sound.sampled.spi, javax.sql, javax.sql.rowset, javax.sql.rowset.serial, javax.sql.rowset.spi, javax.swing, javax.swing.border, javax.swing.colorchooser, javax.swing.event, javax.swing.filechooser, javax.swing.plaf, javax.swing.plaf.basic, javax.swing.plaf.metal, javax.swing.plaf.multi, javax.swing.plaf.nimbus, javax.swing.plaf.synth, javax.swing.table, javax.swing.text, javax.swing.text.html, javax.swing.text.html.parser, javax.swing.text.rtf, javax.swing.tree, javax.swing.undo, javax.tools, javax.transaction.xa, javax.xml, javax.xml.catalog, javax.xml.datatype, javax.xml.namespace, javax.xml.parsers, javax.xml.stream, javax.xml.stream.events, javax.xml.stream.util, javax.xml.transform, javax.xml.transform.dom, javax.xml.transform.sax, javax.xml.transform.stax, javax.xml.transform.stream, javax.xml.validation, javax.xml.xpath, org.ietf.jgss, org.w3c.dom, org.w3c.dom.bootstrap, org.w3c.dom.css, org.w3c.dom.events, org.w3c.dom.html, org.w3c.dom.ls, org.w3c.dom.ranges, org.w3c.dom.stylesheets, org.w3c.dom.traversal, org.w3c.dom.views, org.w3c.dom.xpath, org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers, sun.misc, sun.reflect

So I can verify that indeed it's got fewer packages than the full JRE:

org.osgi.framework.system.packages=com.sun.jarsigner, com.sun.java.accessibility.util, com.sun.jdi, com.sun.jdi.connect, com.sun.jdi.connect.spi, com.sun.jdi.event, com.sun.jdi.request, com.sun.management, com.sun.net.httpserver, com.sun.net.httpserver.spi, com.sun.nio.file, com.sun.nio.sctp, com.sun.security.auth, com.sun.security.auth.callback, com.sun.security.auth.login, com.sun.security.auth.module, com.sun.security.jgss, com.sun.source.doctree, com.sun.source.tree, com.sun.source.util, com.sun.tools.attach, com.sun.tools.attach.spi, com.sun.tools.javac, com.sun.tools.jconsole, java.applet, java.awt, java.awt.color, java.awt.datatransfer, java.awt.desktop, java.awt.dnd, java.awt.event, java.awt.font, java.awt.geom, java.awt.im, java.awt.im.spi, java.awt.image, java.awt.image.renderable, java.awt.print, java.beans, java.beans.beancontext, java.io, java.lang, java.lang.annotation, java.lang.constant, java.lang.instrument, java.lang.invoke, java.lang.management, java.lang.module, java.lang.ref, java.lang.reflect, java.lang.runtime, java.math, java.net, java.net.http, java.net.spi, java.nio, java.nio.channels, java.nio.channels.spi, java.nio.charset, java.nio.charset.spi, java.nio.file, java.nio.file.attribute, java.nio.file.spi, java.rmi, java.rmi.activation, java.rmi.dgc, java.rmi.registry, java.rmi.server, java.security, java.security.cert, java.security.interfaces, java.security.spec, java.sql, java.text, java.text.spi, java.time, java.time.chrono, java.time.format, java.time.temporal, java.time.zone, java.util, java.util.concurrent, java.util.concurrent.atomic, java.util.concurrent.locks, java.util.function, java.util.jar, java.util.logging, java.util.prefs, java.util.regex, java.util.spi, java.util.stream, java.util.zip, javax.accessibility, javax.annotation.processing, javax.crypto, javax.crypto.interfaces, javax.crypto.spec, javax.imageio, javax.imageio.event, javax.imageio.metadata, javax.imageio.plugins.bmp, javax.imageio.plugins.jpeg, javax.imageio.plugins.tiff, javax.imageio.spi, javax.imageio.stream, javax.lang.model, javax.lang.model.element, javax.lang.model.type, javax.lang.model.util, javax.management, javax.management.loading, javax.management.modelmbean, javax.management.monitor, javax.management.openmbean, javax.management.relation, javax.management.remote, javax.management.remote.rmi, javax.management.timer, javax.naming, javax.naming.directory, javax.naming.event, javax.naming.ldap, javax.naming.ldap.spi, javax.naming.spi, javax.net, javax.net.ssl, javax.print, javax.print.attribute, javax.print.attribute.standard, javax.print.event, javax.rmi.ssl, javax.script, javax.security.auth, javax.security.auth.callback, javax.security.auth.kerberos, javax.security.auth.login, javax.security.auth.spi, javax.security.auth.x500, javax.security.cert, javax.security.sasl, javax.smartcardio, javax.sound.midi, javax.sound.midi.spi, javax.sound.sampled, javax.sound.sampled.spi, javax.sql, javax.sql.rowset, javax.sql.rowset.serial, javax.sql.rowset.spi, javax.swing, javax.swing.border, javax.swing.colorchooser, javax.swing.event, javax.swing.filechooser, javax.swing.plaf, javax.swing.plaf.basic, javax.swing.plaf.metal, javax.swing.plaf.multi, javax.swing.plaf.nimbus, javax.swing.plaf.synth, javax.swing.table, javax.swing.text, javax.swing.text.html, javax.swing.text.html.parser, javax.swing.text.rtf, javax.swing.tree, javax.swing.undo, javax.tools, javax.transaction.xa, javax.xml, javax.xml.catalog, javax.xml.crypto, javax.xml.crypto.dom, javax.xml.crypto.dsig, javax.xml.crypto.dsig.dom, javax.xml.crypto.dsig.keyinfo, javax.xml.crypto.dsig.spec, javax.xml.datatype, javax.xml.namespace, javax.xml.parsers, javax.xml.stream, javax.xml.stream.events, javax.xml.stream.util, javax.xml.transform, javax.xml.transform.dom, javax.xml.transform.sax, javax.xml.transform.stax, javax.xml.transform.stream, javax.xml.validation, javax.xml.xpath, jdk.dynalink, jdk.dynalink.beans, jdk.dynalink.linker, jdk.dynalink.linker.support, jdk.dynalink.support, jdk.incubator.foreign, jdk.javadoc.doclet, jdk.jfr, jdk.jfr.consumer, jdk.jshell, jdk.jshell.execution, jdk.jshell.spi, jdk.jshell.tool, jdk.management.jfr, jdk.nashorn.api.scripting, jdk.nashorn.api.tree, jdk.net, jdk.nio, jdk.nio.mapmode, jdk.security.jarsigner, jdk.swing.interop, netscape._javascript_, org.ietf.jgss, org.w3c.dom, org.w3c.dom.bootstrap, org.w3c.dom.css, org.w3c.dom.events, org.w3c.dom.html, org.w3c.dom.ls, org.w3c.dom.ranges, org.w3c.dom.stylesheets, org.w3c.dom.traversal, org.w3c.dom.views, org.w3c.dom.xpath, org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers, sun.misc, sun.reflect

So the thinking at this point is that there will be three jobs that run natively on each of the three supported platforms to produce a full JRE and one or more minimized JREs.

Here is some size information from running a more up-to-date version of the script locally:

$du -s -k *.tar
79832   jre.full.compressed.stripped.tar               # --compress=2  --strip-debug
91832   jre.full.compressed.tar                        # --compress=2
40772   jre.minimal.compressed.stripped.tar            # --compress=2  --strip-debug
47420   jre.minimal.compressed.tar                     # --compress=2        
42560   jre.simrel.minimal.compressed.stripped.tar     # --compress=2  --strip-debug
49532   jre.simrel.minimal.compressed.tar              # --compress=2

I computed the tar sizes because the Windows installer will package up a tar file and this size is close to the uncompressed size on disk for the folder.  I would prefer to package up a zip file but I don't believe there is any EPL compatible native C library for processing a zip.  The tar format it easier to process natively with relatively simple C logic... In any case, you can see the relative size differences, also taking note that stripping the debug information significantly reduces the size...

So the general idea is that the three jobs will produce *.tar.gz and *.zip of the JRE variants, likely along with information about the contained modules and perhaps also the available Java packages.  The generator model can be updated based on these inputs.  

Another thing (very rough still), is something that can process the *.tar.gz to analyze file permissions (even on Windows where this can't be done using the native file system):

  https://ci.eclipse.org/justj/job/Tools/lastSuccessfulBuild/artifact/org.eclipse.justj.tools/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/TarAnalyzer.java/*view*/

This can be used to determine the touchpoint instructions that are needed.  I.e., the necessary chmod +x on the excutable files and well as any neccessary symbolic links.  There are many symbolic links in the legal files, but I doubt that saves much space...  But I've seen that the adoptOpenJDK versions contain (or should contain) important symbolic links to executables, so that might/will be problem if they are not handled properly (as we've seen on Mac already).

In any case, the generator produces all the scaffolding (projects with poml.xml) for building JREs (with Tycho) and it should unpackage the *.tar.gz and *.zip into that scaffolding.  This is mostly working already locally manaully, so locally I've been able to produce an update site with the JREs packaged as IUs (on Windows).

Using this, I've updated Oomph's installer product to require the minimal JRE during the build.  Also, I have modified the Windows native executable to be able to extract a *.tar of the installer product containing the minimal JRE.  This launches properly and will always launch on Windows even if there is no appropriate version of Java installed.  Then I hacked the product catalog locally so that the product (Eclipse SDK product) requires the full JRE IU and then used the installer to create an installation that uses (has a -vm option for) that embedded JRE; the JRE IU is actually in the shared bundle pool so is reused by multiple installations.  This all works properly and I can create Java projects and run them.  On Windows and Linux, the IDE will even use the JRE of the IDE as the JRE in the Java preferences; on Mac that is not the case.  One gotcha that I noticed is that one cannot debug launch when using the minimized JRE.  I believe this is because one or more of these agents are missing:

jdk.hotspot.agent@14.0.1
jdk.jdwp.agent@14.0.1
jdk.management.agent@14.0.1

So perhaps those should be included and aren't very big.

_______________________________________

Some open questions. 

    1. Is there value (a use case) for packaging the full JDK as an IU?   It's very big, 195M on Windows, and who would want to use such a thing?  It only really makes sense if you want to use that thing as the JRE for JDT (and no Mac one wold still need to configure that use manually).
    2. If the JRE is used only for running a product (including the installer), not for Java development purposes, does it make sense (is it reasonable) to --strip-debug it to further reduce the size?  This is a question for both the full JRE and a minimized/reduced JRE; the size reduction is significant.  The only real loss of value from stripping is that I believe stack traces will provide less information...
    3. Do we really want to maintain all the generated JRE stuff (from the attached zip) in Git.  I'm a bit doubtful.  I have a sense that we should only maintain in Git the model from which it's generated and have the build generate the rest.  But I need to think about how that make sense and most importantly how to ensure consistent build qualifiers.  Ultimately my goal is that when there is a new release of the JDK, that we only need to run the jobs to produce the JREs themselves (based on the three URLs for where to get them), that we update the model, hopefully completely automatically based on the JREs that we've built, commit those changes to the model, and then run a build to generate this model after which we build the pom of that generated infrastucture to produce the corresponding p2 update site.
    4. Sorry if this all sounds complex. :-(  But I believe long term this will make producing new results relatively trivial with all aspects automated and everything reproducible locally on all platforms.

Regards,
Ed

On 30.04.2020 05:11, Sravan K Lakkimsetti wrote:

Hi,
 
Thank you for accepting me as a committer on Justj project. Is there any documentation I should be aware before starting on this?
I am looking at jlink tool which is available with JDK to build customized java and testing it with Eclipse SDK.  I am able to launch eclipse SDK when I built Java with the following modules

        1. java.base
        2. java.xml (required for jface)
        3. jdk.xml.dom (required for jface)
        4. java.desktop (required for jetty)
        5. java.naming (required for jetty)

Please note I did not run full test suite with these. I just launched eclipse. My suspicion would be p2 would require more modules to be included.
 
Thanks
Sravan

[attachment "org.eclipse.justj.zip" deleted by Daniel Megert/Zurich/IBM]



Back to the top