Bug 753201 - ant doesn't resolve environmental variables in some cases
Summary: ant doesn't resolve environmental variables in some cases
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: ant
Version: 20
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Michael Simacek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-11 15:39 UTC by Caolan McNamara
Modified: 2015-04-09 13:24 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-09 13:24:40 UTC


Attachments (Terms of Use)
sample build.xml (189 bytes, text/xml)
2011-11-11 15:39 UTC, Caolan McNamara
no flags Details

Description Caolan McNamara 2011-11-11 15:39:04 UTC
Created attachment 533096 [details]
sample build.xml

Description of problem:
ant doesn't seem to be able to resolve environment variables (or something clears the env) if the java in use is gcj rather than openjdk

Version-Release number of selected component (if applicable):
ant-1.8.2-3.fc15

How reproducible:
100%

Steps to Reproduce:
1. alternatives --set javac /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/javac
2. ant -f build.xml gives the contents of $USERNAME as expected
3. alternatives --set javac /usr/lib/jvm/java-1.5.0-gcj/bin/javac
4. ant -f build.xml gives "${env.USERNAME}"
  
Actual results:
username

Expected results:
${env.USERNAME} string

Additional info:

Comment 1 Alexander Kurtakov 2011-11-11 19:21:42 UTC
Setting only javac (without java, jar and etc) is crying for problems. I strongly recommend using system-switch-java so all the alternatives will be kept in sync.
Another thing is that I'm not aware of a singel Fedora contributor using gcj for anything else but bootstrapping openjdk. A number of packages are depending on Java 6 features and it's quite possible that some of them are Ant dependencies. 
As I've been looking in most ant issues lately I don't think that ant on gcj deserves my time as long as it works on openjdk.

Comment 2 Caolan McNamara 2011-11-11 20:19:10 UTC
This is a minimal how to reproduce rather than "I spend my time twiddling alternatives for fun to annoy people". The actual problem is "mysterious build failure in koji basically when just requiring generic java-devel less than 1.7.0 getting satisfied by java-1.5.0-gcj which trips up in sucking in environmental variables giving an odd error"

Comment 3 Alexander Kurtakov 2011-11-18 14:49:50 UTC
(In reply to comment #2)
> This is a minimal how to reproduce rather than "I spend my time twiddling
> alternatives for fun to annoy people". The actual problem is "mysterious build
> failure in koji basically when just requiring generic java-devel less than
> 1.7.0 getting satisfied by java-1.5.0-gcj which trips up in sucking in
> environmental variables giving an odd error"

Sorry, if you get my response as personal attack it was not ment to be such. It was just a notice that as one of the very few active ant maintainers I do not care for gcj bugs at all and I can not justify any time spend on it and there are high chances that noone else will respond (sadly :( ) otherwise they would have done that.
If this is the case, your best bet is BR/R: java/java-devel >= 1:1.6.0

Comment 4 Fedora Admin XMLRPC Client 2012-01-11 11:58:29 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Jaromír Cápík 2012-02-01 13:27:51 UTC
Hello Caolan.

I can't reproduce that behavior on F16 and F17.

I get the following in case of both mentioned alternatives when executing the ant build from the regular user account.

     [echo] property is ${env.USERNAME}



And surprisingly when I do 'su' WITHOUT DASH from my regular user account, I get the following for openjdk 1.6.0 ONLY:

     [echo] property is jcapik

whilst gcj-1.5.0 returns:

     [echo] property is ${env.USERNAME}




When I do 'su -', then I get the following in case of both alternatives:

     [echo] property is ${env.USERNAME}



So ... as you see, I get the username filled in correctly ONLY when switched to openjdk 1.6.0 and building with ant executed from 'su'. That means the current behavior might be incorrect. I'll try to do a deeper analysis.

Comment 6 Fedora End Of Life 2012-08-07 19:52:02 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Fedora End Of Life 2013-01-16 22:47:41 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Mikolaj Izdebski 2013-07-02 08:50:05 UTC
Reproducible on Fedora 20.  Because OpenJDK is default Java in Fedora I'm setting priority to low.

Comment 9 Fedora Admin XMLRPC Client 2015-01-27 13:35:27 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 10 Michael Simacek 2015-04-09 13:24:40 UTC
gcj has been retired for a long time. If you can reproduce it without gcj, feel free to repoen this.


Note You need to log in before you can comment on or make changes to this bug.