Closed Kojoley closed 5 years ago
The same thing is with multiple stdcxx
. I understand that staging with multiple toolsets/stdcxx is not possible, but the problem is that I cannot test the libraries too if the tests have dependencies on buildable libraries.
Can you post your user-config.jam and project-config.jam (if any). And the output when using the above options with --debug-configuration
.
./b2 toolset=clang-3.8,clang-7 --debug-configuration
no user-config.jam
project-config.jam.txt
log.txt
Looking at your project-config and log I see the problem. You do not have multiple toolsets configured. For msvc this works as it defaults to discovering and configuring all available msvc installed toolsets. For other toolsets you need to specify them if it's more than one and not trivially discovered (i.e. it's g++ or clang++ in the path). The usual place to do that is in user-config.jam.
You do not have multiple toolsets configured.
nick@nick-debian:~/boost-root$ clang++-7 --version
clang version 7.0.1-svn348686-1~exp1~20190111074544.62 (branches/release_70)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
nick@nick-debian:~/boost-root$ clang++-6.0 --version
clang version 6.0.1-svn334776-1~exp1~20190123223524.117 (branches/release_60)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
nick@nick-debian:~/boost-root$ clang++-5.0 --version
clang version 5.0.2-svn328729-1~exp1~20180509123438.100 (branches/release_50)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
user-config.jam
import toolset ;
using clang : 5.0 : clang++-5.0 ;
using clang : 6.0 : clang++-6.0 ;
using clang : 7 : clang++-7 ;
same project-config.jam.txt
./b2 toolset=clang-5.0,clang-6.0,clang-7 --debug-configuration
log.txt
./b2 toolset=clang-6.0,clang-7 --debug-configuration
log.txt
The more surprising thing: Spirit examples have a name clash https://github.com/boostorg/spirit/blob/c36e74be1bd0b00b1b01f0bd5f33494f0274558c/example/qi/compiler_tutorial/Jamfile#L10-L11 but it is not detected when only Clangs or GCCs used (./b2 toolset=clang-6.0,clang-7 libs/spirit/example
or ./b2 toolset=gcc,gcc-6 libs/spirit/example
), but is detected when trying simultaneously Clang and GCC (./b2 toolset=gcc-6,clang-7.0 libs/spirit/example
)
error: Name clash for '<plibs/spirit/example/qi/compiler_tutorial/bin/debug>calc1'
error:
error: Tried to build the target twice, with property sets having
error: these incompatible properties:
error:
error: - <toolset-gcc:version>6 <toolset>gcc
error: - <toolset-clang:platform>linux <toolset-clang:version>7 <toolset>clang
error:
error: Please make sure to have consistent requirements for these
error: properties everywhere in your project, especially for install
error: targets.
FYI: I removed the name clash on develop https://github.com/boostorg/spirit/commit/5c1430406834967b1774e83d9ff11d0d1a44e861
This is a likely a manifestation of the same problem as in #404 and #410 - the toolsets assume that the relevant portions of the version are major.minor, but since gcc 5 and clang 7 it's just major. (Actually for clang it's more convoluted because for clang 4-6 only the major version is relevant but the command is still clang++-4.0, whereas for 7 the command has been changed to clang++-7.)
AMDG
This isn't a problem with Boost.Build. It's a problem with a specific project. You haven't indicated which project you're trying to build (although from the logs, it looks like you're running b2 at the top level).
I understand that staging with multiple toolsets/stdcxx is not possible
It looks like that's exactly what you're trying to do.
but the problem is that I cannot test the libraries too if the tests have dependencies on buildable libraries.
I can run $ cd status $ b2 clang gcc
without any problem.
In Christ, Steven Watanabe
This isn't a problem with Boost.Build. It's a problem with a specific project. You haven't indicated which project you're trying to build (although from the logs, it looks like you're running b2 at the top level).
Yes, I am building top level. I need to build all non-header-only libraries before testing, because I run tests with warnings-as-errors=on
(library maintainers do not bother fixing warnings in non headers).
I can run $ cd status $ b2 clang gcc
without any problem.
b2 clang gcc
you need to have multiple GCCs here or multiple Clangs to trigger the issue, alternatively you can use cxxstd b2 toolset=clang cxxstd=03,11
The problem seems to be that for some reason staging is happening even if I do not supply stage
to b2, with MSVC the problem does not show up because library names contain VC version.
stage
is default from top level.
stage
is default from top level.
Interesting. I do not understand why. I searched for option to disable staging and did not find it.
@Kojoley you also don't need to build anything at the top level if what you are doing is running tests from the status dir.
@Kojoley you also don't need to build anything at the top level if what you are doing is running tests from the status dir.
Look, I do this b2 toolset=$TOOLSET cxxstd=$CXXSTD warnings=on warnings-as-errors=on libs/spirit/test
and I am getting errors from .cpp
files from Thread and other libraries, because of that I have to make b2 toolset=$TOOLSET cxxstd=$CXXSTD warnings=off
before running the tests. Now I want to test multiple toolsets/stdcxxs simultaniously within one travis job, I of course can do for CURSTDXX in ${CXXSTD//,/$IFS}; do ./b2 toolset=$TOOLSET cxxstd=$CURSTDXX warnings=off; done
but it is ugly.
I'd tell you to use --layout=versioned but cxxstd doesn't get encoded. :-/
AMDG
On 3/12/19 12:47 PM, Nikita Kniazev wrote:
@Kojoley you also don't need to build anything at the top level if what you are doing is running tests from the status dir.
Look, I do this
b2 toolset=$TOOLSET cxxstd=$CXXSTD warnings=on warnings-as-errors=on libs/spirit/test
and I am getting errors from.cpp
files from Thread and other libraries, because of that I have to makeb2 toolset=$TOOLSET cxxstd=$CXXSTD warnings=off
before running the tests. Now I want to test multiple toolsets/stdcxxs simultaniously within one travis job, I of course can dofor CURSTDXX in ${CXXSTD//,/$IFS}; do ./b2 toolset=$TOOLSET cxxstd=$CURSTDXX warnings=off; done
but it is ugly.
If you know which libraries you need, you can use:
DEPLIBS=thread ./b2 toolset=$TOOLSET cxxstd=$CXXSTD $DEPLIBS
In Christ, Steven Watanabe
Coqui:develop grafik$ b2 toolset=gcc,clang gcc cxxstd=11,14 warnings=on warnings-as-errors=on libs/spirit/test -n -a
Performing configuration checks
- default address-model : 64-bit
- default architecture : x86
- symlinks supported : yes
- Boost.Config Feature Check: cxx14_decltype_auto : no
- Boost.Config Feature Check: cxx14_generic_lambdas : no
- Boost.Config Feature Check: cxx14_return_type_deduction : no
- Boost.Config Feature Check: cxx14_variable_templates : no
- Boost.Config Feature Check: cxx14_decltype_auto : no
- Boost.Config Feature Check: cxx14_generic_lambdas : no
- Boost.Config Feature Check: cxx14_return_type_deduction : no
- Boost.Config Feature Check: cxx14_variable_templates : no
- Boost.Config Feature Check: cxx14_decltype_auto : yes
- Boost.Config Feature Check: cxx14_generic_lambdas : yes
- Boost.Config Feature Check: cxx14_return_type_deduction : yes
- Boost.Config Feature Check: cxx14_variable_templates : yes
- Boost.Config Feature Check: cxx14_decltype_auto : yes
- Boost.Config Feature Check: cxx14_generic_lambdas : yes
- Boost.Config Feature Check: cxx14_return_type_deduction : yes
- Boost.Config Feature Check: cxx14_variable_templates : yes
- default address-model : 64-bit
- default architecture : x86
- Boost.Config Feature Check: cxx14_decltype_auto : no
- Boost.Config Feature Check: cxx14_generic_lambdas : no
- Boost.Config Feature Check: cxx14_return_type_deduction : no
- Boost.Config Feature Check: cxx14_variable_templates : no
- Boost.Config Feature Check: cxx14_decltype_auto : no
- Boost.Config Feature Check: cxx14_generic_lambdas : no
- Boost.Config Feature Check: cxx14_return_type_deduction : no
- Boost.Config Feature Check: cxx14_variable_templates : no
- Boost.Config Feature Check: cxx14_decltype_auto : yes
- Boost.Config Feature Check: cxx14_generic_lambdas : yes
- Boost.Config Feature Check: cxx14_return_type_deduction : yes
- Boost.Config Feature Check: cxx14_variable_templates : yes
- Boost.Config Feature Check: cxx14_decltype_auto : yes
- Boost.Config Feature Check: cxx14_generic_lambdas : yes
- Boost.Config Feature Check: cxx14_return_type_deduction : yes
- Boost.Config Feature Check: cxx14_variable_templates : yes
...patience...
...found 10189 targets...
...updating 8368 targets...
common.mkdir bin.v2/libs/spirit
mkdir -p "bin.v2/libs/spirit"
common.mkdir bin.v2/libs/spirit/test
[snip]
...updated 8368 targets...
Coqui:develop grafik$
That's without actually building. Hence the problem is not the build system, AFAICT. But to be sure.. Here's what I get when building the above:
Coqui:develop grafik$ b2 toolset=gcc,clang gcc cxxstd=11,14 warnings=on warnings-as-errors=on libs/spirit/test -a -j8
Performing configuration checks
- default address-model : 64-bit
- default architecture : x86
- symlinks supported : yes
- Boost.Config Feature Check: cxx14_decltype_auto : no
- Boost.Config Feature Check: cxx14_generic_lambdas : no
- Boost.Config Feature Check: cxx14_return_type_deduction : no
- Boost.Config Feature Check: cxx14_variable_templates : no
- Boost.Config Feature Check: cxx14_decltype_auto : no
- Boost.Config Feature Check: cxx14_generic_lambdas : no
- Boost.Config Feature Check: cxx14_return_type_deduction : no
- Boost.Config Feature Check: cxx14_variable_templates : no
- Boost.Config Feature Check: cxx14_decltype_auto : yes
- Boost.Config Feature Check: cxx14_generic_lambdas : yes
- Boost.Config Feature Check: cxx14_return_type_deduction : yes
- Boost.Config Feature Check: cxx14_variable_templates : yes
- Boost.Config Feature Check: cxx14_decltype_auto : yes
- Boost.Config Feature Check: cxx14_generic_lambdas : yes
- Boost.Config Feature Check: cxx14_return_type_deduction : yes
- Boost.Config Feature Check: cxx14_variable_templates : yes
- default address-model : 64-bit
- default architecture : x86
- Boost.Config Feature Check: cxx14_decltype_auto : no
- Boost.Config Feature Check: cxx14_generic_lambdas : no
- Boost.Config Feature Check: cxx14_return_type_deduction : no
- Boost.Config Feature Check: cxx14_variable_templates : no
- Boost.Config Feature Check: cxx14_decltype_auto : no
- Boost.Config Feature Check: cxx14_generic_lambdas : no
- Boost.Config Feature Check: cxx14_return_type_deduction : no
- Boost.Config Feature Check: cxx14_variable_templates : no
- Boost.Config Feature Check: cxx14_decltype_auto : yes
- Boost.Config Feature Check: cxx14_generic_lambdas : yes
- Boost.Config Feature Check: cxx14_return_type_deduction : yes
- Boost.Config Feature Check: cxx14_variable_templates : yes
- Boost.Config Feature Check: cxx14_decltype_auto : yes
- Boost.Config Feature Check: cxx14_generic_lambdas : yes
- Boost.Config Feature Check: cxx14_return_type_deduction : yes
- Boost.Config Feature Check: cxx14_variable_templates : yes
...patience...
...found 10189 targets...
...updating 8368 targets...
[snip]
**passed** bin.v2/libs/spirit/test/x3/x3_attribute_type_check.test/clang-darwin-10.0/debug/cxxstd-14-iso/threading-multi/visibility-hidden/x3_attribute_type_check.test
...failed updating 6 targets...
...skipped 18 targets...
...updated 8442 targets...
Coqui:develop grafik$
The failed targets are all Spirit tests failing for some reason or other. Hence AFAICT it's all working as expected.
Do you have a user-config.jam or project-config.jam declaring the toolsets?
Do you have a user-config.jam or project-config.jam declaring the toolsets?
If you know which libraries you need, you can use:
DEPLIBS=thread ./b2 toolset=$TOOLSET cxxstd=$CXXSTD $DEPLIBS
This seems to be an ok workaround, thanks.
This is incorrect usage, not a bug.
I thought it might be useful to someone how I finally solved the issue. I got tired of the workaround and luckily found a fix for my use case: alias a dependency with turned off warnings alias boost_thread : /boost/thread//boost_thread : <warnings>off <warnings-as-errors>off ;
and consume the alias instead. This is still not ideal, as some libraries for whatever reason add warnings flags directly to cxxflags
, but it made my life much easier. I think user-consumable libraries should override with <warnings>off <warnings-as-errors>off
by default.
You can also link to /boost//thread/<warnings>off
instead of /boost//thread
, which avoids the need for an alias. E.g. https://github.com/pdimov/describe/blob/acf14803ba027068b36e3ee36fe26b769aca81b1/test/Jamfile#L44-L45
I remember I saw this syntax but forgot about its existence. Is there a way to have multiple properties like that? As I said above I have to do <warnings-as-errors>off
too because of some libraries. The documentation seems to suggest yes, but it is unclear on how https://boostorg.github.io/build/manual/develop/index.html#bbv2.reference.targets.references, and there are examples only with a single property.
I think that you just add the additional properties the same way, e.g. /boost//thread/<warnings>off/<warnings-as-errors>off
.
(The documentation says property-path
but never defines it.)
The problem affects GCC and Clang, but not MSVC.
b2 toolset=gcc,gcc-6
b2 toolset=clang-3.8,clang-7
b2 toolset=clang,clang-7
The
b2 toolset=msvc,msvc-14
,b2 toolset=msvc,msvc-14.1
,b2 toolset=msvc-14.0,msvc-14.1
are fine.