onedata / homebrew-onedata

Collection of Homebrew recipes for Onedata
0 stars 0 forks source link

Install fails on `follow/ThreadName.h` & `std::accumulate` on macOS 10.12 #1

Open austinheap opened 6 years ago

austinheap commented 6 years ago

Hey there @onedata -- thanks so much for your awesome work! I'm unable to install the current homebrew formula for oneclient on macOS 10.12/10.13 and was hoping you might have an idea about how to fix this.

The first error I get is:

../src/cache/helpersCache.cc:19:10: fatal error: 'folly/ThreadName.h' file not found
#include <folly/ThreadName.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.

On my system, the homebrew-installed copy of folly has ThreadName.h under folly/system/ThreadName.h (missing the system folder).

Then I run into this error:

[110/159] Building CXX object CMakeFiles/client.dir/src/fsOperations.cc.o
FAILED: CMakeFiles/client.dir/src/fsOperations.cc.o
/usr/local/Homebrew/Library/Homebrew/shims/super/clang++  -DASIO_STANDALONE -DBOOST_ALL_DYN_LINK -DBOOST_BIND_NO_PLACEHOLDERS -DBOOST_FILESYSTEM_NO_DEPRECATED -DBUILD_PROXY_IO -DFIBER_STACK_SIZE=1048576 -DFOLLY_TIMEDMUTEX_IS_TEMPLATE=0 -DFUSE_USE_VERSION=30 -DGLOG_STL_LOGGING_FOR_UNORDERED -DS3_HAS_NO_V2_SUPPORT -DWITH_CEPH=0 -DWITH_GLUSTERFS=1 -DWITH_S3=1 -DWITH_SWIFT=1 -D_FILE_OFFSET_BITS=64 -I../include -I../src -Iversion -I../helpers/src -I../helpers/src/../include -isystem ../helpers/deps/asio/asio/include -isystem /usr/local/include -isystem /usr/local/include/.. -isystem helpers/clproto -isystem /usr/local/opt/openssl/include -isystem /usr/local/Cellar/glusterfs-api/3.11.1/include -isystem ../deps/libmacaroons -isystem ../deps/libmacaroons-cpp -std=c++14 -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -fPIC   -Wno-deprecated-declarations -Werror -Wshadow -Wall -Wno-unused-result -MD -MT CMakeFiles/client.dir/src/fsOperations.cc.o -MF CMakeFiles/client.dir/src/fsOperations.cc.o.d -o CMakeFiles/client.dir/src/fsOperations.cc.o -c ../src/fsOperations.cc
../src/fsOperations.cc:476:34: error: no member named 'accumulate' in namespace 'std'
            size_t buflen = std::accumulate(names.cbegin(), names.cend(), 0,
                            ~~~~~^

Adding #include <numeric> to src/fsOperations.cc fixes it on 10.13 but not 10.12 for me. Not sure if this was only happening with me.

bkryza commented 6 years ago

@austinheap Unfortunately, one of our dependencies - folly -change their API and code structure quite often, while Homebrew always downloads and installs the latest version - your specific problem seems to be due to this commit from a week back:

https://github.com/facebook/folly/commit/87a2402c6ba1c8610b034ed39a896fcc3b61deec#diff-e64a7f433ec3f329349f85e07da8484c

AFAIK, Homebrew does not allow for easy version pinning of dependencies, so the only way I know for now (until we update our codebase to latest folly release) is to force homebrew to install the latest folly version we support:

brew uninstall folly
brew edit folly

Change the first lines of folly formula to look like this:

class Folly < Formula
  desc "Collection of reusable C++ library artifacts developed at Facebook"
  homepage "https://github.com/facebook/folly"
  url "https://github.com/facebook/folly/archive/v2017.10.02.00.tar.gz"
  head "https://github.com/facebook/folly.git"

And now install oneclient from the develop branch:

brew install --HEAD oneclient