boostorg / contract

Contract programming for C++
http://www.boost.org/doc/libs/develop/libs/contract/doc/html/index.html
Boost Software License 1.0
40 stars 27 forks source link

Build failure with MSVC 12.0 (VS2013) #22

Closed jeking3 closed 5 years ago

jeking3 commented 5 years ago

Seeing the following error with Visual Studio 2013:

compile-c-c++ bin.v2\libs\contract\example\features-throw_on_failure.test\msvc-12.0\release\threading-multi\features\throw_on_failure.obj
throw_on_failure.cpp
libs\contract\example\features\throw_on_failure.cpp(55) : error C3646: 'noexcept' : unknown override specifier
        libs\contract\example\features\throw_on_failure.cpp(72) : see reference to class template instantiation 'cstring<MaxSize>' being compiled
    call "bin.v2\standalone\msvc\msvc-12.0\msvc-setup.bat" x86 >nul
 cl /Zm800 -nologo @"bin.v2\libs\contract\example\features-throw_on_failure.test\msvc-12.0\release\threading-multi\features\throw_on_failure.obj.rsp" 
...failed compile-c-c++ bin.v2\libs\contract\example\features-throw_on_failure.test\msvc-12.0\release\threading-multi\features\throw_on_failure.obj...

https://ci.appveyor.com/project/jeking3/contract/builds/25028138/job/89633x54cn1yu5ir?fullLog=true#L838

There are no expected failures for MSVC 12.0 (VS2013) in the meta directory so I'm leaving this as an open issue.

jeking3 commented 5 years ago

I found the explicit failures markup file in meta, and it looks like some of these issues are known. I'm not certain the VS2013 issue is known however. Could you verify?

I'm going to mark VS 2010, 2012, and 2013 as "allowed failures" in the appveyor specification for now and attribute them to this GitHub issue.

Preview of the builds CI will run:

https://ci.appveyor.com/project/jeking3/contract/builds/25028138 https://travis-ci.org/jeking3/contract/builds/541174205?utm_source=github_status&utm_medium=notification

jeking3 commented 5 years ago

Actually given the extensiveness of the MSVC 10.0 and 11.0 (VS2010, VS2012) issues I am going to remove them from the build entirely. I see no expected failures for MSVC 12.0 (VS2013) and there is an issue so I am going to leave it as an allowed failure and reference this issue.

lcaminiti commented 5 years ago

Both MSVC 10 and 11 work (a part from a couple of expected failures), it would be good to leave those in. Look at the tests here (scroll all the way to the right and look for msvc-10 and msvc-11): https://www.boost.org/development/tests/develop/developer/contract.html

If you are getting errors for the example/ just skip those and run only the test/ (some examples are intentionally artificial because I used them in the docs to explain how to use the library, they don't really mean much).

lcaminiti commented 5 years ago

The errors C3646 are because these compilers do not make destructors noexcept by default (since C++11). These errors are only in example/, but I won't change the example code to use BOOST_NOEXCEPT because that will make these documentation examples harder to read. The tests test/ instead use this macro and more so they run on all platform. Do not add the examples example/ to CI, just add the tests test/ instead.

I will look double check all links in other comments in this issue because closing it.

jeking3 commented 5 years ago

It's pretty standard practice to ensure examples work, (all 15 CMT repositories and 3 I maintain directly do this) but I will remove them from the CI builds here.

lcaminiti commented 5 years ago

The examples do work. However, they are not designed to be cross compiler/platform because that would make them less readable, instead their main purpose is to show case library features with simple code (without Boost.Config macros and other tricks needed to support compiler from C++98 to C++20 on Linux, Windows, Mac, and all these other combinations). Tests are designed to fully test all library features and also the be cross compiler/platform.