Aladdin - Scala Bugtracking
[#557] project: nsc priority: low category: bug
submitter assigned to status date submitted
Francois Gilles fixed 2006-03-23 19:21:17.0
subject faulty memory requirement verification in build.xml
code
huitseeker@norrell:~/Scala/scala$ ant dist 
Buildfile: build.xml
     [echo] Running SABBUS for scala-core...

BUILD FAILED
/home/huitseeker/Scala/scala/build.xml:21: SABBUS requires additional memory. Please set the 'ANT_OPTS' environment
    property to '-Xmx512M' or more.

Total time: 0 seconds
huitseeker@norrell:~/Scala/scala$ export ANT_OPTS='-Xmx128M'
huitseeker@norrell:~/Scala/scala$ ant dist  
what happened
Buildfile: build.xml
     [echo] Running SABBUS for scala-core...

clean.build:
   [delete] Deleting directory /home/huitseeker/Scala/scala/build

init:
     [echo] OS:   UNIX (Linux i386 2.6.14);
     [echo] Java: 1.4.205 ('/usr/java/j2re1.4.205');
     [echo] JVM:  Java HotSpot(TM) Client VM 1.4.2_05-b04;
     [echo] Ant:  Apache Ant version 1.6.5 compiled on February 1 2006.

setup:

build.locker:
    [mkdir] Created dir: /home/huitseeker/Scala/scala/build/locker/library
     [pico] Compiling 36 source files to /home/huitseeker/Scala/scala/build/locker/library
    [starr] Compiling 2 source files to /home/huitseeker/Scala/scala/build/locker/library
    [starr] Compiling 179 source files to /home/huitseeker/Scala/scala/build/locker/library
    [mkdir] Created dir: /home/huitseeker/Scala/scala/build/locker/compiler
     [pico] Compiling 11 source files to /home/huitseeker/Scala/scala/build/locker/compiler
    [starr] Compiling 140 source files to /home/huitseeker/Scala/scala/build/locker/compiler
^T[stopwatch] [timer.locker: 2:33.126 sec]
     [copy] Copying 9 files to /home/huitseeker/Scala/scala/build/locker/compiler

setup.locker:

build:
    [mkdir] Created dir: /home/huitseeker/Scala/scala/build/quick/library
     [pico] Compiling 36 source files to /home/huitseeker/Scala/scala/build/quick/library
   [locker] Compiling 2 source files to /home/huitseeker/Scala/scala/build/quick/library
   [locker] Compiling 179 source files to /home/huitseeker/Scala/scala/build/quick/library
   [locker] java.lang.OutOfMemoryError

BUILD FAILED
what expected Specifying a wrong (insufficient) maximum memory allocation pool size in $ANT_OPTS lets you launch the ant build. The build.xml script should have rejected the build request. The condition currently checking the maximum memory allocation is :
<condition property="memory.set">
    <contains string="${env.ANT_OPTS}" substring="-Xmx"/>
 </condition>
It doesn't check the actual value of the $ANT_OPTS variable. It might be possible to do so through the use of a custom condition : [Ant manual reference link]
[back to overview]
Changes of this bug report
Francois  edited on  2006-03-23 19:21:43.0
Francois  edited on  2006-03-23 19:22:54.0
Gilles  edited on  2006-03-24 17:33:14.0
Bug fixed.