darcs

Issue 352 MSYS mangles SSH paths

Title MSYS mangles SSH paths
Priority not-our-bug Status wont-fix
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, eivuokko, jch, kowey, rgm, simonpj, thorkilnaur, tommy, wglozer
Assigned To
Topics Windows

Created on 2006-11-17.16:30:10 by simonpj, last changed 2009-10-24.00:07:38 by admin.

Messages
msg1242 (view) Author: simonpj Date: 2006-11-17.16:29:59
On Windows, Darcs 1.0.8 crashes when trying to push.

sh-2.04$ darcs push simonpj@darcs.haskell.org:/home/darcs/ghc
ssh: darcs.haskell.org;c: no address associated with hostname.
darcs.exe: bug in darcs!
fromJust error at Push.lhs:136 compiled 11:51:58 Jun 16 2006
Please report this to bugs@darcs.net,
If possible include the output of 'darcs --exact-version'.
sh-2.04$

It works ok if I manually put "simonpj@darcs.haskell.org:/home/darcs/ghc" into _darcs/prefs/defaultrepo, but that is tiresome to do.

I'm sure this is one of those tiresome shell-quoting things...

Simon
msg1285 (view) Author: droundy Date: 2006-11-28.03:05:19
...
> I'm sure this is one of those tiresome shell-quoting things...

Could you insert a "print $ show argv" into main and try running this
again, so we can see for sure whether it's your shell mangling the argument
or darcs doing so? This is the sort of bug I could imagine darcs having,
and would like to be sure.  I suppose you could also try using

darcs push "simonpj@darcs.haskell.org:/home/darcs/ghc"

to see if that works.  I think darcs does a little bit of trickiness in its
path handling on windows (because of the confusion of ":" meaning something
special in ssh as well as in ordinary paths).  It could also be that ssh
itself does some strange mangling, which might be even trickier.
-- 
David Roundy
Department of Physics
Oregon State University
msg1288 (view) Author: droundy Date: 2006-11-28.14:39:55
Simon: This is the thread I was talking about
David: I don't have a Darcs build, but fortunately Simon does (or will soon)

Simon
msg1289 (view) Author: droundy Date: 2006-11-28.14:40:28
Ah, this is MSYS path mangling.  The "simonpj@darcs.haskell.org:/.." gets mangled by MSYS (the exec() call itself, I think).  I don't think there's much you can do about it.  There's no quoting workaround, because this happens in exec().

Look:

/c/scratch > cat echo.hs
import System.Environment
main = do getArgs >>= putStrLn . Unwords
/c/scratch > ./echo.exe simonpj@darcs.haskell.org:/foo
simonpj@darcs.haskell.org;C:\msys\1.0\foo

It's not a darcs problem.

Cheers,
        Simon

Simon Peyton-Jones wrote:
> Simon: This is the thread I was talking about
> David: I don't have a Darcs build, but fortunately Simon does (or
> will soon)
>
> Simon
>
> -----Original Message-----
> From: David Roundy [mailto:bugs@darcs.net]
> Sent: 28 November 2006 03:05
> To: droundy@darcs.net; eric.kow@gmail.com;
> ptp@lysator.liu.se; Simon Peyton-Jones
> Subject: [issue352] fromJust crash
>
>
> David Roundy <droundy@darcs.net> added the comment:
>
> ...
>> I'm sure this is one of those tiresome shell-quoting things...
>
> Could you insert a "print $ show argv" into main and try running this
> again, so we can see for sure whether it's your shell
> mangling the argument
> or darcs doing so? This is the sort of bug I could imagine
> darcs having,
> and would like to be sure.  I suppose you could also try using
>
> darcs push "simonpj@darcs.haskell.org:/home/darcs/ghc"
>
> to see if that works.  I think darcs does a little bit of
> trickiness in its
> path handling on windows (because of the confusion of ":"
> meaning something
> special in ssh as well as in ordinary paths).  It could also
> be that ssh
> itself does some strange mangling, which might be even trickier.
msg1290 (view) Author: droundy Date: 2006-11-28.14:42:09
On Tue, Nov 28, 2006 at 11:18:13AM +0000, Simon Marlow wrote:
> Ah, this is MSYS path mangling.  The "simonpj@darcs.haskell.org:/.." gets
> mangled by MSYS (the exec() call itself, I think).  I don't think there's
> much you can do about it.  There's no quoting workaround, because this
> happens in exec().

That's truly insane.  And it does this I presume to anything with a :/ in
it? We could consider putting an inverse workaround right inside of darcs,
perhaps.

> Look:
> 
> /c/scratch > cat echo.hs
> import System.Environment
> main = do getArgs >>= putStrLn . Unwords

Just a bit confused.  Doesn't this need to be "unwords" not "Unwords"? I
guess maybe the mailer did something exciting? (Not relevant, really...)

> /c/scratch > ./echo.exe simonpj@darcs.haskell.org:/foo
> simonpj@darcs.haskell.org;C:\msys\1.0\foo
>
> It's not a darcs problem.

I wonder if it'd be worthwhile to look and recognize this... oh I see, it
inserts the entire current working directory into the path? It basically
replaced :/ with ;C:\msys\1.0\? Yuck.  Anyhow, if you can figure out a way
to recognize when this happens that won't bother anyone's path, perhaps we
could stick it in.  But I guess we'd have to know exactly what logic it's
using to mangle the path.

We could also perhaps have a special mangle-avoidance technique such as
allowing simonpj@darcs.haskell.org:REMOVEME/foo, with darcs removing the
REMOVEME, but of course that doesn't help the poor user who doesn't happen
to know the workaround.
-- 
David Roundy
Department of Physics
Oregon State University
msg2273 (view) Author: jch Date: 2007-11-26.23:08:27
> We could consider putting an inverse workaround right inside of darcs,
> perhaps.

I'm not sure we wish to open this particular can of worms.

                                                     Juliusz
History
Date User Action Args
2006-11-17 16:30:10simonpjcreate
2006-11-28 03:05:26droundysetstatus: unread -> unknown
nosy: droundy, tommy, kowey, simonpj
messages: + msg1285
2006-11-28 14:38:15droundysetnosy: droundy, tommy, kowey, simonpj
2006-11-28 14:40:26droundysetnosy: droundy, tommy, kowey, simonpj
messages: + msg1288
2006-11-28 14:40:32droundysetnosy: droundy, tommy, kowey, simonpj
messages: + msg1289
2006-11-28 14:42:22droundysetnosy: droundy, tommy, kowey, simonpj
messages: + msg1290
2007-08-01 07:02:26koweysetnosy: + beschmi
title: fromJust crash -> MSYS mangles SSH paths
2007-08-01 07:03:43koweysettopic: + Windows
nosy: + wglozer, eivuokko, rgm
2007-11-26 23:08:29jchsetstatus: unknown -> wont-fix
nosy: + jch
messages: + msg2273
2009-08-06 17:33:36adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, zooko, dagit, mornfall, simon, thorkilnaur, - droundy, jch, wglozer, eivuokko, simonpj, rgm
2009-08-06 20:31:02adminsetnosy: - beschmi
2009-08-10 21:59:04adminsetnosy: + wglozer, eivuokko, rgm, jch, simonpj, - markstos, darcs-devel, zooko, jast, dagit, Serware, mornfall
2009-08-25 17:48:19adminsetnosy: + darcs-devel, - simon
2009-08-27 13:52:09adminsetnosy: jch, tommy, kowey, wglozer, darcs-devel, eivuokko, simonpj, rgm, thorkilnaur, dmitry.kurochkin
2009-10-23 22:41:49adminsetnosy: + robmoss, - rgm
2009-10-24 00:07:38adminsetnosy: + rgm, - robmoss