You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2013/03/31 13:24:47 UTC

svn commit: r1462931 - in /ant/core/trunk: WHATSNEW manual/Tasks/ear.html manual/Tasks/jar.html manual/Tasks/war.html manual/Tasks/zip.html

Author: bodewig
Date: Sun Mar 31 11:24:47 2013
New Revision: 1462931

URL: http://svn.apache.org/r1462931
Log:
Add documentation for zip64mode attribute

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/manual/Tasks/ear.html
    ant/core/trunk/manual/Tasks/jar.html
    ant/core/trunk/manual/Tasks/war.html
    ant/core/trunk/manual/Tasks/zip.html

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1462931&r1=1462930&r2=1462931&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sun Mar 31 11:24:47 2013
@@ -13,6 +13,12 @@ Fixed bugs:
  * Corrected XSLTC error in <junitreport>.
    Bugzilla Report 54641.
 
+ * Provide more control over Zip64 extensions created by <zip> and
+   related tasks.  In particular no Zip64 extensions will be used at
+   all by the <jar> task family by default - this is required for jars
+   to be readably by Java5.
+   Bugzilla Report 54762.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/manual/Tasks/ear.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/manual/Tasks/ear.html?rev=1462931&r1=1462930&r2=1462931&view=diff
==============================================================================
--- ant/core/trunk/manual/Tasks/ear.html (original)
+++ ant/core/trunk/manual/Tasks/ear.html Sun Mar 31 11:24:47 2013
@@ -264,6 +264,15 @@ to a value other than its default, <code
       <em>Since Ant 1.8.0</em>.</td>
     <td align="center" valign="top">No, default is false</td>
   </tr>
+  <tr>
+    <td valign="top">zip64Mode</td>
+    <td valign="top">When to use Zip64 extensions for entries.  The
+      possible values are "never", "always" and "as-needed".
+      <em>Since Ant 1.9.1</em>.
+      <br/>See also the <a href="zip.html#zip64">discussion in the
+      zip task page</a></td>
+    <td align="center" valign="top">No, default is "never"</td>
+  </tr>
 </table>
 
 <h3>Nested elements</h3>

Modified: ant/core/trunk/manual/Tasks/jar.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/manual/Tasks/jar.html?rev=1462931&r1=1462930&r2=1462931&view=diff
==============================================================================
--- ant/core/trunk/manual/Tasks/jar.html (original)
+++ ant/core/trunk/manual/Tasks/jar.html Sun Mar 31 11:24:47 2013
@@ -320,6 +320,15 @@ to a value other than its default, <code
       <em>Since Ant 1.8.0</em>.</td>
     <td align="center" valign="top">No, default is false</td>
   </tr>
+  <tr>
+    <td valign="top">zip64Mode</td>
+    <td valign="top">When to use Zip64 extensions for entries.  The
+      possible values are "never", "always" and "as-needed".
+      <em>Since Ant 1.9.1</em>.
+      <br/>See also the <a href="zip.html#zip64">discussion in the
+      zip task page</a></td>
+    <td align="center" valign="top">No, default is "never"</td>
+  </tr>
 </table>
 
 <h3>Nested elements</h3>

Modified: ant/core/trunk/manual/Tasks/war.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/manual/Tasks/war.html?rev=1462931&r1=1462930&r2=1462931&view=diff
==============================================================================
--- ant/core/trunk/manual/Tasks/war.html (original)
+++ ant/core/trunk/manual/Tasks/war.html Sun Mar 31 11:24:47 2013
@@ -267,6 +267,15 @@ to a value other than its default, <code
       <em>Since Ant 1.8.0</em>.</td>
     <td align="center" valign="top">No, default is false</td>
   </tr>
+  <tr>
+    <td valign="top">zip64Mode</td>
+    <td valign="top">When to use Zip64 extensions for entries.  The
+      possible values are "never", "always" and "as-needed".
+      <em>Since Ant 1.9.1</em>.
+      <br/>See also the <a href="zip.html#zip64">discussion in the
+      zip task page</a></td>
+    <td align="center" valign="top">No, default is "never"</td>
+  </tr>
 </table>
 
 <h3>Nested elements</h3>

Modified: ant/core/trunk/manual/Tasks/zip.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/manual/Tasks/zip.html?rev=1462931&r1=1462930&r2=1462931&view=diff
==============================================================================
--- ant/core/trunk/manual/Tasks/zip.html (original)
+++ ant/core/trunk/manual/Tasks/zip.html Sun Mar 31 11:24:47 2013
@@ -272,6 +272,14 @@ archive.</p>
       <br/>See also the <a href="#encoding">discussion below</a></td>
     <td align="center" valign="top">No, default is false</td>
   </tr>
+  <tr>
+    <td valign="top">zip64Mode</td>
+    <td valign="top">When to use Zip64 extensions for entries.  The
+      possible values are "never", "always" and "as-needed".
+      <em>Since Ant 1.9.1</em>.
+      <br/>See also the <a href="#zip64">discussion below</a></td>
+    <td align="center" valign="top">No, default is "as-needed"</td>
+  </tr>
 </table>
 
 <h3><a name="encoding">Encoding of File Names</a></h3>
@@ -390,6 +398,50 @@ archive.</p>
   so the tools that support them will extract the file names
   correctly.</p>
 
+<h3><a name="zip64">Zip64 extensions</a></h3>
+
+<p>Zip64 extensions provide a way to create archives bigger than 4GB
+  or holding more than 65535 entries - or add individual entries
+  bigger than 4GB using the ZIP extension field mechanism.  These
+  extensions are supported by most modern ZIP implementations.</p>
+
+<p>When Ant writes compressed entries into the archive it creates it
+  doesn't know the compressed size of an entry before it has been
+  written.  Unfortunately the decision whether a Zip64 extra field
+  will be written has to be made before writing the entry's
+  content.</p>
+
+<p>Starting with Ant 1.9.0 Ant supports Zip64 extensions but didn't
+  provide any control over their usage, starting with Ant 1.9.1 a
+  new <em>zip64mode</em> attribute was added to the <code>zip</code>
+  family of tasks.  It supports three values:
+
+<ul>
+  <li><em>never</em> means no Zip64 extra fields will ever be
+    written, this is the behavior of Ant 1.8.x and earlier and the
+    default behavior of <code>jar</code>, <code>ear</code>
+    and <code>war</code> starting with Ant 1.9.1.</li>
+  <li><em>always</em> means Zip64 extra fields are written for all
+    entries.</li>
+  <li><em>as-needed</em> means Zip64 extra fields are written for all
+    compressed entries to the "local file header" (by default these
+    are all files but not the directories) but only written to the
+    central directory if the entry really required Zip64 features.
+    This is the default behavior of Ant 1.9.0 and remains the default
+    behavior of the <code>zip</code> task.</li>
+</ul>
+
+<p><em>as-needed</em> provides a good compromise if you don't know
+  whether you archive will exceed the limits of traditional zip files
+  but don't want to waste too much space (the Zip64 extensions take up
+  extra space).  Unfortunately some ZIP implementations don't
+  understand Zip64 extra fields or fail to parse archives with extra
+  fields in local file headers that are not present in the central
+  directory, one such implementation is the java.util.zip package of
+  Java5, that's why the <code>jar</code> tasks default
+  to <em>never</em>.  Archives created with <em>as-needed</em> can be
+  read without problems with Java6 and later.</p>
+
 <h3>Parameters specified as nested elements</h3>
 
 <h4>any resource collection</h4>



Re: svn commit: r1462931 - in /ant/core/trunk: WHATSNEW manual/Tasks/ear.html manual/Tasks/jar.html manual/Tasks/war.html manual/Tasks/zip.html

Posted by Stefan Bodewig <bo...@apache.org>.
On 2013-03-31, Jesse Glick wrote:

> On 03/31/2013 02:20 PM, Stefan Bodewig wrote:
>>> compressing to a temporary buffer perhaps?

>> We do so for STORED entries and risk OutOfMemoryExceptions (we could
>> throw away the buffer and just count).  The performance impact would be
>> non-trivial for big files, which is what Zip64 really is about.

> Do you know when you start the entry how big it is _uncompressed_?

Not in general - input could be a resource of unknown size - but in most
cases.

> If so, you could say that for anything largish, just compress to a
> temporary file, and then write the entry from that.

Sure, but the performance impact would remain.  Reading 4 GB or more
takes time, writing even more so, and you don't want to do that twice.

> Not sure if such hacks are worth the effort just to support Java 5,
> which is long past EOL anyway.

Agreed.  With the new attribute you have the choice of not supporting
Java5.  What's more, if you really needed Zip64 Java5 (or 6) wouldn't be
able to read the file anyway - Java6 doesn't reject files with Zip64
extensions, it just ignores them.  That's why I've chosen to turn them
off by default in <jar> but left them enabled in <zip>.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: svn commit: r1462931 - in /ant/core/trunk: WHATSNEW manual/Tasks/ear.html manual/Tasks/jar.html manual/Tasks/war.html manual/Tasks/zip.html

Posted by Jesse Glick <jg...@cloudbees.com>.
On 03/31/2013 02:20 PM, Stefan Bodewig wrote:
>> compressing to a temporary buffer perhaps?
>
> We do so for STORED entries and risk OutOfMemoryExceptions (we could
> throw away the buffer and just count).  The performance impact would be
> non-trivial for big files, which is what Zip64 really is about.

Do you know when you start the entry how big it is _uncompressed_? If so, you could say that for anything largish, just compress to a temporary file, and then write the 
entry from that.

Not sure if such hacks are worth the effort just to support Java 5, which is long past EOL anyway.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: svn commit: r1462931 - in /ant/core/trunk: WHATSNEW manual/Tasks/ear.html manual/Tasks/jar.html manual/Tasks/war.html manual/Tasks/zip.html

Posted by Stefan Bodewig <bo...@apache.org>.
On 2013-03-31, Jesse Glick wrote:

> On 03/31/2013 07:24 AM, bodewig@apache.org wrote:
>>> <p>When Ant writes compressed entries into the archive it creates it
>>>  doesn't know the compressed size of an entry before it has been
>>>  written.  Unfortunately the decision whether a Zip64 extra field
>>>  will be written has to be made before writing the entry's
>>>  content.</p>

> Seems like there should be some way around this, by compressing to a
> temporary buffer perhaps?

We do so for STORED entries and risk OutOfMemoryExceptions (we could
throw away the buffer and just count).  The performance impact would be
non-trivial for big files, which is what Zip64 really is about.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: svn commit: r1462931 - in /ant/core/trunk: WHATSNEW manual/Tasks/ear.html manual/Tasks/jar.html manual/Tasks/war.html manual/Tasks/zip.html

Posted by Jesse Glick <ty...@gmail.com>.
On 03/31/2013 07:24 AM, bodewig@apache.org wrote:
> +<p>When Ant writes compressed entries into the archive it creates it
> +  doesn't know the compressed size of an entry before it has been
> +  written.  Unfortunately the decision whether a Zip64 extra field
> +  will be written has to be made before writing the entry's
> +  content.</p>

Seems like there should be some way around this, by compressing to a temporary buffer perhaps?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org