You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2006/11/17 15:54:27 UTC

DO NOT REPLY [Bug 40992] New: - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992

           Summary: ENV property of EXEC task must support case insensitive
                    variable names on Windows, either by default or via an
                    extra attribute
           Product: Ant
           Version: 1.6.5
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: seva_ostapenko@hotmail.com


Environment variables are case insensitive on Windows, but ANT ignores that 
fact.
If an environment variable is already defined on the system, ENV property of 
the EXEC tag fails to modify it, if name case does not match.

For example, nls_lang variable is defined at the system level as 
american_america.we8mswin1252.
To perform correct export of data from Oracle, it needs to be set to 
american_america.al32utf8.
<exec executable="exp.exe" failonerror="true">
  <env key="NLS_LANG" value="american_america.al32utf8"/>
  <arg line="scott/tiger file=scott-exp.dmp"/>
</exec>
The above task would fail to change the NLS_LANG variable (because nls_lang 
variable is already defined) and exported data won't be valid (loss of 
localized data and questionable statistics).

If ENV parameter is specified as
  <env key="nls_lang" value="american_america.al32utf8"/>
the variable in question will be properly matched and overwritten.

Unfortunately, there are 128 (2^7) possible ways how the "NLS_LANG" variable 
can be defined on Windows and it's not realistic to "use the right case".

While running on Windows, ANT should defaults to the Windows behavior, or al 
least provide an extra attribute (something like casesensitivity=
{"true"|false"}) to allow case insensitive environment variable match.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992





------- Additional Comments From gudnabrsam@yahoo.com  2006-11-17 07:37 -------
(In reply to comment #1)
> This may seem a silly question, but where in the Win32 API does it say that env
> variables are case insenstive.
> 
> It isnt in 'environement variables':
> http://msdn2.microsoft.com/en-us/library/ms682653.aspx
> 
> it isnt in ::SetEnvironmentVariable
> http://msdn2.microsoft.com/en-us/library/ms686206.aspx
> 
> and it isnt in ::GetEnvironmentVariable 
> http://msdn2.microsoft.com/en-us/library/ms683188.aspx
> 

Googling for: windows "environment variable" "case sensitive" yielded:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992





------- Additional Comments From seva_ostapenko@hotmail.com  2006-11-17 10:54 -------
(In reply to comment #7)
[...]
> It's a duplicate "in a way?"  What way would that be?  As for backporting the
> fix, we don't generally do that.  A backport would amount to a revision, which
> would bump a version number, yielding 1.6.6.  With 1.7.0 in the final stages 
of
> what has been a very long development and release process, such a 1.6.6 
release
> would probably take longer than waiting for 1.7.0 and delay 1.7.0 as well. 
> Sorry for the bad news.
> *** This bug has been marked as a duplicate of 28874 ***

Like the same egg, end-user point of view, I guess?
On 1.6.6: point taken.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992





------- Additional Comments From seva_ostapenko@hotmail.com  2006-11-17 08:12 -------
(In reply to comment #5)
> Great.  Still, this sounds like a duplicate of the bug I mentioned.  So you
> should try the 1.7.0 release candidate to verify.

Yep, it looks like it's fixed in 1.7 RC1. So, it's a dupe of 28874 (in a way).
Is there a change to have this backported to 1.6.5+? 
Switching developers and testers from one ANT version to another is a no 
overnight task. And 1.7.0 is not even released yet.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992





------- Additional Comments From seva_ostapenko@hotmail.com  2006-11-17 11:10 -------
(In reply to comment #8)
> You are of course free to backport the changes yourself, if you think that 
will
> reduce the cost to your project. Just find the SVN commit that fixed the bug,
> apply it to a local copy of the 1.6.5 branch, rebuild and retest. You do have 
to
> recognise that this is now a less-supported release, and unless you have all 
the
> dependencies, bits of ant will be missing.
> I'd recommend trying the upgrade, as now is the best time for regressions. You
> can use the workaround I suggested too, namely 'dont inherit the environment'

Thanks for the suggestion; might be a bit of overkill for a PL/SQL developer 
though :)
Re: newenvironment=true, it's catch 22. At time of the process fork, I know 
only case insensitive names and values of the required evironment variables. 
But the set of the required variables is only a sub-set the set of the 
sufficient variables. To find and set the rest of the values, I need to know 
the exact variable names, 'cause the system treats the names as case 
insensitive, while ANT does not. Alas, the proposed solution does not work.

Workaround in that case is to use external batch as a wrapper for ANT and clear 
variables that are known to belong to the "required set".

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992





------- Additional Comments From stevel@apache.org  2006-11-17 08:51 -------
You are of course free to backport the changes yourself, if you think that will
reduce the cost to your project. Just find the SVN commit that fixed the bug,
apply it to a local copy of the 1.6.5 branch, rebuild and retest. You do have to
recognise that this is now a less-supported release, and unless you have all the
dependencies, bits of ant will be missing.

I'd recommend trying the upgrade, as now is the best time for regressions. You
can use the workaround I suggested too, namely 'dont inherit the environment'

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992


gudnabrsam@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |DUPLICATE




------- Additional Comments From gudnabrsam@yahoo.com  2006-11-17 08:18 -------
(In reply to comment #6)
> (In reply to comment #5)
> > Great.  Still, this sounds like a duplicate of the bug I mentioned.  So you
> > should try the 1.7.0 release candidate to verify.
> 
> Yep, it looks like it's fixed in 1.7 RC1. So, it's a dupe of 28874 (in a way).
> Is there a change to have this backported to 1.6.5+? 
> Switching developers and testers from one ANT version to another is a no 
> overnight task. And 1.7.0 is not even released yet.

It's a duplicate "in a way?"  What way would that be?  As for backporting the
fix, we don't generally do that.  A backport would amount to a revision, which
would bump a version number, yielding 1.6.6.  With 1.7.0 in the final stages of
what has been a very long development and release process, such a 1.6.6 release
would probably take longer than waiting for 1.7.0 and delay 1.7.0 as well. 
Sorry for the bad news.


*** This bug has been marked as a duplicate of 28874 ***

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992





------- Additional Comments From seva_ostapenko@hotmail.com  2006-11-17 07:48 -------
(In reply to comment #3)
Yes, it looks like Win32 API does not provide "case insensitive" option for ::
(Set|Get)EnvironmentVariable() methods.
Yet, the shell and applications treat environment variables as case insensitive.
Which can be relatively easy achived by calling ::GetEnvironmentStrings() first 
and then iterating through the array of strings doing case insensitive 
substring match of the "variable_name"+"=".
I suppose converting the output from ::GetEnvironmentStrings() into a hash 
table ith an upper- or lower-case key is another option.

> (In reply to comment #1)
> > This may seem a silly question, but where in the Win32 API does it say that 
env
> > variables are case insenstive.
> > 
> > It isnt in 'environement variables':
> > http://msdn2.microsoft.com/en-us/library/ms682653.aspx
> > 
> > it isnt in ::SetEnvironmentVariable
> > http://msdn2.microsoft.com/en-us/library/ms686206.aspx
> > 
> > and it isnt in ::GetEnvironmentVariable 
> > http://msdn2.microsoft.com/en-us/library/ms683188.aspx
> > 
> Googling for: windows "environment variable" "case sensitive" yielded:
> http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-
us/ntcmds_shelloverview.mspx?mfr=true

(In reply to comment #1)
> This may seem a silly question, but where in the Win32 API does it say that 
env
> variables are case insenstive.
> It isnt in 'environement variables':
> http://msdn2.microsoft.com/en-us/library/ms682653.aspx
> it isnt in ::SetEnvironmentVariable
> http://msdn2.microsoft.com/en-us/library/ms686206.aspx
> and it isnt in ::GetEnvironmentVariable 
> http://msdn2.microsoft.com/en-us/library/ms683188.aspx
> Now, I can see that echo %PATH% is doing a case insensitive lookup, but unless
> some can show that ::SetEnvironmentVariable and ::GetEnvironmentVariable does
> case sensitive matching, we are left in a bit of a mess. We cannot be sure 
that
> the whole of windows is doing case insensitive matching.
> Why not set newenvironment=true in <exec> and have the old settings lost. You
> need to set up everything (including maybe PATH), but you wont get hurt by any
> existing values?



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992





------- Additional Comments From gudnabrsam@yahoo.com  2006-11-17 07:31 -------
Actually, this is probably a dupe of bug 28874, which is fixed since Ant
1.7.0B2; can we confirm?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992





------- Additional Comments From ddevienne@gmail.com  2006-11-17 08:56 -------
FWIW, Peter and myself discussed this a few weeks ago, and I believe we came up
to the conclusion that some case insensitive handling *was* necessary on
windows, especially when trying to augment Path (or PATH, or path). The case
matters if you have mixed case (yes, it does happen. Some users will use PATH
instead of Path, and the build file uses the other kind). --DD

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992





------- Additional Comments From gudnabrsam@yahoo.com  2006-11-17 07:53 -------
Great.  Still, this sounds like a duplicate of the bug I mentioned.  So you
should try the 1.7.0 release candidate to verify.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40992] - ENV property of EXEC task must support case insensitive variable names on Windows, either by default or via an extra attribute

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40992>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40992


stevel@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From stevel@apache.org  2006-11-17 07:13 -------

This may seem a silly question, but where in the Win32 API does it say that env
variables are case insenstive.

It isnt in 'environement variables':
http://msdn2.microsoft.com/en-us/library/ms682653.aspx

it isnt in ::SetEnvironmentVariable
http://msdn2.microsoft.com/en-us/library/ms686206.aspx

and it isnt in ::GetEnvironmentVariable 
http://msdn2.microsoft.com/en-us/library/ms683188.aspx

Now, I can see that echo %PATH% is doing a case insensitive lookup, but unless
some can show that ::SetEnvironmentVariable and ::GetEnvironmentVariable does
case sensitive matching, we are left in a bit of a mess. We cannot be sure that
the whole of windows is doing case insensitive matching.

Why not set newenvironment=true in <exec> and have the old settings lost. You
need to set up everything (including maybe PATH), but you wont get hurt by any
existing values?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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