Skip to content

Commit

Permalink
Merge pull request #217 from stlab/develop
Browse files Browse the repository at this point in the history
Release 1.4.0
  • Loading branch information
FelixPetriconi authored Dec 12, 2018
2 parents 278d1b0 + 16410eb commit fa815b4
Show file tree
Hide file tree
Showing 28 changed files with 3,134 additions and 1,239 deletions.
28 changes: 9 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sudo: required
dist: trusty
dist: xenial
#group: deprecated-2017Q4
language: cpp

Expand All @@ -10,12 +10,12 @@ cache:
addons:
apt:
sources:
- sourceline: deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.8 main
key_url: http://apt.llvm.org/llvm-snapshot.gpg.key
- ubuntu-toolchain-r-test
# - sourceline: deb http://apt.llvm.org/xenial/ llvm-toolchain-precise-7.0 main
# key_url: http://apt.llvm.org/llvm-snapshot.gpg.key
packages:
- g++-5
- clang-3.8
- g++-7
# - clang-7.0

branches:
except: /pr\/.*/
Expand All @@ -27,11 +27,10 @@ matrix:
#
- os: osx
compiler: clang
osx_image: xcode9
osx_image: xcode10.1
before_install:
- brew update
- brew upgrade python
- brew uninstall libyaml
- pip3 install --no-cache-dir pyyaml
- pip3 install --user conan
- export PATH=$PATH:/Users/travis/Library/Python/3.7/bin
Expand All @@ -43,11 +42,10 @@ matrix:

- os: osx
compiler: clang
osx_image: xcode9
osx_image: xcode10.1
before_install:
- brew update
- brew upgrade python
- brew uninstall libyaml
- pip3 install --no-cache-dir pyyaml
- pip3 install --user conan
- export PATH=$PATH:/Users/travis/Library/Python/3.7/bin
Expand Down Expand Up @@ -157,16 +155,8 @@ matrix:
- pip install --user conan
- ./enhance_conan.sh
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
addons:
apt:
sources:
- sourceline: deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.8 main
key_url: http://apt.llvm.org/llvm-snapshot.gpg.key
- ubuntu-toolchain-r-test
packages:
- g++-5
- clang-3.8
coverity_scan:

coverity_scan:
project:
name: "stlab/libraries"
description: "Build submitted via Travis CI"
Expand Down
16 changes: 11 additions & 5 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
set -x

if [ "$TRAVIS_OS_NAME" = "linux" ]; then
#
# It is nevessary to patch gcc std.variant because of a clang bug which is fixed in clang 8.0
# further details are here: https://stackoverflow.com/questions/46506387/getstring-for-variants-fail-under-clang-but-not-g
#
sudo .travis/patches/patch_std_variant.sh

sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-5 90 \
--slave /usr/bin/g++ g++ /usr/bin/g++-5 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-5
--install /usr/bin/gcc gcc /usr/bin/gcc-7 90 \
--slave /usr/bin/g++ g++ /usr/bin/g++-7 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-7
sudo update-alternatives \
--install /usr/bin/clang clang /usr/bin/clang-3.8 90 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-3.8
--install /usr/bin/clang clang /usr/bin/clang-7 90 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-7
sudo update-alternatives --config gcc
sudo update-alternatives --config clang
if [ "$CXX" = "clang++" ]; then
Expand Down
16 changes: 16 additions & 0 deletions .travis/patches/patch_std_variant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

HERE=$(pwd)

if [ ! -d /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/ ]; then
echo "You must have a destination directory (gcc 7.3.0 includes) in order to patch!"
exit 1;
fi

pushd /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/

patch -uN -p0 -g0 < "$HERE/.travis/patches/std_variant.patch" && echo "Patching of std.variant succeeded. Happy coding!"

popd

exit 0
48 changes: 48 additions & 0 deletions .travis/patches/std_variant.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
--- variant 2018/03/26 12:03:53 258853
+++ variant 2018/03/26 13:09:10 258854
@@ -223,13 +223,17 @@

template<size_t _Np, typename _Union>
constexpr decltype(auto) __get(in_place_index_t<_Np>, _Union&& __u)
- { return __get(in_place_index<_Np-1>, std::forward<_Union>(__u)._M_rest); }
+ {
+ return __variant::__get(in_place_index<_Np-1>,
+ std::forward<_Union>(__u)._M_rest);
+ }

// Returns the typed storage for __v.
template<size_t _Np, typename _Variant>
constexpr decltype(auto) __get(_Variant&& __v)
{
- return __get(std::in_place_index<_Np>, std::forward<_Variant>(__v)._M_u);
+ return __variant::__get(std::in_place_index<_Np>,
+ std::forward<_Variant>(__v)._M_u);
}

// Various functions as "vtable" entries, where those vtables are used by
@@ -358,10 +362,9 @@

template <typename... _Types>
using __select_index =
- typename __select_int::_Select_int_base<sizeof...(_Types)+1,
+ typename __select_int::_Select_int_base<sizeof...(_Types) + 1,
unsigned char,
- unsigned short>
- ::type::value_type;
+ unsigned short>::type::value_type;

template<typename... _Types>
struct _Variant_storage<false, _Types...>
@@ -1304,6 +1307,12 @@

#undef _VARIANT_RELATION_FUNCTION_TEMPLATE

+#ifdef __clang__
+ public:
+ using _Base::_M_u; // See https://bugs.llvm.org/show_bug.cgi?id=31852
+ private:
+#endif
+
template<size_t _Np, typename _Vp>
friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v);

19 changes: 19 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## v1.4.0 - 2018 - December -
- Fixed Issues
- [#208](https://github.com/stlab/libraries/issues/208): g++8.2.0 compiling error
- [#206](https://github.com/stlab/libraries/issues/206): channels does not allow processes as lvalues, only as rvalue
- [#204](https://github.com/stlab/libraries/issues/204): when_all does not support move-only types
- [#192](https://github.com/stlab/libraries/issues/192): Issues with executor_t and when_all()
- [#188](https://github.com/stlab/libraries/issues/188): question: channels and slow processes

- Enhancements
- [#212](https://github.com/stlab/libraries/issues/212): Join of future with move only type is missing
- [#199](https://github.com/stlab/libraries/issues/199): add operator|() as continuable operator
- It is now possible to create with channel<void>() a receiver<void> (not a pair<sender<void>, receiver<void>>)

- Library Changes
- Now C++17 is required to use the channels (This change was necessary, because the code became really messy to dispatch between copyable, move-only and void types)

- Additional Comments
- It is necessary to patch std::variant for the combination of clang version <= 7 and stdlibc++. For further details see https://stackoverflow.com/questions/46506387/getstring-for-variants-fail-under-clang-but-not-g and ./travis/patches/patch_std_variant.sh. This is because the clang bug https://bugs.llvm.org/show_bug.cgi?id=31852

## v1.3.3 - 2018 - October - 25

- Fixed Issues
Expand Down
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ option( stlab.boost_variant "Prefer Boost::variant to std::variant" OFF )
option( stlab.boost_optional "Prefer Boost::optional to std::optional" OFF )
option( stlab.coroutines "Leverage the coroutine TS in stlab" OFF )

#
# On apple we have to force the usage of boost.varianr, because Apple's
# implementation of C++17 is not complete
#
if(APPLE AND (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
set( stlab.boost_variant ON )
endif()

mark_as_advanced( stlab.coroutines stlab.boost_variant stlab.boost_optional )

#
Expand All @@ -49,11 +57,11 @@ add_library( stlab INTERFACE )
add_library( stlab::stlab ALIAS stlab )

#
# stlab requires C++ 14 support, at a minimum. Setting the `cxx_std_14` compile
# stlab requires C++ 17 support, at a minimum. Setting the `cxx_std_17` compile
# features ensures that the corresponding C++ standard flag is populated in
# targets linking to stlab.
#
target_compile_features( stlab INTERFACE cxx_std_14 )
target_compile_features( stlab INTERFACE cxx_std_17 )

#
# The include directory for stlab can be expected to vary between build
Expand Down
2 changes: 1 addition & 1 deletion cmake/stlab/development/Clang.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set( stlab_Clang_base_flags -Wall -Wextra -Wpedantic -Werror -ftemplate-backtrace-limit=0 )
set( stlab_Clang_base_flags -Wall -Wextra -Wpedantic -Werror -ftemplate-backtrace-limit=0 -DBOOST_NO_AUTO_PTR=1 -D_GLIBCXX_USE_CXX11_ABI=0)
set( stlab_Clang_debug_flags -gdwarf-3 )
set( stlab_Clang_coverage_flags --coverage )
set( stlab_Clang_release_flags )
Expand Down
2 changes: 1 addition & 1 deletion cmake/stlab/development/GNU.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set( stlab_GNU_base_flags -Wall -Wextra -Wpedantic -Werror -ftemplate-backtrace-limit=0 )
set( stlab_GNU_base_flags -Wall -Wextra -Wpedantic -Werror -ftemplate-backtrace-limit=0 -D_GLIBCXX_USE_CXX11_ABI=0)
set( stlab_GNU_debug_flags -gdwarf-3 )
set( stlab_GNU_coverage_flags --coverage )
set( stlab_GNU_release_flags )
Expand Down
2 changes: 1 addition & 1 deletion cmake/stlab/development/MSVC.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set( stlab_MSVC_base_flags /W3 /WX )
set( stlab_MSVC_base_flags /W3 /WX /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
set( stlab_MSVC_debug_flags )
set( stlab_MSVC_coverage_flags )
set( stlab_MSVC_release_flags )
Expand Down
2 changes: 1 addition & 1 deletion conanfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[requires]
boost/1.66.0@conan/stable
boost/1.68.0@conan/stable

[generators]
cmake
Expand Down
Loading

0 comments on commit fa815b4

Please sign in to comment.