From 53234bb094c4067e2b4a619db5b3d2038f0c08d9 Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Tue, 9 Jul 2024 19:42:28 +0200 Subject: [PATCH] prepare-cpp_stl: downgrade to Boost 1.76 (from 1.85) on macOS See the code comment. For the record, this is what the compile errors in the CI job `macos (cpp_stl, _98, clang14)` at https://github.com/kaitai-io/ci_targets/commit/41ad89f0e05418d319b104497144251cb14aa051 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 ^~~~ /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 ^ /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 ^ /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 ^~~~ /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 ^ /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 ^ /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 ).*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 ).*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' ``` --- prepare-cpp_stl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/prepare-cpp_stl b/prepare-cpp_stl index 5ca6455a..f110ca6b 100755 --- a/prepare-cpp_stl +++ b/prepare-cpp_stl @@ -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/boost@1.76 is available, so we use that. brew install \ - boost \ + boost@1.76 \ make fi