bfgroup / b2

B2 makes it easy to build C++ projects, everywhere.
https://www.bfgroup.xyz/b2/
Boost Software License 1.0
75 stars 228 forks source link

Can't compile and install b2 with b2 #358

Closed rossburton closed 7 months ago

rossburton commented 7 months ago

If I build b2 with b2 (because I want to cross-compile b2), then I can't install it. This reproduces outside of a cross environment too:

$ b2 b2
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: https://www.bfgroup.xyz/b2/manual/release/index.html#bbv2.overview.configuration
...patience...
...found 275 targets...
...updating 71 targets...
gcc.compile.c++ .build/gcc-11/debug/cxxstd-11-iso/threading-multi/src/engine/yyacc.o
gcc.compile.c++ .build/gcc-11/debug/cxxstd-11-iso/threading-multi/src/engine/w32_getreg.o
[ ... ]

At this point there's a freshly built b2 binary at .build/gcc-11/debug/cxxstd-11-iso/threading-multi/b2.

$ b2 install
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: https://www.bfgroup.xyz/b2/manual/release/index.html#bbv2.overview.configuration
error: Unable to find file or target named
error:     '/path/to/b2-5.0.0/src/engine/b2'
error: referred to from project at
error:     '.'

Looks like the jamfile hardcodes the location of the bootstrap build:

install b2-engine
    :   $(SELF)/src/engine/b2$(ext)

Obviously most people will use the bootstrap flow, but if I want a b2 for my cross-compiled target then I should be able to use b2.

grafikrobot commented 7 months ago

Thank you for the report. I resolved it with the assumption that for the cross-compile use case you'll be using target-os=xyz. If your use case is different feel free to re-open and explain further.