Do not build with Werror by default (Bazel build)
authorMehdi Amini <joker.eph@gmail.com>
Wed, 9 Nov 2022 00:42:41 +0000 (00:42 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 9 Nov 2022 00:48:05 +0000 (00:48 +0000)
This seems like an anti-pattern to have -Werror on by default:
it is hostile to user as we can't ensure that all of the supported
platforms are warning-free, and any newer compiler could break the build
for a user who does not have a clear actionable way around it.

Reviewed By: GMNGeoffrey, kuhar

Differential Revision: https://reviews.llvm.org/D123481

utils/bazel/.bazelrc

index cf2c9c5..71007f2 100644 (file)
@@ -47,8 +47,8 @@ build:generic_clang --repo_env=CC=clang
 # C++17 standard version is required.
 build:generic_clang --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
 
-# Use `-Wall` and `-Werror` for Clang.
-build:generic_clang --copt=-Wall --copt=-Werror --host_copt=-Wall --host_copt=-Werror
+# Use `-Wall` for Clang.
+build:generic_clang --copt=-Wall --host_copt=-Wall
 
 # The Clang available on MacOS has a warning that isn't clean on MLIR code. The
 # warning doesn't show up with more recent Clangs, so just disable for now.
@@ -88,9 +88,6 @@ build:generic_gcc --cxxopt=-Wno-class-memaccess --host_cxxopt=-Wno-class-memacce
 build:generic_gcc --copt=-Wno-maybe-uninitialized --host_copt=-Wno-maybe-uninitialized
 build:generic_gcc --copt=-Wno-misleading-indentation --host_copt=-Wno-misleading-indentation
 
-# Use `-Werror` for GCC to make sure warnings don't slip past.
-build:generic_gcc --copt=-Werror --host_copt=-Werror
-
 ###############################################################################
 # Generic Windows flags common to both MSVC and Clang.
 ###############################################################################