From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by sourceware.org (Postfix) with ESMTPS id DBD3F3857C7F for ; Fri, 19 Mar 2021 13:35:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DBD3F3857C7F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=anrdaemon@yandex.ru Received: from myt6-722f198f7b2f.qloud-c.yandex.net (myt6-722f198f7b2f.qloud-c.yandex.net [IPv6:2a02:6b8:c12:4e10:0:640:722f:198f]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 9376D3C00A1E; Fri, 19 Mar 2021 16:35:02 +0300 (MSK) Received: from myt6-efff10c3476a.qloud-c.yandex.net (myt6-efff10c3476a.qloud-c.yandex.net [2a02:6b8:c12:13a3:0:640:efff:10c3]) by myt6-722f198f7b2f.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 0ljUzEiT4H-Z2H8Pvat; Fri, 19 Mar 2021 16:35:02 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1616160902; bh=mZWl44h4fGbfld17HTfHtTem8E0/HbwXkkKveWkLeKk=; h=In-Reply-To:Subject:To:From:Message-ID:References:Date:Reply-To; b=qwKkwZepUQExr3wYI4bnmybxi2rr/gpuDUN55S7iY5gSiC3Hi3POKFBnYRIN8d68u +DliNLcDAQ5hCL8UjdObdzStw6MC3BLKnxJha2Ykg9B3pntRBX8bZoSeukt4qK9KV6 7TD8Q6rs3pMiJa2sR3oizIZsZXs93L9Z6wcBfdqg= Authentication-Results: myt6-722f198f7b2f.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt6-efff10c3476a.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id bKQ7c7tsk3-Z1J8KXjr; Fri, 19 Mar 2021 16:35:01 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Fri, 19 Mar 2021 13:29:23 -0000 Date: Fri, 19 Mar 2021 16:29:23 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home Reply-To: cygwin@cygwin.com X-Priority: 3 (Normal) Message-ID: <691553387.20210319162923@yandex.ru> To: L A Walsh , cygwin@cygwin.com Subject: Re: Different symlink resolution in native console vs. terminal In-Reply-To: <6050B3DF.2090805@tlinx.org> References: <837599661.20210311015158@yandex.ru> <6050B3DF.2090805@tlinx.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2021 13:35:07 -0000 Greetings, L A Walsh! > On 2021/03/10 14:51, Andrey Repin wrote: >> Running `pwd -P` or `readlink -e .` in a specific directory from native >> terminal provide unresolved answers. >> >> The directory $HOME/Documents/EVE is a symlink pointing to $HOME\Documents\Games\EVE. >> >> When running either command inside the directory from native terminal, the >> result is literally /home/Documents/EVE, but when running the same command >> from mintty inside same directory, the results may vary. >> >> $HOME/Documents/EVE or $HOME/Documents/Games/EVE (which is expected answer). >> It also seems, there are results difference between `bash -l` `and bash -i` >> and `pwd -P` and `readlink -e .`. >> Generally, "pwd" is more correct. >> > 1) When you look at the processes(native v mintty), are both the > same #bits? Interesting question. Originally I tested in 32-bit console, but it seems this is not relevant. $ START "" "%SystemRoot%\sysnative\cmd.exe" $ CD /D "%USERPROFILE%\Documents\EVE" $ readlink -e . /home/anrdaemon/Documents/EVE There's even MORE interesting sequence: [anrdaemon@DAEMON2 C:\Users\anrdaemon\Documents\EVE] $ bash -i anrdaemon@daemon2:cygwin:~/Documents/EVE $ readlink -e . /home/anrdaemon/Documents/EVE anrdaemon@daemon2:cygwin:~/Documents/EVE $ cd "$( pwd )" anrdaemon@daemon2:cygwin:~/Documents/EVE $ readlink -e . /home/anrdaemon/Documents/Games/EVE > 2) Can you reproduce this with any other dir? In fact. I picked a directory outside Cygwin mount table for this test: [anrdaemon@DAEMON2 C:\] $ MKLINK /J "C:\Games\KP2" "C:\Games\_old\KP2" Junction created for C:\Games\KP2 <<===>> C:\Games\_old\KP2 [anrdaemon@DAEMON2 C:\Games] $ CD /D "C:\Games\KP2" [anrdaemon@DAEMON2 C:\Games\KP2] $ pwd -P /c/Games/KP2 [anrdaemon@DAEMON2 C:\Games\KP2] $ readlink -e . /c/Games/KP2 [anrdaemon@DAEMON2 C:\Games\KP2] $ bash -i anrdaemon@daemon2:cygwin:/c/Games/KP2 $ pwd -P /c/Games/_old/KP2 anrdaemon@daemon2:cygwin:/c/Games/KP2 $ readlink -e . /c/Games/KP2 anrdaemon@daemon2:cygwin:/c/Games/KP2 $ cd "$( pwd )" anrdaemon@daemon2:cygwin:/c/Games/KP2 $ pwd -P /c/Games/_old/KP2 anrdaemon@daemon2:cygwin:/c/Games/KP2 $ readlink -e . /c/Games/_old/KP2 However, the C:\Games is a volume mount point. May be that is a problem? Another test, this time no external factors, all directories in path are real: [anrdaemon@DAEMON2 C:\] $ MKLINK /J "C:\dev\php" "C:\dev\temp\install\php" [anrdaemon@DAEMON2 C:\] $ CD /D "C:\dev\php" [anrdaemon@DAEMON2 C:\dev\php] $ pwd -P /c/dev/php [anrdaemon@DAEMON2 C:\dev\php] $ readlink -e . /c/dev/php > Both Documents and Games have multiple copies due to the public > docs+games are in the docs+games library (along with user versions). As shown in the tests, this is not really a problem. > Maybe the winterm is picking up a different file? Eh? Terminal is just a display. > I think one or both of those dirs have a GUID associated with them, maybe > one is using a different GUID than the other? ??? > I also have Win7x64 but have never seen them misbehaving... > How was your link made? EVE is a symlink, but junctions behaving just the same and do not require elevation to create. -- With best regards, Andrey Repin Friday, March 19, 2021 15:49:11 Sorry for my terrible english...