fcitx / mozc

Mozc - a Japanese Input Method Editor designed for multi-platform
Other
136 stars 15 forks source link

Can't build fcitx4-mozc with Bazel #22

Closed utuhiro78 closed 2 years ago

utuhiro78 commented 3 years ago

I couldn't build the latest fcitx4-mozc with Bazel. I always use fcitx5-mozc, so this is just a reminder.

System: Arch Linux, gcc-11.1.0

git clone --depth=1 --recurse-submodules --shallow-submodules https://github.com/fcitx/mozc.git

cd mozc/src/

# Fix the Qt5 include path
sed -i -e 's/x86_64-linux-gnu\/qt5/qt/' config.bzl

env PATH="/usr/lib/jvm/java-11-openjdk/bin/:$PATH" bazel build server:mozc_server gui/tool:mozc_tool unix/fcitx:fcitx-mozc.so unix/icons --config oss_linux --compilation_mode opt

Errors:

In file included from external/com_google_absl/absl/functional/function_ref.h:53,
                 from external/com_google_absl/absl/strings/cord.h:78,
                 from external/com_google_absl/absl/status/internal/status_internal.h:20,
                 from external/com_google_absl/absl/status/status.h:58,
                 from ./base/util.h:43,
                 from unix/fcitx/surrounding_text_util.cc:39:
external/com_google_absl/absl/functional/internal/function_ref.h:78:68: error: macro "InvokeFunction" requires 4 arguments, but only 2 given
   78 | R InvokeFunction(VoidPtr ptr, typename ForwardT<Args>::type... args) {
      |                                                                    ^
In file included from external/fcitx/include/fcitx/module/clipboard/fcitx-clipboard.h:26,
                 from unix/fcitx/surrounding_text_util.cc:35:
external/fcitx/include/fcitx/module.h:131: note: macro "InvokeFunction" defined here
  131 | #define InvokeFunction(INST, MODULE, FUNC, ARG)                         \
      | 
In file included from external/com_google_absl/absl/functional/function_ref.h:53,
                 from external/com_google_absl/absl/strings/cord.h:78,
                 from external/com_google_absl/absl/status/internal/status_internal.h:20,
                 from external/com_google_absl/absl/status/status.h:58,
                 from ./base/util.h:43,
                 from unix/fcitx/surrounding_text_util.cc:39:
external/com_google_absl/absl/functional/internal/function_ref.h:79:3: error: expected primary-expression before 'auto'
   79 |   auto f = reinterpret_cast<Fun>(ptr.fun);
      |   ^~~~
external/com_google_absl/absl/functional/internal/function_ref.h:79:3: error: expected '}' before 'auto'
external/com_google_absl/absl/functional/internal/function_ref.h:78:70: note: to match this '{'
   78 | R InvokeFunction(VoidPtr ptr, typename ForwardT<Args>::type... args) {
      |                                                                      ^
external/com_google_absl/absl/functional/internal/function_ref.h:78:71: error: expected ';' before 'auto'
   78 | R InvokeFunction(VoidPtr ptr, typename ForwardT<Args>::type... args) {
      |                                                                       ^
      |                                                                       ;
   79 |   auto f = reinterpret_cast<Fun>(ptr.fun);
      |   ~~~~                                                                 
external/com_google_absl/absl/functional/internal/function_ref.h:80:3: error: expected unqualified-id before 'return'
   80 |   return static_cast<R>(
      |   ^~~~~~
external/com_google_absl/absl/functional/internal/function_ref.h:104:1: error: expected declaration before '}' token
  104 | }  // namespace absl
      | ^
In file included from external/com_google_absl/absl/strings/cord.h:78,
                 from external/com_google_absl/absl/status/internal/status_internal.h:20,
                 from external/com_google_absl/absl/status/status.h:58,
                 from ./base/util.h:43,
                 from unix/fcitx/surrounding_text_util.cc:39:
external/com_google_absl/absl/functional/function_ref.h:115:7: error: 'absl::lts_20210324::functional_internal::EnableIf' has not been declared
  115 |       absl::functional_internal::EnableIf<absl::is_function<F>::value> = 0>
      |       ^~~~
external/com_google_absl/absl/functional/function_ref.h:115:42: error: expected '>' before '<' token
  115 |       absl::functional_internal::EnableIf<absl::is_function<F>::value> = 0>
      |                                          ^
external/com_google_absl/absl/functional/function_ref.h: In constructor 'absl::lts_20210324::FunctionRef<R(Args ...)>::FunctionRef(const F&)':
external/com_google_absl/absl/functional/function_ref.h:103:32: error: 'AssertNonNull' is not a member of 'absl::lts_20210324::functional_internal'; did you mean 'absl::lts_20210324::AssertNonNull'?
  103 |     absl::functional_internal::AssertNonNull(f);
      |                                ^~~~~~~~~~~~~
In file included from external/com_google_absl/absl/functional/function_ref.h:53,
                 from external/com_google_absl/absl/strings/cord.h:78,
                 from external/com_google_absl/absl/status/internal/status_internal.h:20,
                 from external/com_google_absl/absl/status/status.h:58,
                 from ./base/util.h:43,
                 from unix/fcitx/surrounding_text_util.cc:39:
external/com_google_absl/absl/functional/internal/function_ref.h:94:6: note: 'absl::lts_20210324::AssertNonNull' declared here
   94 | void AssertNonNull(F C::*f) {
      |      ^~~~~~~~~~~~~

FAILED: Build did NOT complete successfully