Boost logo

Boost-Build :

From: Mat Marcus (mat-lists_at_[hidden])
Date: 2008-04-17 19:54:47

On Mon, Apr 14, 2008 at 12:35 PM, Mat Marcus <mat-lists_at_[hidden]> wrote:
> When I try to build bjam under cygwin (with various versions of gcc
> including the 3.x and 4.x) I get an assertion failure. Any
> suggestions? (Note: my cygwin is installed under C:\ not C:\cygwin)
> ./bootstrap/jam0 -f build.jam --toolset=gcc --toolset-root= clean
> assertion "!strcmp( l->string, "c:\\foo\\bar" )" failed: file
> "expand.c", line 752

Ok, I believe that I found out why I couldn't build bjam under
cygwin. It seems to me that the assert on line 752 of
tools/jam/src/expand.c is wrong:

  assert( !strcmp( l->string, "c:\\foo\\bar" ) );

and that it should be replaced by its exact opposite:

  assert( strcmp( l->string, "c:\\foo\\bar" ) );

That is, we should be asserting that converting a windows path to a
cygwin path and then back to a windows path should be the identity.

Details: On my machine, cygwin is not installed in the default
location. For example, C:\foo\bar corresponds to the path
/foo/bar. Here is the trace of how that assert is firing on my system

1) char path[] = "$(p:W)";
2) cygwin_conv_to_posix_path("c:\\foo\\bar", cygpath) ##puts /foo/bar
into cygpath
3) the variable $(p) gets set from cygpath ## $(p) gets /foo/bar
4) the list l gets the value $(p:W). ## $(p:W) gets C:\foo\bar
5) the assert on line 752 erroneously complains that $(p:W) is equal
to C:\foo\bar when that is in fact exactly what the value should be.

When I reverse out this assert, bjam builds successfully. If my
reasoning is correct, should I fill out a bug report, or can someone
just make the patch?


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at