delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/02/21/14:20:41

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_LOW,TW_KL,T_FRT_PROFIT2
X-Spam-Check-By: sourceware.org
Message-ID: <4F43EE3C.6030306@cwilson.fastmail.fm>
Date: Tue, 21 Feb 2012 14:19:24 -0500
From: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
Reply-To: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Environment passing bug?
References: <4F42D201 DOT 4000901 AT cwilson DOT fastmail DOT fm> <20120221095025 DOT GD22597 AT calimero DOT vinschen DOT de>
In-Reply-To: <20120221095025.GD22597@calimero.vinschen.de>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 2/21/2012 4:50 AM, Corinna Vinschen wrote:
> On Feb 20 18:06, Charles Wilson wrote:
>> I've observed different behavior with cygwin-1.7.0 on 64bit XP, and
>> 32bit XP (I'll check Vista-32 and W7-64 later tonight).  Using the
>> following attached win32 program:
>>
>> $ i686-pc-mingw32-gcc -o envprint envprint.c
>>
>> ====== xp-64 ========
>> $ uname -a
>> CYGWIN_NT-5.2-WOW64 abcdefgh 1.7.10(0.259/5/3) 2012-02-05 12:36 i686 Cygwin
>>
>> $ ./envprint | grep -i temp
>> 'TEMP=C:\cygwin\tmp'
>> ====== xp-64 ========
>>
>>
>>
>> ====== xp-32 ========
>> $ uname -a
>> CYGWIN_NT-5.1 ijklmnopq 1.7.10(0.259/5/3) 2012-02-05 12:36 i686 Cygwin
>>
>> $ ./envprint | grep -i temp
>> 'TEMP=C:\cygwin\tmp'
>> 'temp=C:\TEMP'
>> 'tmp=C:\TEMP'
>> ====== xp-32 ========
> 
> What I'm missing here is the information how the environment looks
> like in terms of the TMP/TEMP variables *before* calling envprint.
> Without this the testcase is rather incomplete.
> 
> For testing I did
> 
>   tcsh$ setenv TEMP /tmp
>   tcsh$ setenv TMP /tmp
>   tcsh$ ./envprint | grep -i tmp
>   'TEMP=C:\cygwin\tmp'
>   'TMP=C:\cygwin\tmp'
> 
> same result on 32 bit W7 and 64 bit W2K8R2.

Ah -- well, in both cases I have the same settings in the Windows
Environment, and <strikeout>am using the stock /etc/profile files to set
those values.</strikeout> So, from the cygwin standpoint:

====== xp-64 ========
$ printf "'%s'\n'%s'\n'%s'\n'%s'\n'%s'\n'%s'\n" "$TEMP" "$TMP" "$TMPDIR"
$temp $tmp $tmpdir
'/tmp'
'/tmp'
''
''
''
''
====== xp-64 ========

====== xp-32 ========
'/tmp'
'/tmp'
''
'C:\TEMP'
'C:\TEMP'
''
====== xp-32 ========

Well, now...that's odd.  Oh, here it is -- my /etc/profile on the 64bit
machine is NOT in sync with the /etc/defaults version, while on the
32bit machine the "real" profile matches the "defaults" copy.

$ diff /etc/defaults/etc/profile /etc/profile|diffstat
 unknown |   71
++++++++++++++++++++++++----------------------------------------

Looks like I edited it sometime during 4.0-4...

< # base-files version 4.0-9
---
> # base-files version 4.0-4


So...at least now I can establish that, using *current* /etc stuff, I
get the same behavior on 64 as on 32:

====== xp-64 ========
$ printf "'%s'\n'%s'\n'%s'\n'%s'\n'%s'\n'%s'\n" "$TEMP" "$TMP" "$TMPDIR"
$temp $tmp $tmpdir
'/tmp'
'/tmp'
''
'C:\Temp'
'C:\Temp'
''

$ ./envprint.exe  | grep -i temp
'TEMP=C:\cygwin\tmp'
'temp=C:\Temp'
'tmp=C:\Temp'
====== xp-64 ========

...and the only mystery now is how my $ATWORK stuff should deal with the
fact that there are TWO different copies of the "same" variable in the
environment, if the $TESTAPP is started from cygwin rather than plan old
dosbox.

...or, is it possible that cygwin should not export both copies of
TEMP/temp, TMP/tmp when spawning a native process?

--
Chuck

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019