Skip to content

Commit

Permalink
cpp_stl/{clang3.4,gcc4.8}: downgrade to Boost 1.81
Browse files Browse the repository at this point in the history
As explained in the comment, we do this to avoid deprecation messages
when compiling with `-std=c++98`, such as the following taken from the
build log of our CI target `cpp_stl_98/gcc4.8-linux-x86_64`
(https://github.com/kaitai-io/ci_artifacts/blob/2ab7f526542b4a4d737e70a24ed880725e380f7c/test_out/cpp_stl_98/build-1.log#L38-L47):

```
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:17:0,
                 from /usr/local/include/boost/shared_ptr.hpp:17,
                 from /usr/local/include/boost/test/tools/assertion_result.hpp:21,
                 from /usr/local/include/boost/test/tools/old/impl.hpp:20,
                 from /usr/local/include/boost/test/test_tools.hpp:46,
                 from /usr/local/include/boost/test/unit_test.hpp:18,
                 from /tests/spec/cpp_stl_98/test_repeat_until_calc_array_type.cpp:3:
/usr/local/include/boost/smart_ptr/detail/requires_cxx11.hpp:19:106: note: #pragma message: C++03 support was deprecated in Boost.SmartPtr 1.82 and will be removed in Boost.SmartPtr 1.85.
 BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.SmartPtr 1.82 and will be removed in Boost.SmartPtr 1.85.")
                                                                                                          ^
```
  • Loading branch information
generalmimon committed Dec 29, 2024
1 parent 31adad1 commit 29e56a3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
29 changes: 22 additions & 7 deletions src/cpp_stl/clang3.4-linux-x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,31 @@ RUN curl -fsSLO https://github.com/Kitware/CMake/releases/download/v3.31.3/cmake
cmake --version

# Build Boost.Test from source - see
# https://www.boost.org/doc/libs/1_84_0/libs/test/doc/html/boost_test/adv_scenarios/build_utf.html
# https://www.boost.org/doc/libs/1_81_0/libs/test/doc/html/boost_test/adv_scenarios/build_utf.html
#
# Note: we're using Boost 1.81 specifically because we still support C++98 and
# test on it. With Boost 1.82 and later, we would see the following message...
#
# ```
# /usr/local/include/boost/{bind,function,smart_ptr}/detail/requires_cxx11.hpp:*:*:
# note: #pragma message:
# C++03 support is deprecated in Boost.{Bind,Function,SmartPtr} 1.82 and
# will be removed in Boost.{Bind,Function,SmartPtr} 1.84.
# ```
#
# ... for every single test module compiled with `-std=c++98`, which clutters
# the build output quite a bit. Boost 1.81 doesn't generate these messages yet,
# so the easiest way to avoid them is to stick with Boost 1.81 (as long as we
# support C++98).

RUN curl -fsSLO https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2 && \
tar --bzip2 -xf boost_1_84_0.tar.bz2 && \
rm -f boost_1_84_0.tar.bz2 && \
cd boost_1_84_0 && \
RUN curl -fsSLO https://archives.boost.io/release/1.81.0/source/boost_1_81_0.tar.bz2 && \
tar --bzip2 -xf boost_1_81_0.tar.bz2 && \
rm -f boost_1_81_0.tar.bz2 && \
cd boost_1_81_0 && \
./bootstrap.sh --with-libraries=test && \
./b2 --with-test variant=debug link=shared install && \
cd .. && \
rm -rf boost_1_84_0
rm -rf boost_1_81_0

# Remove gcc and install clang instead
RUN \
Expand All @@ -58,4 +73,4 @@ RUN \
# Thread model: posix

RUN ./validate-clang 'clang version 3\.4-'
RUN ./validate-boost '^Boost 1_84$'
RUN ./validate-boost '^Boost 1_81$'
29 changes: 22 additions & 7 deletions src/cpp_stl/gcc4.8-linux-x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,31 @@ RUN curl -fsSLO https://github.com/Kitware/CMake/releases/download/v3.31.3/cmake
cmake --version

# Build Boost.Test from source - see
# https://www.boost.org/doc/libs/1_84_0/libs/test/doc/html/boost_test/adv_scenarios/build_utf.html
# https://www.boost.org/doc/libs/1_81_0/libs/test/doc/html/boost_test/adv_scenarios/build_utf.html
#
# Note: we're using Boost 1.81 specifically because we still support C++98 and
# test on it. With Boost 1.82 and later, we would see the following message...
#
# ```
# /usr/local/include/boost/{bind,function,smart_ptr}/detail/requires_cxx11.hpp:*:*:
# note: #pragma message:
# C++03 support is deprecated in Boost.{Bind,Function,SmartPtr} 1.82 and
# will be removed in Boost.{Bind,Function,SmartPtr} 1.84.
# ```
#
# ... for every single test module compiled with `-std=c++98`, which clutters
# the build output quite a bit. Boost 1.81 doesn't generate these messages yet,
# so the easiest way to avoid them is to stick with Boost 1.81 (as long as we
# support C++98).

RUN curl -fsSLO https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2 && \
tar --bzip2 -xf boost_1_84_0.tar.bz2 && \
rm -f boost_1_84_0.tar.bz2 && \
cd boost_1_84_0 && \
RUN curl -fsSLO https://archives.boost.io/release/1.81.0/source/boost_1_81_0.tar.bz2 && \
tar --bzip2 -xf boost_1_81_0.tar.bz2 && \
rm -f boost_1_81_0.tar.bz2 && \
cd boost_1_81_0 && \
./bootstrap.sh --with-libraries=test && \
./b2 --with-test variant=debug link=shared install && \
cd .. && \
rm -rf boost_1_84_0
rm -rf boost_1_81_0

# Validate that we've got correct version, e.g. something like this:
#
Expand All @@ -50,4 +65,4 @@ RUN curl -fsSLO https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

RUN ./validate-gcc '^gcc \(.*\) 4\.8\.'
RUN ./validate-boost '^Boost 1_84$'
RUN ./validate-boost '^Boost 1_81$'

0 comments on commit 29e56a3

Please sign in to comment.