0

Building the Hub with bazel fails for me with error, can't find a solution by searching:

/root/hub/hub/service/BUILD:12:1: C++ compilation of rule '//hub/service:attachment_service' failed (Exit 1)
In file included from ./hub/db/connection.h:23:0,
                 from ./hub/db/db.h:18,
                 from ./hub/service/attachment_service.h:18,
                 from hub/service/attachment_service.cc:8:
./common/crypto/types.h:18:23: fatal error: string_view: No such file or directory
  • What OS? What C compiler version? When using gcc, string_view was added to gcc 7 (not sure about which clang version). – mihi Jan 17 at 22:29
  • OS is Ubuntu 16.04.5 LTS, i installed gcc7 but i'm not sure if bazel is actually using it. From your comment i infer it might not. Any idea how i can check this? – dakon Jan 18 at 12:14
  • gcc-7 --version gives me: gcc-7 (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0 – dakon Jan 18 at 14:14
  • i managed to fix the issue using these commands: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \ --slave /usr/bin/g++ g++ /usr/bin/g++-7 sudo update-alternatives --config gcc sudo update-alternatives \ --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \ --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-7 \ --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-7 \ --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-7 bazel clean --expunge – dakon Jan 18 at 14:27
  • 1
    Glad that you could solve it :) If you want to, you can write your own answer and mark it as accepted. – mihi Jan 18 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.