git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, git-packagers@googlegroups.com,
	git-for-windows@googlegroups.com
Subject: Re: [git-for-windows] Re: [ANNOUNCE] Git v2.16.0-rc1
Date: Wed, 10 Jan 2018 18:54:46 +0100	[thread overview]
Message-ID: <2727bfc6-d789-ee45-fb3b-95b7b21e4cba@kdbg.org> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1801101823420.31@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>

Am 10.01.2018 um 18:37 schrieb Johannes Schindelin:
> On Tue, 9 Jan 2018, Junio C Hamano wrote:
>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>>
>>> diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
>>> index f1678851de9..470107248eb 100644
>>> --- a/t/t0021/rot13-filter.pl
>>> +++ b/t/t0021/rot13-filter.pl
>>> @@ -31,7 +31,22 @@
>>>   #
>>>   
>>>   use 5.008;
>>> -use lib (split(/:/, $ENV{GITPERLLIB}));
>>> +sub gitperllib {
>>> +...
>>> +	if ($ENV{GITPERLLIB} =~ /;/) {
>>> +		return split(/;/, $ENV{GITPERLLIB});
>>> +	}
>>> +	return split(/:/, $ENV{GITPERLLIB});
>>> +}
>>
>> This cannot be the whole story for a few reasons.
>>
>>   - In t/test-lib.sh we see this:
>>
>>     GITPERLLIB="$GIT_BUILD_DIR"/perl/blib/lib:"$GIT_BUILD_DIR"/perl/blib/arch/auto/Git
>>     export GITPERLLIB
>>
>>     If this part wants to split with ';', then the joining needs to
>>     be done with ';' to match, no?
> 
> No.
> 
> It is a lot more complicated than that. As you know, on Linux there is
> this implicit assumption that path lists are colon-separated. As a
> consequence, Cygwin does the same (because it would be too hard to port
> all those Linux/Unix projects to stop assuming colon-separated path lists,
> right?)
> 
> This is what Cygwin's Bash does (and hence the MSYS2 Bash used by Git for
> Windows, too).
> 
> Then the MSYS2 Bash calls git.exe, which is *not* an MSYS2 program, hence
> the MSYS2 runtime knows that it has to convert the path lists to Windows
> paths separated by semicolons.
> 
> The next thing happening in our case is that the Perl script is called
> from git.exe. Now, the MSYS2 runtime (implicitly spun up by the MSYS2 Perl
> interpreter) does *not* convert those path lists back to Unix-like paths
> separated by colons.

But this is a bug in MSYS2, isn't it? The MSYS2 runtime should detect 
that it was not invoked by some other MSYS2 process. The MSYS2 startup 
sequence should assume in this case that the environment is 
Windows-style and convert to POSIX before it calls into perl's main().

> And that's why the Unix shell script can happily construct the
> colon-separated list, and the Perl script will *still* receive the
> semicolon-separated version of it.
> 
>>   - In addition to t0021, there are similar split with colon in 0202,
>>     9000 and 9700, yet I am getting the feeling that you observed the
>>     issue only in0021, to which I do not think of a good explanation
>>     why.
> 
> Here is the good explanation: t0021 relies on a Perl package that is not
> yet installed. t0202 relies on Git::I18N, of which there is a version
> installed in Git for Windows' SDK. (I do not bother to slow down the test
> runs by the Subversion tests, I always skip all of them, that's why t9*
> does not matter to me.)

t0202 and the t9* cases are different because perl is invoked by bash 
directly (AFAICS), without a non-MSYS2 process between them. There is no 
difference when the path conversion is omitted in this case by design or 
due to a bug.

-- Hannes

      reply	other threads:[~2018-01-10 17:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05 23:30 [ANNOUNCE] Git v2.16.0-rc1 Junio C Hamano
2018-01-06 12:59 ` Johannes Schindelin
2018-01-06 22:01   ` Johannes Schindelin
2018-01-09 21:42     ` Junio C Hamano
2018-01-09 23:55       ` Junio C Hamano
2018-01-10 17:40         ` Johannes Schindelin
2018-01-10 20:09           ` Junio C Hamano
2018-01-10 17:37       ` Johannes Schindelin
2018-01-10 17:54         ` Johannes Sixt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2727bfc6-d789-ee45-fb3b-95b7b21e4cba@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git-for-windows@googlegroups.com \
    --cc=git-packagers@googlegroups.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).