ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45530] New: ANT incorrectly copies env.variables with non-latin text
Date Mon, 04 Aug 2008 02:35:23 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45530

           Summary: ANT incorrectly copies env.variables with non-latin text
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: Timofey.Mokhnatkin@motorola.com


I have Russian WinXP with 2 user accounts: one has Russian name (i.e. contains
cyrillic symbols), another - English; say, "Тимофей" & "Timofey".
Attempt to run Visual Studio 7.1 or 8.0 (devenv.exe, cl.exe or link.exe) via
"exec" task fails under Russian user account because "%USERNAME%" contains some
garbage (incorrectly encoded cyrillic text), and thus %USERPROFILE%, %APPDATA%
point to not existent directory. 

This happens in both cases 
a) when parent process environment is inherited by exec's 
b) when exec creates new environment and %USERNAME% is explicitely copied to
new env.
This results in premanent failure to run my ant task under cyrillic user
account. But forks fine for latin user account. 

sample below demonstrates the case of inherited user environment:
    <target name="build-target" if="target.release.type">
        <mkdir dir="${build.dir}"/>

        <exec executable="cmd" dir="${bsp.root}" 
            newenvironment="false" searchpath="true" failonerror="true">
            <arg value="/c"/>
            <arg value="set"/>
        </exec>
    </target>

OR 

next sample demonstrates creation of new environment:
    <target name="build-target" if="target.release.type">
        <mkdir dir="${build.dir}"/>
        <exec executable="cmd" dir="${bsp.root}" 
            newenvironment="true" searchpath="true" failonerror="true">
            <env key="SystemDrive" value="${env.SystemDrive}"/>
            <env key="SystemRoot" value="${env.SystemRoot}"/>
            <env key="ALLUSERSPROFILE" value="${env.ALLUSERSPROFILE}"/>
            <env key="USERNAME" value="${env.USERNAME}"/>
            <env key="USERPROFILE" value="${env.USERPROFILE}"/>
            <env key="USERDOMAIN" value="${env.USERDOMAIN}"/>
            <env key="APPDATA" value="${env.APPDATA}"/>
            <arg value="/c"/>
            <arg value="set"/>
        </exec>
    </target>


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
Mime
View raw message