# [PATCH] test-lib.sh - cygwin does not have usable FIFOs

7 messages from 2013-07-04 to 2013-07-14. Participants: Mark Levedahl, Jonathan Nieder, Torsten Bögershausen.
Thread: https://gitlist.dev/t/34348

## Mark Levedahl, 2013-07-04 22:04

Subject: [PATCH] test-lib.sh - cygwin does not have usable FIFOs
Message-ID: <1372975470-13573-1-git-send-email-mlevedahl@gmail.com>
URL: https://gitlist.dev/e/1372975470-13573-1-git-send-email-mlevedahl%40gmail.com

```
Do not use FIFOs on cygwin, they do not work. Cygwin includes
coreutils, so has mkfifo, and that command does something. However,
the resultant named pipe is known (on the Cygwin mailing list at
least) to not work correctly.

This disables PIPE for Cygwin, allowing t0008.sh to complete (all other
tests in that file work correctly).

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
---
 t/test-lib.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 9753641..2d63307 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -885,7 +885,14 @@ test_i18ngrep () {
 
 test_lazy_prereq PIPE '
 	# test whether the filesystem supports FIFOs
-	rm -f testfifo && mkfifo testfifo
+	case $(uname -s) in
+	CYGWIN*)
+		false
+		;;
+	*)
+		rm -f testfifo && mkfifo testfifo
+		;;
+	esac
 '
 
 test_lazy_prereq SYMLINKS '
-- 
1.8.3.2.0.13

```

## Jonathan Nieder, 2013-07-07 00:55

Subject: Re: [PATCH] test-lib.sh - cygwin does not have usable FIFOs
Message-ID: <20130707005558.GI30132@google.com>
URL: https://gitlist.dev/e/20130707005558.GI30132%40google.com
In-Reply-To: <1372975470-13573-1-git-send-email-mlevedahl@gmail.com>

```
Mark Levedahl wrote:

> Do not use FIFOs on cygwin, they do not work. Cygwin includes
> coreutils, so has mkfifo, and that command does something. However,
> the resultant named pipe is known (on the Cygwin mailing list at
> least) to not work correctly.

Hm.  How would you recommend going about writing a script that takes
output from a command, transforms it, and then feeds it back into
that command's input?  Are sockets a more reliable way to do this kind
of IPC on Cygwin?

See reinit_git and try_dump from t9010-svn-fe.sh for context.

Thanks,
Jonathan

```

## Torsten Bögershausen, 2013-07-07 09:14

Subject: Re: [PATCH] test-lib.sh - cygwin does not have usable FIFOs
Message-ID: <51D93164.8030202@web.de>
URL: https://gitlist.dev/e/51D93164.8030202%40web.de
In-Reply-To: <20130707005558.GI30132@google.com>

```
On 2013-07-07 02.55, Jonathan Nieder wrote:
> Mark Levedahl wrote:
> 
>> Do not use FIFOs on cygwin, they do not work. Cygwin includes
>> coreutils, so has mkfifo, and that command does something. However,
>> the resultant named pipe is known (on the Cygwin mailing list at
>> least) to not work correctly.
> 
> Hm.  How would you recommend going about writing a script that takes
> output from a command, transforms it, and then feeds it back into
> that command's input?  Are sockets a more reliable way to do this kind
> of IPC on Cygwin?
> 
> See reinit_git and try_dump from t9010-svn-fe.sh for context.
> 
> Thanks,
> Jonathan

t9010 needs PIPE in most test cases as a prerequisite.
And if PIPE isn't available, the tests can not be run.

Are you suggesting to replace the named pipes with a TCP socket?

Disabling PIPE under cygwin seems to be the right thing to do,
or do I miss something ?

/Torsten

```

## Mark Levedahl, 2013-07-08 22:18

Subject: Re: [PATCH] test-lib.sh - cygwin does not have usable FIFOs
Message-ID: <51DB3A9F.6020504@gmail.com>
URL: https://gitlist.dev/e/51DB3A9F.6020504%40gmail.com
In-Reply-To: <20130707005558.GI30132@google.com>

```
On 07/06/2013 08:55 PM, Jonathan Nieder wrote:
> Mark Levedahl wrote:
>
>> Do not use FIFOs on cygwin, they do not work. Cygwin includes
>> coreutils, so has mkfifo, and that command does something. However,
>> the resultant named pipe is known (on the Cygwin mailing list at
>> least) to not work correctly.
> Hm.  How would you recommend going about writing a script that takes
> output from a command, transforms it, and then feeds it back into
> that command's input?  Are sockets a more reliable way to do this kind
> of IPC on Cygwin?
>
> See reinit_git and try_dump from t9010-svn-fe.sh for context.
>
> Thanks,
> Jonathan
>

On the one hand, sockets work fine on cygwin so that path would probably 
work.

However, I don't understand why git would need to consume its own output 
- If named pipes are really needed to use git-svn because git-svn 
depends upon git feeding the same git process, then that package should 
not be available on cygwin or any other platform that does not support 
fifos. If not, then I don't think the test suite should require fifos or 
any other construct with the same git process feeding itself either, it 
just blurs the line about what is actually being tested.

Mark

```

## Jonathan Nieder, 2013-07-14 00:57

Subject: Re: [PATCH] test-lib.sh - cygwin does not have usable FIFOs
Message-ID: <20130714005730.GA21033@google.com>
URL: https://gitlist.dev/e/20130714005730.GA21033%40google.com
In-Reply-To: <51DB3A9F.6020504@gmail.com>

```
Mark Levedahl wrote:

> However, I don't understand why git would need to consume its own
> output - If named pipes are really needed to use git-svn because
> git-svn depends upon git feeding the same git process, then that
> package should not be available on cygwin or any other platform that
> does not support fifos.

This isn't about git-svn but about the svn remote helper.  The same
considerations would apply to any other foreign repository importer
that uses "git fast-import --cat-blob-fd".  So I would like to make
sure it is at least possible to support such a thing in the Cygwin
and mingw ports.

>                          If not, then I don't think the test suite
> should require fifos or any other construct with the same git
> process feeding itself either, it just blurs the line about what is
> actually being tested.

I'm not sure I follow.  Are you saying Windows users would never want
to access Subversion repositories?

Thanks,
Jonathan

```

## Jonathan Nieder, 2013-07-14 00:59

Subject: Re: [PATCH] test-lib.sh - cygwin does not have usable FIFOs
Message-ID: <20130714005912.GB21033@google.com>
URL: https://gitlist.dev/e/20130714005912.GB21033%40google.com
In-Reply-To: <51D93164.8030202@web.de>

```
Torsten Bögershausen wrote:

> Disabling PIPE under cygwin seems to be the right thing to do,
> or do I miss something ?

If fifos don't work on Cygwin, disabling that test prerequisite
is defintely the right thing to do.  I was taking the opportunity to
find out whether and how git could be tweaked to avoid needing fifos
when setting pipes up in scripts.

Jonathan

```

## Mark Levedahl, 2013-07-14 15:38

Subject: Re: [PATCH] test-lib.sh - cygwin does not have usable FIFOs
Message-ID: <51E2C5D9.1040405@gmail.com>
URL: https://gitlist.dev/e/51E2C5D9.1040405%40gmail.com
In-Reply-To: <20130714005730.GA21033@google.com>

```
On 07/13/2013 08:57 PM, Jonathan Nieder wrote:
> I'm not sure I follow. Are you saying Windows users would never want 
> to access Subversion repositories? Thanks, Jonathan 
Quite the contrary. SVN and git both work on Windows without having 
POSIX FIFOs  - Windows does have FIFOS, but the semantics are different 
than POSIX and this is why Cygwin's do not work as needed. There is no 
problem having a subprocess with stdin and stdout redirected via 
anonymous pipes to the parent: this is how git runs sub commands and 
works fine. I'm just questioning why this same construct cannot be used 
for the test harness.

Mark

```
