| Summary: | Pack200 process does not work on Windows | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Nick Boldt <nboldt> |
| Component: | Dash Athena | Assignee: | Common Build Inbox <dash.commonbuilder-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | dash.commonbuilder-inbox, d_a_carver, elias, kim.moir |
| Version: | unspecified | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
On further reflection, it seems like all we need to do is:
* put pack.properties in the Master zip
(which contains all the jars to be packed), and
* use -Dorg.eclipse.update.jarprocessor.pack200=${PACK200_JAVA_HOME}
(to point at the correct jre; this is required for the case of GEF which builds w/ 1.4 but packs w/ 5.0, so the builds isn't necessarily running with the same @jre or JAVA_HOME used for packing)
Kim, can you confirm that?
Yes, I think so.
In our build, we send the master zip to the foundation with the pack.properties attached to the it. This excludes certain files from packing and signing and sets the -E4 properties. It looks something like this
pack200.default.args=-E4
pack.excludes=eclipse/plugins/com.ibm.icu_4.0.1.v20090109.jar,...
sign.excludes=eclipse/plugins/com.ibm.icu_4.0.1.v20090109.jar,...
Of course, you need a task when the files return from the signing process that
creates the packed jars in your repo. You can use the jar processor for this task. Or, Andrew informs me that there is a new ant task in p2.repository.tools bundle that supports this functionality in M6.
<p2.process.artifacts repositoryPath="${p2.build.repo}" pack="true" />
I'm testing this in my build, see bug 268430.
To support this we should investigate using the Java ANT task at java.net. https://java-pack200-ant-task.dev.java.net/servlets/ProjectDocumentList?folderID=0&expandFolder=0&folderID=0 Which allows the execution of Pack200 through ANT. No reliance on bash to support this. Let me see if I can whip up a patch that can be applied to make use of it. Something like this might work, I don't know how it handles nested jars within jars though:
<project>
<taskdef name="p200ant"
classname="de.matthiasmann.p200ant.P200AntTask"/>
<target name="pack200">
<fileset id="eclipsejars2pack" dir="${packtmp}/${masterZip}">
<include name="**/*.jar"/>
</fileset>
<p200ant configFile="${configfile}" repack="true" destdir="${dist.dir}">
<fileset refid="eclispejars2pack"/>
</p200ant>
</target>
</project>
This comes from an example on the following website:
http://www.matthiasmann.de/content/view/20/26/
Source code is available so we could modify and make it do the nesting if we needed too. Also I think we should keep it independent of needing to require OSGI to run, it can be created as a plugin and used as is, but should be able to be used as a standalone ANT jar as well.
Kim can you think of anything that this particular task doesn't do that you guys need it to do?
Since pack200 is sketchy across VMs (eg., pack w/ 1.5, fail to unpack w/ 1.6), and numerous projects have elected to not pack at all... I consider this something not worth worrying about. If you want to fix this, I'll submit you as a committer and you can fix it. :) |
Because packing is done via ant's <java> which calls to a shell script in order to pass params to the pack200 executable, it cannot be run on Windows. If someone wants it to, we'd love a contribution. Here's the workflow as is: 1. In buildAllHelper.xml, we do this: <java jar="${eclipse.home}/plugins/org.eclipse.equinox.launcher.jar" fork="true" timeout="10800000" jvm="${PACK200_JAVA_HOME}/bin/java" failonerror="true" maxmemory="768m" error="${buildDirectory}/errorlog.txt" dir="${buildDirectory}" output="${buildDirectory}/jarprocessorlog.txt" > <jvmarg value="-Dorg.eclipse.update.jarprocessor.pack200=${pack200tmp}" /> <arg line="-consolelog -application org.eclipse.update.core.siteOptimizer" /> <arg line="-jarProcessor -verbose -outputDir ${buildLabel} -processAll -pack ${repack} ${packtmp}/${masterZip}" /> </java> 2. ${pack200tmp} contains two files, pack200 and pack.properties: ----- #!/bin/sh # see http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng.eclipsebuilder/extras/ umask 002; C:/Progra~1/Java/jdk1.6.0_11/jre/bin/pack200 -v -l packlog.txt -E4 -J-Xmx768m $* pack200retCode=$? if [ $pack200retCode != 0 ] then echo "Build failed (error code $retCode)." exit -1 fi ----- pack200.default.args=-E4 pack.excludes=eclipse/plugins/@excludejars@ ----- So, instead of calling pack200 directly, we wrap it with this shell script. On windows, we'd need a batch script instead, or some better way to pass the params to the actual pack200.exe. Contributions welcome.