Skip to content

Commit

Permalink
prepare-cpp_stl: downgrade to Boost 1.76 (from 1.85) on macOS
Browse files Browse the repository at this point in the history
See the code comment.

For the record, this is what the compile errors in the CI job `macos
(cpp_stl, _98, clang14)` at
41ad89f
looked like (this would repeat 248 times, which matches the number of
`.cpp` files in
https://github.com/kaitai-io/kaitai_struct_tests/tree/390e0ee4bf817bfb86154a841213a45307a0fb1a/spec/cpp_stl_98):

```
[  1%] Building CXX object CMakeFiles/ks_tests.dir/test_bcd_user_type_le.cpp.o
/Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ \
    -DBOOST_UNIT_TEST_FRAMEWORK_DYN_LINK -DBOOST_UNIT_TEST_FRAMEWORK_NO_LIB \
    -DKS_STR_ENCODING_ICONV -DKS_ZLIB \
    -I/Users/runner/work/ci_targets/ci_targets/compiled/cpp_stl_98/bin \
    -I/Users/runner/work/ci_targets/ci_targets/tests/compiled/cpp_stl_98 \
    -I/Users/runner/work/ci_targets/ci_targets/tests/spec/cpp_stl_98/../../../runtime/cpp_stl \
    -I/Users/runner/work/ci_targets/ci_targets/tests/spec/cpp_stl_98/prereq \
    -isystem /usr/local/include -g -std=c++98 -isysroot \
    /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk \
    -mmacosx-version-min=12.7 -MD -MT CMakeFiles/ks_tests.dir/test_bcd_user_type_le.cpp.o \
    -MF CMakeFiles/ks_tests.dir/test_bcd_user_type_le.cpp.o.d \
    -o CMakeFiles/ks_tests.dir/test_bcd_user_type_le.cpp.o \
    -c /Users/runner/work/ci_targets/ci_targets/tests/spec/cpp_stl_98/test_bcd_user_type_le.cpp
In file included from /Users/runner/work/ci_targets/ci_targets/tests/spec/cpp_stl_98/test_bcd_user_type_le.cpp:3:
In file included from /usr/local/include/boost/test/unit_test.hpp:18:
In file included from /usr/local/include/boost/test/test_tools.hpp:54:
In file included from /usr/local/include/boost/test/tools/fpc_op.hpp:19:
In file included from /usr/local/include/boost/test/tools/fpc_tolerance.hpp:19:
In file included from /usr/local/include/boost/test/tree/decorator.hpp:22:
In file included from /usr/local/include/boost/test/tree/fixture.hpp:21:
In file included from /usr/local/include/boost/function/function0.hpp:10:
In file included from /usr/local/include/boost/function/function_template.hpp:16:
In file included from /usr/local/include/boost/mem_fn.hpp:22:
/usr/local/include/boost/bind/mem_fn.hpp:93:1: error: 'auto' not allowed in function return type
auto mem_fn( R (T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
^~~~
/usr/local/include/boost/bind/mem_fn.hpp:93:34: error: expected ';' at end of declaration
auto mem_fn( R (T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
                                 ^
/usr/local/include/boost/bind/mem_fn.hpp:93:35: error: cannot use arrow operator on a type
auto mem_fn( R (T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
                                  ^
/usr/local/include/boost/bind/mem_fn.hpp:99:1: error: 'auto' not allowed in function return type
auto mem_fn( R (T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
^~~~
/usr/local/include/boost/bind/mem_fn.hpp:99:40: error: expected ';' at end of declaration
auto mem_fn( R (T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
                                       ^
/usr/local/include/boost/bind/mem_fn.hpp:99:41: error: cannot use arrow operator on a type
auto mem_fn( R (T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
                                        ^
/usr/local/include/boost/bind/mem_fn.hpp:196:5: error: 'auto' not allowed in function return type
    auto operator()( U&& u ) const -> decltype( std::forward<U>( u ).*pm_ )
    ^~~~
/usr/local/include/boost/bind/mem_fn.hpp:196:35: error: expected ';' at end of declaration list
    auto operator()( U&& u ) const -> decltype( std::forward<U>( u ).*pm_ )
                                  ^
8 errors generated.
gmake[2]: *** [CMakeFiles/ks_tests.dir/build.make:160: CMakeFiles/ks_tests.dir/test_bcd_user_type_le.cpp.o] Error 1
gmake[2]: Leaving directory '/Users/runner/work/ci_targets/ci_targets/compiled/cpp_stl_98/bin'
gmake[2]: Entering directory '/Users/runner/work/ci_targets/ci_targets/compiled/cpp_stl_98/bin'
```
  • Loading branch information
generalmimon committed Jul 9, 2024
1 parent 41ad89f commit 53234bb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion prepare-cpp_stl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ fi

# On GitHub Actions for macOS, install prereqs from brew
if [ -n "$GITHUB_ACTIONS" ] && [ "$RUNNER_OS" = macOS ]; then
# NB: since commit
# https://github.com/Homebrew/homebrew-core/commit/c67b591208748bb8d07e79806c4963bbe1a9c866 made
# on 2024-04-26, we can no longer use just `brew install boost`
# (https://formulae.brew.sh/formula/boost), because it got updated to Boost 1.85, which then
# broke our `cpp_stl_98/clang14-macos-x86_64` CI job. Apparently, Boost 1.85 apparently no
# longer builds with `-std=c++98`, since we were suddenly getting syntax errors in
# `/usr/local/include/boost/bind/mem_fn.hpp`. This matches the
# [changelog](https://www.boost.org/users/history/version_1_85_0.html):
# > Bind:
# > * C++03 is no longer supported; a C++11 compiler is required. (This includes GCC 4.7 or
# > later, and MSVC 12.0 (VS 2013) or later.)
#
# Fortunately, https://formulae.brew.sh/formula/[email protected] is available, so we use that.
brew install \
boost \
boost@1.76 \
make
fi

0 comments on commit 53234bb

Please sign in to comment.