Open utuhiro78 opened 1 month ago
Hi utuhiro78,
Since the build failed at src/google/protobuf/map_field.cc
, it could be an issue of Protocol Buffers.
To get more error logs, would you try a build with --sandbox_debug
and --verbose_failures
?
bazel build package --config oss_linux -c opt --sandbox_debug --verbose_failures
The error is indeed with Protobuf, and it is due to them unconditionally enabling -Werror
, which in turn stumbles upon some innocuous -Wmaybe-uninitialized
and turns them into errors which then break the build.
This was already reported back in November with https://github.com/protocolbuffers/protobuf/issues/14714 and can be fixed with https://github.com/protocolbuffers/protobuf/pull/14752, but the relevant PR was closed and so far has not been merged.
Tl;DR we just need to explicitly disable -Werror
before building.
Thank you for the information,
Would you try to build Mozc with --copt="-Wno-error"
?
bazel build package --config oss_linux -c opt --copt="-Wno-error"
and also --copt="-Wno-maybe-uninitialized"
?
bazel build package --config oss_linux -c opt --copt="-Wno-maybe-uninitialized"
Would you try to build Mozc with --copt="-Wno-error"?
Unfortunately, passing -Wno-error
won't work because Protobuf's global -Werror
is applied later down the line, resulting in a build command like this:
[...] /usr/bin/gcc [...] '-std=c++20' -Wno-error [...] -Werror [...]
and also --copt="-Wno-maybe-uninitialized"?
This will work because -Wmaybe-uninitialized
is not explicitly invoked, so it can be easily overridden, but it needs to be applied to Bazel's exec configuration as well, like so:
bazel build package --config oss_linux -c opt --copt="-Wno-maybe-uninitialized" --host_copt="-Wno-maybe-uninitialized"
I personally would suggest mozc not to do any workaround, because it may introduce issue in the future if compiler did anything on the flag.
In case any found this issue, the flag that I use is
--cxxopt=-Wno-uninitialized --host_cxxopt=-Wno-uninitialized
It works with gcc and clang. (clang doesn't have maybe-uninitialized)
Description
I can't build Mozc by gcc-14.1.1 20240507.
Commit-id
d569f615fabd238b479bb6e44a8288b2eea4e0b1
Build target
CI build status
Environment
Build commands
Steps of command lines to reproduce your error.
Error logs
Additional context
I can build mozc by gcc-13.2.1 20240417.
Thank you for developing Mozc.