Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtYO0-0005r8-Gv for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2020 15:22:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtYNz-0007vZ-9R for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2020 15:22:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtYNz-0007vR-2j for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2020 15:22:55 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jtYNw-0004Ks-FP for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2020 15:22:53 +0000 Received: by mail-qt1-x843.google.com with SMTP id w27so1926939qtb.7 for ; Thu, 09 Jul 2020 08:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=0/7xiOnhnSa5MtUErIyu5MXkdbPSJlzaoNU+LbaWXCk=; b=mdgv+ZNeVJbKHjr6MRBrKGBtIXEtJFOk4N6HF/2j+YljMTLiGWwRtaXdOJlklUl+yn i/p9kIO95hrhyQX7gCbnNR68yILWW2dnQXmuyMJ4HQVp4geGNQHD6Zi2ggpB32rdfGcJ o6pWbKb1yk8mlJDWfQpfqeAy4zJXOjBY+lkXOu5gtKd7IKRHlw4L4c3+rP5Sd3+X9iYB xdPMjw3a3wqIMcjbs56RQV4r5yoDaMh02OLazelGW87N07XPz5p5ZrWc72eoPYwzVXNk wKRhopAqzRuJn+t0K7jhRL/sxcpIaxMDQ2Aj4sr54yUlPRipFqDcLodvrup2Ib2p1N+8 Sh0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=0/7xiOnhnSa5MtUErIyu5MXkdbPSJlzaoNU+LbaWXCk=; b=T/h4xkDUhWFtV3jOLpCFqC3Nvs5TwMhfASqqJ5lYL6zPBF7PafbOlb53/xanv7Orzm Q5vyH2iWSBcYmnJJ9M1MfeCgeFYaZncwvXgDvUj4ctRXksVzb+NC1rpUj9XgeD0TdWK/ yEN6wamolb4rixRWN87PxK6ctoAxxiY3vRgW86/ZYFbLSIjcmb0Oryk75R6rjQCnicHy vzXLroEEG0/Y0Ez6Rh+i/FSKTmPSyBQgrqs54xKSOH9a2vIOZD+HaLvbUGJ1eSRxh5Sv lyy71SmaKDIWYYILUHo5PeCvGIMgxknQs46VGngOExbQIq9GradzT+m5nhIpwKmoGn87 pfEA== X-Gm-Message-State: AOAM531rz5isb0yB95na9525IWZEHft30nmRuZV7cCZlEzneJSuZYKvk p/D+KlMx6Ebyp++5qfx6iIzJFXSbTuf9xUVFR/b3Nauizx8n0k0O4ZX1OTv/zUXjtE9/9f09irw ldQ/OXg1cIKscEtVuckPi7PxPzk4hJnKhLuGb7qbP+Gps1SsjfrOi2P+j2aYGkYekGFtB6nF0I8 TTwf4aDDUfPbw9dE+VNdPu X-Google-Smtp-Source: ABdhPJxSUJzkZThiBf/u4eRoZDfeptFjwZDlwuLc1NpzDmSirjFYpodL4ckpCwkAgYizenbCfw8w/Q== X-Received: by 2002:ac8:2b98:: with SMTP id m24mr66559194qtm.7.1594308165104; Thu, 09 Jul 2020 08:22:45 -0700 (PDT) Received: from ?IPv6:2600:1700:722:4630::43? ([2600:1700:722:4630::43]) by smtp.gmail.com with ESMTPSA id j45sm3711037qtk.31.2020.07.09.08.22.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jul 2020 08:22:44 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: Is this a bug in pg_current_logfile() on Windows? To: Tom Lane Cc: Thomas Kellerer , pgsql-hackers@lists.postgresql.org References: <412ae8da-76bb-640f-039a-f3513499e53d@gmx.net> <1716646.1594226496@sss.pgh.pa.us> <1733826.1594243608@sss.pgh.pa.us> <252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com> <1739104.1594250997@sss.pgh.pa.us> <1777519.1594262442@sss.pgh.pa.us> <1818128.1594305850@sss.pgh.pa.us> <1819000.1594307053@sss.pgh.pa.us> Autocrypt: addr=andrew.dunstan@2ndQuadrant.com; prefer-encrypt=mutual; keydata= mQENBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0DGJCR/iUOl/N62Kh4855zZC7NHIjQHPOvV5Stz/l5ilDhvGVk+xkXFPys SjZoUr1rXhYLpiyi5sR0X9FHXT0KnGuz1F5ERO7ZTLSSQ6fJwPj6gOk9K+vvoKvoeql5ABEB AAG0L0FuZHJldyBEdW5zdGFuIDxhbmRyZXcuZHVuc3RhbkAybmRRdWFkcmFudC5jb20+iQFY BBMBAgBCAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgBYhBOQ+WEYd/Hy/RGkVpZn6f8tZ /DuBAhkBBQJd1pSYBQkSzqMsAAoJEJn6f8tZ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xrjku8ty9TZJVsaRXnS+OFQzXz9Eu2wTpKdHij46uY Message-ID: Date: Thu, 9 Jul 2020 11:22:43 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <1819000.1594307053@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/9/20 11:04 AM, Tom Lane wrote: > Andrew Dunstan writes: >> On 7/9/20 10:44 AM, Tom Lane wrote: >>> Andrew Dunstan writes: >>>> On 7/8/20 10:40 PM, Tom Lane wrote: >>>>> The most likely theory about that, I think, is that IPC::Run::run already >>>>> translated any \r\n occurrences in the psql command's output to plain \n. >>> It's not hard to believe that the latter two are using a different libc >>> implementation, but how would that affect the behavior of the TAP >>> infrastructure? Are they also using different Perls? (By hypothesis, >>> the pg_current_logfile bug exists across all Windows builds, so we have >>> to explain why the TAP tests only reveal it on some of these animals.) >> But the perls they are using are indeed different - msys animals have to >> use msys' perl for TAP tests because native perl doesn't understand msys >> file paths. Conversely, MSVC animals must use native perl (AS or >> Strawberry) to run TAP tests. So jacana and fairywren, the two msys >> animals, are doing what you expect5ed and drongo and bowerbird, the two >> MSVC animals, are not. > Ah-hah. So this leads to the conclusion that in native perl, IPC::Run > is doing \r\n conversion for us while in msys perl it is not. > > Therefore, we either should figure out how to get msys perl to do > that conversion (and remove it from our code altogether), or make the > conversions conditional on "is it msys perl?". I am not quite sure > if the existing tests "if $Config{osname} eq 'msys'" are a legitimate > implementation of that condition or not --- it seems like nominally > they are checking the OS not the Perl, but maybe it's close enough. > > If the reported OS is msys (it's a pseudo OS in effect) then the perl must be msys' perl. Even when called from msys, native perl reports the OS as MSWin32. So yes, close enough. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services