Update conan recipe for Snappy using cmake 4
The conan recipe for Snappy does not build on OS X using the current homebrew cmake (4.0.1)
...
snappy/1.1.10: CMake command: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/donovanhide/.conan/data/snappy/1.1.10/_/_/build/c12dc1aa353511ad32e610282ba7d9d33490d623/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/donovanhide/.conan/data/snappy/1.1.10/_/_/package/c12dc1aa353511ad32e610282ba7d9d33490d623" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/donovanhide/.conan/data/snappy/1.1.10/_/_/build/c12dc1aa353511ad32e610282ba7d9d33490d623/src"
CMake Error at CMakeLists.txt:29 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.
Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
-- Configuring incomplete, errors occurred!
snappy/1.1.10:
snappy/1.1.10: ERROR: Package 'c12dc1aa353511ad32e610282ba7d9d33490d623' build failed
snappy/1.1.10: WARN: Build folder /Users/donovanhide/.conan/data/snappy/1.1.10/_/_/build/c12dc1aa353511ad32e610282ba7d9d33490d623/build/Release
ERROR: snappy/1.1.10: Error in build() method, line 66
cmake.configure()
ConanException: Error 1 while executing cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/donovanhide/.conan/data/snappy/1.1.10/_/_/build/c12dc1aa353511ad32e610282ba7d9d33490d623/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/donovanhide/.conan/data/snappy/1.1.10/_/_/package/c12dc1aa353511ad32e610282ba7d9d33490d623" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/donovanhide/.conan/data/snappy/1.1.10/_/_/build/c12dc1aa353511ad32e610282ba7d9d33490d623/src"
...
This PR has the fix, but probably makes sense to take the whole recipe and possibly update Snappy version: https://github.com/conan-io/conan-center-index/pull/27104
Also having issues with building abseil on Apple Silicon with Clang 17:
...
clang++: error: unsupported option '-msse4.1' for target 'arm64-apple-darwin24.4.0'
make[2]: *** [absl/random/CMakeFiles/random_internal_randen_hwaes_impl.dir/internal/randen_hwaes.cc.o] Error 1
make[1]: *** [absl/random/CMakeFiles/random_internal_randen_hwaes_impl.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 10%] Building CXX object absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_lookup.cc.o
[ 10%] Built target spinlock_wait
[ 11%] Building CXX object absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_posix.cc.o
[ 11%] Linking CXX static library libabsl_log_internal_nullguard.a
[ 11%] Linking CXX static library libabsl_exponential_biased.a
[ 12%] Linking CXX static library libabsl_strerror.a
[ 12%] Built target log_internal_nullguard
[ 12%] Building CXX object absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/zone_info_source.cc.o
[ 12%] Built target exponential_biased
[ 12%] Built target strerror
[ 12%] Linking CXX static library libabsl_random_seed_gen_exception.a
[ 13%] Linking CXX static library libabsl_log_severity.a
[ 13%] Built target random_seed_gen_exception
[ 13%] Linking CXX static library libabsl_civil_time.a
[ 13%] Built target log_severity
[ 13%] Linking CXX static library libabsl_int128.a
[ 13%] Built target civil_time
[ 13%] Built target int128
[ 14%] Linking CXX static library libabsl_random_internal_randen_slow.a
[ 14%] Built target random_internal_randen_slow
[ 15%] Linking CXX static library libabsl_time_zone.a
[ 15%] Built target time_zone
make: *** [all] Error 2
abseil/20230802.1:
abseil/20230802.1: ERROR: Package '941f56ce33971edb0f8115d656906d20abedd2be' build failed
abseil/20230802.1: WARN: Build folder /Users/donovanhide/.conan/data/abseil/20230802.1/_/_/build/941f56ce33971edb0f8115d656906d20abedd2be/build/Release
ERROR: abseil/20230802.1: Error in build() method, line 127
cmake.build()
ConanException: Error 2 while executing cmake --build "/Users/donovanhide/.conan/data/abseil/20230802.1/_/_/build/941f56ce33971edb0f8115d656906d20abedd2be/build/Release" '--' '-j16'
...
Which seems to be related to:
https://github.com/conan-io/conan-center-index/pull/26107
It does feel like sticking with conan 1.66 and not updating to conan 2.0 is going to lead to more and more issues as all the build tool versions move forwards but the old packages don't get updated on the conan center for conan 1.x
See #5219 and #5415
Thanks for the links to those issues. I tried to follow through the unfinished work in the two PRs with conan 2, but I'm still not having much fun on an M4 Mac with apple clang 17. Might I suggest modifying the github actions mac os runner to use both the Intel and Arm64 platforms:
https://github.com/XRPLF/rippled/blob/develop/.github/workflows/macos.yml#L26
https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners
It would at least alert you to some of the problems I'm encountering. It's not something I can easily help with through a PR, as I almost certainly won't have the correct Github permissions.
@donovanhide The workaround is now documented in BUILD.md. Thanks for reporting!