Closed zuyu closed 1 month ago
+1.
My system is messed up as well. setup_macos ccache picks up v 4.10.2 https://formulae.brew.sh/formula/ccache brings fmt 11.0.2 which breaks folly
FAILED: CMakeFiles/folly_base.dir/folly/Singleton.cpp.o
/Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFOLLY_XLOG_STRIP_PREFIXES=\"/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/folly:/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/folly/_build\" -DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT -I/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/folly -I/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/folly/_build -I/opt/homebrew/include -I/Users/aditipandit/velox_install/include -I/opt/homebrew/opt/openssl@1.1/include -mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden -std=gnu++17 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -fPIC -g -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized -Wunused-label -Wunused-result -Wno-noexcept-type -Wno-nullability-completeness -Wno-inconsistent-missing-override -faligned-new -MD -MT CMakeFiles/folly_base.dir/folly/Singleton.cpp.o -MF CMakeFiles/folly_base.dir/folly/Singleton.cpp.o.d -o CMakeFiles/folly_base.dir/folly/Singleton.cpp.o -c /Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/folly/folly/Singleton.cpp
In file included from /Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/folly/folly/Singleton.cpp:38:
In file included from /Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/folly/folly/portability/FmtCompile.h:19:
/opt/homebrew/include/fmt/compile.h:153:12: error: call to 'write' is ambiguous
return write<Char>(out, arg);
^~~~~~~~~~~
/opt/homebrew/include/fmt/compile.h:217:15: note: in instantiation of function template specialization 'fmt::detail::field<char, folly::Range<const char *>, 0>::format<std::back_insert_iterator<std::string>, folly::Range<const char *>>' requested here
out = lhs.format(out, args...);
^
/opt/homebrew/include/fmt/compile.h:218:16: note: in instantiation of function template specialization 'fmt::detail::concat<fmt::detail::field<char, folly::Range<const char *>, 0>, fmt::detail::text<char>>::format<std::back_insert_iterator<std::string>, folly::Range<const char *>>' requested here
return rhs.format(out, args...);
^
/opt/homebrew/include/fmt/compile.h:432:6: note: in instantiation of function template specialization 'fmt::detail::concat<fmt::detail::text<char>, fmt::detail::concat<fmt::detail::field<char, folly::Range<const char *>, 0>, fmt::detail::text<char>>>::format<std::back_insert_iterator<std::string>, folly::Range<const char *>>' requested here
cf.format(std::back_inserter(s), args...);
^
Uninstalling fmt 11 and bringing in fmt 10 fixes the folly and completes the rest of the setup, but then this breaks ccache
FAILED: velox/velox/connectors/hive/storage_adapters/abfs/CMakeFiles/velox_abfs.dir/RegisterAbfsFileSystem.cpp.o
/opt/homebrew/bin/ccache /Library/Developer/CommandLineTools/usr/bin/c++ -DFOLLY_HAVE_INT128_T=1 -I/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/. -I/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/velox -I/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/velox/velox/external/xxhash -I/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/cmake-build-debug/velox -I/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/cmake-build-debug -I/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/cmake-build-debug/_deps/protobuf-src/src -I/Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/velox/. -isystem /opt/homebrew/include -isystem /Users/aditipandit/velox_install/include -isystem /opt/homebrew/opt/openssl@1.1/include -isystem /Users/aditipandit/velox_install/include/proxygen -isystem /Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/velox/velox -isystem /Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/velox/velox/external -mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden -Wno-nullability-completeness -Wno-deprecated-declarations -Wreorder -mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden -D USE_VELOX_COMMON_BASE -D HAS_UNCAUGHT_EXCEPTIONS -g -std=gnu++17 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -fPIC -fcolor-diagnostics -MD -MT velox/velox/connectors/hive/storage_adapters/abfs/CMakeFiles/velox_abfs.dir/RegisterAbfsFileSystem.cpp.o -MF velox/velox/connectors/hive/storage_adapters/abfs/CMakeFiles/velox_abfs.dir/RegisterAbfsFileSystem.cpp.o.d -o velox/velox/connectors/hive/storage_adapters/abfs/CMakeFiles/velox_abfs.dir/RegisterAbfsFileSystem.cpp.o -c /Users/aditipandit/ahana_dev/presto/presto/presto-native-execution/velox/velox/connectors/hive/storage_adapters/abfs/RegisterAbfsFileSystem.cpp
dyld[99479]: Library not loaded: /opt/homebrew/opt/fmt/lib/libfmt.11.dylib
Referenced from: <2B4CCBD1-71A1-35E6-903D-1217D1C46092> /opt/homebrew/Cellar/ccache/4.10.2_1/bin/ccache
Reason: tried: '/opt/homebrew/opt/fmt/lib/libfmt.11.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/fmt/lib/libfmt.11.dylib' (no such file), '/opt/homebrew/opt/fmt/lib/libfmt.11.
As a workaround for now - given that fmt is still in the system (from install_fmt) but the homebrew version is picked up (also is used by other depend such as folly and fbthrift - the latter executable dynamically links fmt in that was removed from homebrew).
The workaround for now would be:
ccache is a wrapper around the C/C++ compilers but is not strictly necessary to build the components. It is just that nothing is cached and on make clean
things we be rebuilt instead of the cache used.
I was able to use this and unblock me for now until the issue is resolved.
I have a working fix. Will send pr today
Problem description
https://github.com/Homebrew/homebrew-core/pull/178811 upgraded
fmt
from10.2.1
to11.0.2
that introduces a breaking change:folly v2024.05.20.00
fmt::join
tofmt/ranges.h
fromfmt/format.h
since11.0.0
in https://github.com/fmtlib/fmt/commit/50565f9853926501bd1c9bda07c6a98f4d940691In
velox
, there are several places using differentfmt
versions that works before, as the brew-installed version was10.2.1
:https://github.com/facebookincubator/velox/blob/5f935a73ff85dd4de3e326c5181621586d437ccc/scripts/setup-macos.sh#L38
https://github.com/facebookincubator/velox/blob/5f935a73ff85dd4de3e326c5181621586d437ccc/scripts/setup-macos.sh#L41
https://github.com/facebookincubator/velox/blob/5f935a73ff85dd4de3e326c5181621586d437ccc/CMakeLists.txt#L414
Fixing Suggestions
velox
was built successfully w/fmt 11.0.2
(installed viabrew
)FB_OS_VERSION=v2024.08.26.00
(which also requiresfast_float
installed viabrew
)install_fmt
(10.1.1
) insetup-macos.sh
Code changes to
#include <fmt/ranges.h>
due tofmt::join
usage (IWYU):Note that https://formulae.brew.sh/formula/folly shows
folly v2024.08.26.00
depends onfmt 11.0.2
(brew-installedfolly
might work on macOS 14, but not macOS 15 due to some weird linking issue). An earlier version offolly
might also works.System information
Velox System Info v0.0.2 Commit: 5f935a73ff85dd4de3e326c5181621586d437ccc CMake Version: 3.30.2 System: Darwin-24.1.0 Arch: arm64 C++ Compiler: /opt/homebrew/opt/ccache/libexec/c++ C++ Compiler Version: 16.0.0.16000026 C Compiler: /opt/homebrew/opt/ccache/libexec/cc C Compiler Version: 16.0.0.16000026 CMake Prefix Path: /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr;/opt/homebrew;/usr/local;/usr;/;/opt/homebrew/Cellar/cmake/3.30.2;/usr/local;/usr/X11R6;/usr/pkg;/opt;/sw;/opt/local
CMake log