From df038bf6d401004fe15fc35e6c09cf047a1a4965 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Tue, 19 Nov 2024 16:52:03 +0100 Subject: [PATCH] SERVER-97327 Use -fdiagnostics-color for clang/gcc in bazel (#29340) GitOrigin-RevId: 1db4813d49a699df97ec0cd545e60a6a9a4c5f3a --- bazel/mongo_src_rules.bzl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bazel/mongo_src_rules.bzl b/bazel/mongo_src_rules.bzl index 3e0903fe3ba..ba33c47cf34 100644 --- a/bazel/mongo_src_rules.bzl +++ b/bazel/mongo_src_rules.bzl @@ -2,12 +2,12 @@ BUILD files in the "src/" subtree. """ +load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") +load("@com_github_grpc_grpc//bazel:generate_cc.bzl", "generate_cc") +load("@com_github_grpc_grpc//bazel:protobuf.bzl", "well_known_proto_libs") load("@poetry//:dependencies.bzl", "dependency") load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") load("@rules_proto//proto:defs.bzl", "proto_library") -load("@com_github_grpc_grpc//bazel:generate_cc.bzl", "generate_cc") -load("@com_github_grpc_grpc//bazel:protobuf.bzl", "well_known_proto_libs") -load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") load( "//bazel:header_deps.bzl", "HEADER_DEP_SUFFIX", @@ -614,6 +614,9 @@ GCC_OR_CLANG_GENERAL_COPTS = select({ # Disable TBAA optimization "-fno-strict-aliasing", + + # Show colors even though bazel captures stdout/stderr + "-fdiagnostics-color", ], "//conditions:default": [], })