Bug 49969 - property environment sporadically not picking up environment variables
Summary: property environment sporadically not picking up environment variables
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.8.1
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: 1.8.2
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-21 15:35 UTC by wwalsh
Modified: 2010-09-27 11:03 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wwalsh 2010-09-21 15:35:06 UTC
Running Ant 1.8.1 on SUSE Linux Enterprise Server results in sporadically not recognizing <property environment="sysenv."/>; as this (unedited sequence illustrates):

anthill@zlinuxs1:~/JDE015/EJBServer> ant -f test.xml
Buildfile: /home/anthill/JDE015/EJBServer/test.xml

test:
     [echo] ${sysenv.SERVER_DIR}

BUILD SUCCESSFUL
Total time: 23 seconds
anthill@zlinuxs1:~/JDE015/EJBServer> ant -f test.xml
Buildfile: /home/anthill/JDE015/EJBServer/test.xml

test:
     [echo] /home/anthill/JDE015/EJBServer

BUILD SUCCESSFUL
Total time: 20 seconds
anthill@zlinuxs1:~/JDE015/EJBServer> cat test.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="CuramServerBuild" default="test">

  <property environment="sysenv."/>

  <target name="test">
   <echo>${sysenv.SERVER_DIR}</echo>
  </target>

</project>
anthill@zlinuxs1:~/JDE015/EJBServer> ant -version
Apache Ant version 1.8.1 compiled on April 30 2010
anthill@zlinuxs1:~/JDE015/EJBServer> echo $SERVER_DIR
/home/anthill/JDE015/EJBServer

My searches indicate issues around <property environment> failing due to memory issues, but in searching -v output of my failures I have not seen any errors. But, could this be resource-related, failing silently?

This is the environment (SLES 10 SP2), no other platforms at our site have reported this: uname -a
Linux zlinuxs1 2.6.16.60-0.21-default #1 SMP Tue May 6 12:41:02 UTC 2008 s390x s390x s390x GNU/Linux

Thanks,
William
Comment 1 Stefan Bodewig 2010-09-22 03:44:05 UTC
Could you do us a favor and try what I described in http://mail-archives.apache.org/mod_mbox/ant-user/201006.mbox/%3C8739wws7fa.fsf@v35516.1blu.de%3E

Ant's trunk has switched to use System.getenv which may solve your issue, OTOH it may introduce other differences on your OS that we are not yet aware of.
Comment 2 wwalsh 2010-09-23 07:49:51 UTC
I updated 49336 with the results of the test - no differences.

Thanks,
www
Comment 3 Stefan Bodewig 2010-09-27 11:03:00 UTC
Thank you for testing.  This should mean Ant's trunk will work reliably
on your OS.