Stiffstream / restinio

Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library with the right balance between performance and ease of use
Other
1.15k stars 93 forks source link

build fails on Debian 10 (buster / stable) #147

Closed dpocock closed 2 years ago

dpocock commented 3 years ago

gcc 8.3.0 in Debian 10 seems to have some issues with noexcept, can you provide a workaround for building in this environment?

restinio/dev/restinio/buffers.hpp: In instantiation of ‘void restinio::impl::datasizeable_buf_t<Datasizeable>::relocate_to(void*) [with Datasizeable = fmt
::v5::basic_memory_buffer<char, 1>]’:
restinio/dev/restinio/buffers.hpp:231:16:   required from here
restinio/dev/restinio/buffers.hpp:233:4: error: use of deleted function ‘restinio::impl::datasizeable_buf_t<Datasizeable>::datasizeable_buf_t(restinio::impl::datasizeable_buf_t<Datasizeable>&&) [with Datasizeable = fmt::v5::basic_memory_buffer<char, 1>]’
    new( storage ) datasizeable_buf_t{ std::move( *this ) };
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
restinio/dev/restinio/buffers.hpp:216:3: note: ‘restinio::impl::datasizeable_buf_t<Datasizeable>::datasizeable_buf_t(restinio::impl::datasizeable_buf_t<Datasizeable>&&) noexcept [with Datasizeable = fmt::v5::basic_memory_buffer<char, 1>]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
   datasizeable_buf_t( datasizeable_buf_t && ) noexcept = default; // allow only explicit move.
   ^~~~~~~~~~~~~~~~~~
In file included from restinio/dev/restinio/impl/connection_base.hpp:14,
                 from restinio/dev/restinio/message_builders.hpp:20,
                 from restinio/dev/restinio/request_handler.hpp:13,
                 from restinio/dev/restinio/settings.hpp:14,
                 from restinio/dev/restinio/all.hpp:14,
                 from restinio/dev/sample/query_string_params/main.cpp:3:
restinio/dev/restinio/buffers.hpp: In instantiation of ‘void restinio::impl::datasizeable_buf_t<Datasizeable>::relocate_to(void*) [with Datasizeable = fmt::v5::basic_memory_buffer<char, 1>]’:
restinio/dev/restinio/buffers.hpp:231:16:   required from here
restinio/dev/restinio/buffers.hpp:233:4: error: use of deleted function ‘restinio::impl::datasizeable_buf_t<Datasizeable>::datasizeable_buf_t(restinio::impl::datasizeable_buf_t<Datasizeable>&&) [with Datasizeable = fmt::v5::basic_memory_buffer<char, 1>]’
    new( storage ) datasizeable_buf_t{ std::move( *this ) };
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
restinio/dev/restinio/buffers.hpp:216:3: note: ‘restinio::impl::datasizeable_buf_t<Datasizeable>::datasizeable_buf_t(restinio::impl::datasizeable_buf_t<Datasizeable>&&) noexcept [with Datasizeable = fmt::v5::basic_memory_buffer<char, 1>]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
   datasizeable_buf_t( datasizeable_buf_t && ) noexcept = default; // allow only explicit move.
   ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/fmt/format.h:60,
                 from restinio/dev/restinio/impl/include_fmtlib.hpp:32,
                 from restinio/dev/restinio/http_headers.hpp:11,
                 from restinio/dev/restinio/request_handler.hpp:12,
                 from restinio/dev/restinio/settings.hpp:14,
                 from restinio/dev/restinio/all.hpp:14,
                 from restinio/dev/sample/query_string_params/main.cpp:3:
/usr/include/fmt/core.h: In member function ‘void fmt::v5::internal::arg_map<Context>::push_back(fmt::v5::internal::value<Context>) [with Context = fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char> >, char>]’:
/usr/include/fmt/core.h:890:8: note: the ABI of passing aggregates with 16-byte alignment has changed in GCC 5
   void push_back(value<Context> val) {
eao197 commented 3 years ago

Hi!

I can't reproduce this problem. There is my Dockerfile used for checking:

FROM debian:10

# Prepare build environment
RUN apt-get update && \
    apt-get -qq -y install gcc g++ ruby \
    wget libpcre2-dev libpcre3-dev pkg-config \
     libboost-all-dev \
     libssl-dev \
     git \
    libtool
RUN gem install Mxx_ru

ARG hgrev=HEAD

RUN echo "*** Downloading RESTinio ***" \
    && cd /tmp \
    && git clone https://github.com/stiffstream/restinio \
    && cd restinio \
    && git checkout $hgrev

RUN echo "*** Extracting RESTinio's Dependencies ***" \
    && cd /tmp/restinio \
    && mxxruexternals

RUN echo "*** Getting CMake ***" \
    && apt-get update \
    && apt-get -y install cmake

RUN echo "*** Building RESTinio ***" \
    && cd /tmp/restinio/dev \
    && mkdir cmake_build \
    && cd cmake_build \
    && cmake -DCMAKE_INSTALL_PREFIX=target -DCMAKE_BUILD_TYPE=Release .. \
    && cmake --build . --config Release \
    && cmake --build . --target test \
    && cmake --build . --target install

Could you modify it to make the error reproducible?