Boost logo

Boost-Build :

From: Mat Marcus (mat-lists_at_[hidden])
Date: 2008-04-18 12:52:29


On Fri, Apr 18, 2008 at 8:42 AM, Roland Schwarz
<roland.schwarz_at_[hidden]> wrote:
>
>
> Mat Marcus wrote:
> > Replace line 752 of expand.c in tools/jam/src, which currently reads:
> >
> > assert( !strcmp( l->string, "c:\\foo\\bar" ) );
> >
> > with its opposite:
> >
> > assert( strcmp( l->string, "c:\\foo\\bar" ) );
> >
>
> I tried it out, and the result is as expected:
> It breaks the build for every other.
>
> Mat, I did not try to understand the purpose of this test.
> Perhaps there is still something odd with your setup?

Ok, thanks. Yes, my patch was incorrect. Here's the situation. My
cygwin is rooted at C:\. So on my drive the path "c:\\foo\\bar"
round-trips through a cygwin path back to a windows path at
"C:\\foo\\bar", and the assert fails. I missed the case-sensitive
issue and first and incorrectly transformed the meaning of strcmp in
my mind, since the strings were "obviously equal". After rejecting
solutions involving stricmp (non-portable, and a few other ideas, the
current best that I can come up with is the admittedly ugly:

assert( stricmp( l->string, "c:\\foo\\bar" ) == 0
             || stricmp( l->string, "C:\\foo\\bar" ) == 0);

I can't say whether it is ok to loosen this assert or whether it would
compromise the build system. follows. In case it is of any use in
deciding, from cygwin I can use these four command interchangeably:

ls C:/
ls c:/
ls /cygdrive/C
ls /cygdrive/c

Also:

$ cygpath c:/foo/bar
/foo/bar

$ cygpath C:/foo/bar
/foo/bar

$ cygpath -w /foo/bar
C:\foo\bar

Thoughts?
Mat


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk