Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 26 additions & 78 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@ startup --host_jvm_args="-DBAZEL_TRACK_SOURCE_DIRECTORIES=1"
# global
#############################################################################


try-import %workspace%/ci.bazelrc

common --noincompatible_disallow_empty_glob
common --noincompatible_disallow_ctx_resolve_tools
common --legacy_external_runfiles

fetch --color=yes
run --color=yes
build --color=yes

common --registry=https://bcr.bazel.build/
common --registry=https://raw.githubusercontent.com/envoyproxy/bazel-registry/6a42f80bb6ef909c8bfd44286a96a7e24388b86a
common --registry=https://raw.githubusercontent.com/envoyproxy/bazel-registry/462e7c8781a6a94be81f7f3383a1c88b5347c58f
# common --registry=file:///bazel-registry
# this can be useful for dev
# common --lockfile_mode=off
Expand All @@ -55,8 +54,6 @@ build --incompatible_strict_action_env
# silence absl logspam.
build --copt=-DABSL_MIN_LOG_LEVEL=4
# Global C++ standard and common warning suppressions
build --cxxopt=-std=c++20 --host_cxxopt=-std=c++20
build --define envoy_mobile_listener=enabled
build --experimental_repository_downloader_retries=2
build --experimental_cc_static_library
build --enable_platform_specific_config
Expand Down Expand Up @@ -123,13 +120,12 @@ build --@librdkafka//:with_ssl=false
build --@librdkafka//:with_zlib=false
build --per_file_copt=contrib/kafka/.*\.cc@-Wno-old-style-cast

# protobuf
common --incompatible_enable_proto_toolchain_resolution=true
common --@protobuf//bazel/toolchains:prefer_prebuilt_protoc
common --incompatible_enable_proto_toolchain_resolution

# these are here to detect if the toolchain attempts to compile protoc
common --per_file_copt=bazel-out/.*/bin/external/protobuf.*/protoc@--THIS_CC_TOOLCHAIN_IS_BROKEN

build --per_file_copt=external/envoy_api.*/route_components\.pb\.cc@-Wno-deprecated-declarations

#############################################################################
# os
Expand All @@ -148,31 +144,20 @@ build:linux --features=per_object_debug_info
build:macos --action_env=PATH=/opt/homebrew/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
build:macos --host_action_env=PATH=/opt/homebrew/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
build:macos --define tcmalloc=disabled
build:macos --cxxopt=-Wno-nullability-completeness
build:macos --cxxopt=-std=c++20 --host_cxxopt=-std=c++20


#############################################################################
# compiler
#############################################################################

# Common flags for Clang (shared between all clang variants)
common:clang-common --linkopt=-fuse-ld=lld
common:clang-common --cxxopt=-Wno-nullability-completeness

# Clang with libc++ (default)
common:clang --config=clang-common
common:clang --linkopt=-fuse-ld=lld
common:clang --cxxopt=-Wno-nullability-completeness
common:clang --config=libc++
common:clang --host_platform=@clang_platform
common:clang --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1

# Clang installed to non-standard location (ie not /opt/llvm/)
common:clang-local --config=clang-common
common:clang-local --config=libc++

# TODO(phlax): Remove this once a proper fix for the deprecated enum lands
build:clang --copt=--system-header-prefix=envoy/config/route/v3/route_components.pb.h
build:clang --per_file_copt=external/envoy_api.*/route_components\.pb\.cc@-Wno-deprecated-declarations

# Use gold linker for gcc compiler.
build:gcc --config=libstdc++
build:gcc --test_env=HEAPCHECK=
Expand Down Expand Up @@ -201,13 +186,9 @@ common:libc++ --action_env=LDFLAGS="-stdlib=libc++ -fuse-ld=lld"
common:libc++ --action_env=BAZEL_CXXOPTS=-stdlib=libc++
common:libc++ --action_env=BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a
common:libc++ --action_env=BAZEL_LINKOPTS=-lm:-pthread
common:libc++ --define force_libcpp=enabled
common:libc++ --@envoy//bazel:libc++=true

# libstdc++ - currently only used for gcc
build:libstdc++ --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a
build:libstdc++ --@envoy//bazel:libc++=false
build:libstdc++ --@envoy//bazel:libstdc++=true
build:libstdc++ --repo_env=BAZEL_USE_LIBSTDCPP=True


Expand Down Expand Up @@ -264,6 +245,9 @@ build:compile-time-options --copt=-Wno-error=deprecated-enum-enum-conversion
build:compile-time-options --test_env=ENVOY_HAS_EXTRA_EXTENSIONS=true
build:compile-time-options --@envoy//bazel:http3=False
build:compile-time-options --@envoy//source/extensions/filters/http/kill_request:enabled
# This is a Protobuf feature which breaks dynamic casting of messages. Turn it
# on here to prevent raw dynamic_casts from being added to Envoy.
build:compile-time-options --copt=-DPROTOBUF_ENABLE_CUSTOM_VTABLE=1


#############################################################################
Expand Down Expand Up @@ -329,7 +313,7 @@ build:asan-common --test_tag_filters=-no_san
# Flag undefined was dropped from both the lines to allow CI/ASAN to pass. # unique
build:asan-common --copt -fsanitize=address # unique
build:asan-common --linkopt -fsanitize=address # unique
# vptr and function sanitizer are enabled in asan when using --config=clang.
# vptr and function sanitizer are enabled in asan.
build:asan-common --copt -fno-sanitize=vptr,function
build:asan-common --linkopt -fno-sanitize=vptr,function
build:asan-common --copt -DADDRESS_SANITIZER=1
Expand Down Expand Up @@ -424,7 +408,6 @@ build:oss-fuzz --linkopt=-fno-sanitize=vptr
build:oss-fuzz --define=tcmalloc=disabled
build:oss-fuzz --define=signal_trace=disabled
build:oss-fuzz --copt=-D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
build:oss-fuzz --define=force_libcpp=enabled
build:oss-fuzz --linkopt=-lc++
build:oss-fuzz --linkopt=-pthread

Expand Down Expand Up @@ -467,18 +450,13 @@ build:sizeopt -c opt --copt -Os


#############################################################################
# remote: Setup for cache, BES, RBE, and Docker workers
#############################################################################

build:remote --spawn_strategy=remote,sandboxed,local
build:remote --strategy=Javac=remote,sandboxed,local
build:remote --strategy=Closure=remote,sandboxed,local
build:remote --strategy=Genrule=remote,sandboxed,local
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# Nighthawk Custom Configurations
#############################################################################

## RBE (Engflow Envoy)

# this is not included in the `--config=rbe` target - set it to publish to engflow ui
# Set to publish to Engflow UI
common:bes --bes_backend=grpcs://mordenite.cluster.engflow.com/
common:bes --bes_results_url=https://mordenite.cluster.engflow.com/invocation/
common:bes --bes_timeout=3600s
Expand All @@ -496,11 +474,11 @@ common:engflow-common --remote_retry_max_delay=60s
# Recover when blobs are evicted from the CAS mid-build (common during patch releases).
common:engflow-common --experimental_remote_cache_eviction_retries=5

# this provides access to RBE+cache
# Provides access to RBE+cache
common:rbe --config=remote-cache
common:rbe --config=remote-exec

# this provides access to just cache
# Provides access to just cache
common:remote-cache --config=engflow-common
common:remote-cache --remote_cache=grpcs://mordenite.cluster.engflow.com
common:remote-cache --experimental_remote_downloader=grpcs://mordenite.cluster.engflow.com
Expand All @@ -510,6 +488,14 @@ common:remote-exec --remote_executor=grpcs://mordenite.cluster.engflow.com
common:remote-exec --jobs=200
common:remote-exec --define=engflow_rbe=true

# CI configurations
build:remote-ci --config=ci
build:remote-ci --remote_download_minimal

common:ci --noshow_progress
common:ci --noshow_loading_progress
common:ci --test_output=errors

# Docker sandboxes
build:docker-sandbox --spawn_strategy=docker
build:docker-sandbox --strategy=Javac=docker
Expand Down Expand Up @@ -537,44 +523,6 @@ build:docker-tsan --config=docker-sandbox
build:docker-tsan --config=clang
build:docker-tsan --config=tsan


#############################################################################
# ci
#############################################################################

# CI configurations
build:remote-ci --config=ci
build:remote-ci --remote_download_minimal

# Note this config is used by mobile CI also.
common:ci --noshow_progress
common:ci --noshow_loading_progress
common:ci --test_output=errors


#############################################################################
# debug: Various Bazel debugging flags
#############################################################################
# debug/bazel
common:debug-bazel --announce_rc
common:debug-bazel -s
# debug/sandbox
common:debug-sandbox --verbose_failures
common:debug-sandbox --sandbox_debug
# debug/coverage
common:debug-coverage --action_env=VERBOSE_COVERAGE=true
common:debug-coverage --test_env=VERBOSE_COVERAGE=true
common:debug-coverage --test_env=DISPLAY_LCOV_CMD=true
common:debug-coverage --config=debug-tests
# debug/tests
common:debug-tests --test_output=all
# debug/everything
common:debug --config=debug-bazel
common:debug --config=debug-sandbox
common:debug --config=debug-coverage
common:debug --config=debug-tests

try-import %workspace%/repo.bazelrc
try-import %workspace%/clang.bazelrc
try-import %workspace%/user.bazelrc
try-import %workspace%/local_tsan.bazelrc
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Envoy commit to use
ENVOY_COMMIT = "11d86f45683c097ddc576e7f6bac5bbee59bacf9"
ENVOY_COMMIT = "c6618277e3bd87a5ed74227a4e2622608e126df1"

module(
name = "nighthawk",
Expand All @@ -21,7 +21,7 @@ bazel_dep(name = "grpc", version = "1.83.0.envoy")
bazel_dep(name = "librdkafka", version = "2.15.0")
bazel_dep(name = "quiche", version = "0.0.0-260922-7f07dc4.envoy")
bazel_dep(name = "toolchains_llvm", version = "1.9.1.envoy")
bazel_dep(name = "envoy_toolshed", version = "0.5.1.envoy")
bazel_dep(name = "envoy_toolshed", version = "0.5.2.envoy")
bazel_dep(name = "zlib-ng", version = "2.3.3.bcr.2")
bazel_dep(name = "googletest", version = "1.18.0.bcr.1")
bazel_dep(name = "googleapis", version = "0.0.0-20251003-2193a2bf")
Expand Down
Loading
Loading