Summary: | antRun doesnt work properly on Solaris, so exec with vmlauncher=false is broken | ||
---|---|---|---|
Product: | Ant | Reporter: | moobob42 |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.6.5 | ||
Target Milestone: | --- | ||
Hardware: | Sun | ||
OS: | Solaris |
Description
moobob42
2005-08-24 23:25:13 UTC
Can I follow this up with a couple of questions 1. what version of Java? v1.2 or something newer 2. what happens if you set vmlauncher="false" in the <exec> call #2 tells ant to switch to a shell script to set the dir, instead of using the JRE. Its there for pre-1.3 java, but it could help isolate this problem to the JVM itself, or to ant. (In reply to comment #1) > Can I follow this up with a couple of questions > > 1. what version of Java? v1.2 or something newer Sun's Java: java version "1.2.2" Solaris VM (build Solaris_JDK_1.2.2_10, native threads, sunwjit) I noticed that I get the correct behavior if I use a 5.0 JRE, but see answer to next question: java version "1.5.0_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08) Java HotSpot(TM) Server VM (build 1.5.0_01-b08, mixed mode) > 2. what happens if you set vmlauncher="false" in the <exec> call With the 1.2 JRE, no change in behavior. I get the wrong result either way. With the 5.0 JRE, I get the wrong result if I use vmlauncher="false" but the correct result if I leave it out or set it to true. OK. that narrows the problem down a lot. the v1.2 was the first clue. From 1.2 to 1.3 ant changed how it execs, because you finally got to be able to specify the current dir in exec(). For 1.2, if you specify a new directory, ant runs a shell script, but you only get that script run in java1.3+ if you set vmlauncher=false. not much of one, stripping off the apache copyright it is 8 lines. #! /bin/sh # Args: DIR command cd "$1" CMD="$2" shift shift exec "$CMD" "$@" Try testing it on the command line antRun / ls and antRun /etc ls passwd to see that it is working. Renamed bug for more specificness. There's and no way in Execute.java to allow callers to select a different helper script (like antRun.pl). Thinking of this, there is one workaround. Move $ANT_HOME/bin/antRun and replace it with antRun.pl. You may need to patch the #! path at the top of that file to point to your Perl system, and make the script exectable. |