git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug: t5813 failing on Cygwin

From
Dennis Kaarsemaker <dennis@kaarsemaker.net>
Date
Nov 7, 2015, 21:02 UTC
Message-ID
<1446930165.16957.9.camel@kaarsemaker.net>
In-Reply-To
<20151107192029.GW14466@dinwoodie.org>
On za, 2015-11-07 at 19:20 +0000, Adam Dinwoodie wrote:
Show 58 quoted lines
> On Sat, Nov 07, 2015 at 01:45:27PM -0500, Jeff King wrote:
> > On Sat, Nov 07, 2015 at 12:11:29PM +0000, Adam Dinwoodie wrote:
> > 
> > > Specifically, I'm seeing t5813 subtests 9-13 and 15-19 failing.
> > > This happens
> > > with a clean build straight from the Git source tree (git clean 
> > > -dfx && make
> > > configure && ./configure && make && cd t && ./t5813-proto-disable
> > > -ssh.sh) as
> > > well as builds using the Cygwin packaging paraphernalia.
> > 
> > What does the output of "./t5813-proto-disable-ssh.sh -v -i" show?
> > 
> > It seems strange that it would fail only on Cygwin; this code
> > doesn't
> > really use any platform-dependent features. It's also weird that it
> > fails _only_ for ssh, and _only_ on the tests that are using
> > "ssh://"
> > URLs are not "host:path" syntax.
> 
> Ah!  I thought I'd checked that already, but looking at the output
> now I
> can see what's going wrong.  Cutting down to the relevant error:
> 
>     ssh: remote git-upload-pack '//home/Adam/vcs/Cygwin-Git/git-2.6.2
> -1.x86_64/build/t/trash directory.t5813-proto-disable
> -ssh/remote/repo.git' fatal: '//home/Adam/vcs/Cygwin-Git/git-2.6.2
> -1.x86_64/build/t/trash directory.t5813-proto-disable
> -ssh/remote/repo.git' does not appear to be a git repository
> 
> Note the '//' at the start of the path -- on most *nix systems '//'
> is
> effectively identical to '/'.  On Cygwin, however, '//' is used to
> access Windows UNC paths: what Windows calls "\\server\share", Cygwin
> calls "//server/share".  If you replace the '//' with '/' you get the
> locatoin of the repository; but here Cygwin is looking for the
> repository in a share called "Adam" on a network server called
> "home"...
> 
> I suspect the correct fix here is to fix whatever's causing Git to
> generate a path with that '//'.  If nobody else gets to it soon
> (probably on the order of a week before I'll get the chance), I'll go
> code diving and submit a patch.
> 
> > I tried building on Linux with the Cygwin build knobs found in
> > config.mak.uname, but I couldn't get it to fail. I also wondered if
> > the
> > test was doing something with the shell that might not be portable,
> > but
> > I don't see anything interesting.
> 
> If I recall correctly, the correct interpretation of '//' isn't
> defined
> in POSIX, so whatever's causing that path to be generated is the bit
> that's not fully portable.  It looks as though t5813 throwing this up
> is
> just a coincidence rather than it being particularly related to the
> function those tests are actually testing.

Looks like lib-proto-disable.sh's fake SSH doesn't strip double leading /'es from the path. Try this patch:

diff --git a/t/t5813-proto-disable-ssh.sh b/t/t5813-proto-disable
-ssh.sh
index ad877d7..a954ead 100755
--- a/t/t5813-proto-disable-ssh.sh
+++ b/t/t5813-proto-disable-ssh.sh
@@ -14,7 +14,7 @@ test_expect_success 'setup repository to clone' '
 '
 
 test_proto "host:path" ssh "remote:repo.git"
-test_proto "ssh://" ssh "ssh://remote/$PWD/remote/repo.git"
-test_proto "git+ssh://" ssh "git+ssh://remote/$PWD/remote/repo.git"
+test_proto "ssh://" ssh "ssh://remote$PWD/remote/repo.git"
+test_proto "git+ssh://" ssh "git+ssh://remote$PWD/remote/repo.git"
 
 test_done
-- 
Dennis Kaarsemaker
www.kaarsemaker.net
Previous: Adam DinwoodieNext: Ramsay Jones
Message 4 of 16 in “Bug: t5813 failing on Cygwin”
  1. Adam DinwoodieNov 7, 2015
  2. Jeff KingNov 7, 2015
  3. Adam DinwoodieNov 7, 2015
  4. Dennis KaarsemakerNov 7, 2015
  5. Ramsay JonesNov 7, 2015
  6. Ramsay JonesNov 7, 2015
  7. Dennis KaarsemakerNov 7, 2015
  8. Ramsay JonesNov 8, 2015
  9. Torsten BögershausenNov 8, 2015
  10. Adam DinwoodieNov 7, 2015
  11. Jeff KingNov 8, 2015
  12. t5813: avoid creating urls that break on cygwinDennis Kaarsemaker, Nov 8, 2015
  13. Jeff KingNov 9, 2015
  14. t5813: avoid creating urls that break on cygwinDennis Kaarsemaker, Nov 9, 2015
  15. Jeff KingNov 9, 2015
  16. Ramsay JonesNov 8, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.