forked from open-telemetry/opentelemetry-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bazelrc
145 lines (114 loc) · 7.06 KB
/
.bazelrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# Track changes in folders referenced by copy_directory
startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1
build --features=parse_headers
#build --features=layering_check
# Don't try to build .so and .dylib shared libs (instead of static) libs on Linux/OSX
# For some reason, with clang-cl, it also tried to do on Windows, where dynamic linking just does not support it.
build --dynamic_mode=off
common --noenable_workspace
common --remote_download_all
# Avoid using c:\windows\system32\bash.exe
common:windows --shell_executable="c:\\program files\\git\\usr\\bin\\bash.exe"
common --nolegacy_external_runfiles
build --nolegacy_important_outputs
common --skip_incompatible_explicit_targets
# Enable automatic configs based on platform
common --enable_platform_specific_config
common --enable_runfiles
build --build_tag_filters=-jaeger,-opentracing,-opentracing_shim
test --test_tag_filters=-jaeger,-opentracing,-opentracing_shim
build --experimental_convenience_symlinks=clean
build:windows --copt="/Brepro" --copt="/guard:cf" --copt="/guard:ehcont" --copt="/Z7" --copt="/JMC-" --copt="/sdl"
build:windows --linkopt="/Brepro" --linkopt="/guard:cf" --linkopt="/guard:ehcont" --linkopt="/DEBUG:FULL" --linkopt="/CETCOMPAT" --linkopt="/SWAPRUN:NET,CD" --linkopt="/OPT:REF,ICF" --linkopt="/RELEASE" --linkopt="/DEBUGTYPE:CV,PDATA,FIXUP"
build:windows --host_linkopt="shell32.lib"
# Requires Visual Studio 2019 Build Tools installed in default location with the latest compiler (14.29.30133) for x64
build:windows --action_env=BAZEL_VC_FULL_VERSION=14.29.30133 --action_env=BAZEL_WINSDK_FULL_VERSION=10.0.22621.0
build:windows --host_action_env=BAZEL_VC_FULL_VERSION=14.29.30133 --host_action_env=BAZEL_WINSDK_FULL_VERSION=10.0.22621.0
# Set minimum supported C++ version
build:macos --host_cxxopt=-std=c++17 --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17 --cxxopt=-std=c++17
build:windows --host_cxxopt=/std:c++17 --cxxopt=/std:c++17
build:linux --copt=-DCIVETWEB_API= --copt=-DCIVETWEB_CXX_API= --cxxopt=-DCIVETWEB_API= --cxxopt=-DCIVETWEB_CXX_API=
build:linux --cxxopt=-fvisibility=hidden --copt=-fvisibility=hidden
#build:linux --fission=yes --copt=-g
build:linux --copt=-g --strip=never
build:macos --copt=-Wno-missing-template-arg-list-after-template-kw
build:macos --host_copt=-Wno-missing-template-arg-list-after-template-kw
build:macos --copt=-DCIVETWEB_API= --copt=-DCIVETWEB_CXX_API= --cxxopt=-DCIVETWEB_API= --cxxopt=-DCIVETWEB_CXX_API=
build:macos --cxxopt=-fvisibility=hidden --copt=-fvisibility=hidden
build:macos --strip=never --copt=-g --action_env=CC=/opt/homebrew/bin/clang --host_action_env=CC=/opt/homebrew/bin/clang
# https://github.com/Homebrew/homebrew-core/issues/178435#issuecomment-2250615995
build:macos --linkopt=-L/opt/homebrew/opt/llvm/lib/c++ --linkopt=-L/opt/homebrew/opt/llvm/lib/unwind --linkopt=-lunwind
build:macos --host_linkopt=-L/opt/homebrew/opt/llvm/lib/c++ --host_linkopt=-L/opt/homebrew/opt/llvm/lib/unwind --host_linkopt=-lunwind
# --config=asan : Address Sanitizer.
common:asan --copt -DADDRESS_SANITIZER
common:asan --copt -fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,null,return,returns-nonnull-attribute,shift-exponent,signed-integer-overflow,unreachable,vla-bound
common:asan --copt -fsanitize-address-use-after-scope
common:asan --copt -fno-sanitize-recover=all
common:asan --linkopt -fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,null,return,returns-nonnull-attribute,shift-exponent,signed-integer-overflow,unreachable,vla-bound
common:asan --linkopt -fsanitize-address-use-after-scope
common:asan --linkopt -fno-sanitize-recover=all
common:asan --cc_output_directory_tag=asan
# --config=tsan : Thread Sanitizer.
common:tsan --copt -fsanitize=thread
common:tsan --copt -DTHREAD_SANITIZER
common:tsan --linkopt -fsanitize=thread
common:tsan --cc_output_directory_tag=tsan
# This is needed to address false positive problem with abseil.The same setting as gRPC
# https://github.com/google/sanitizers/issues/953
common:tsan --test_env=TSAN_OPTIONS=report_atomic_races=0
test --test_size_filters=small,medium,large,enormous
test --test_timeout_filters=short,moderate,long,eternal
test --test_verbose_timeout_warnings
test --test_summary=terse
mod --charset=ascii
# This doesn't work with
# ../com_github_opentelemetry_proto/opentelemetry/proto/collector/metrics/v1/metrics_service.proto: File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be a
# common --experimental_sibling_repository_layout
common --nobuild_runfile_links
startup --windows_enable_symlinks
# Ideally all of these should get uncommented for further bazel migrations
# This list was taken from here https://github.com/bazelbuild/bazel/releases/tag/7.0.0
# common --incompatible_disable_starlark_host_transitions
# common --incompatible_stop_exporting_language_modules
common --incompatible_auto_exec_groups
common --incompatible_config_setting_private_default_visibility
common --incompatible_disable_native_repo_rules
common --incompatible_disable_non_executable_java_binary
# For jetbrains bazel plugin
# common --incompatible_disable_target_provider_fields
common --incompatible_disallow_empty_glob
common --incompatible_disallow_struct_provider_syntax
common --incompatible_strict_action_env
# Enabled for the experimental JetBrains bazel plugin
# common --incompatible_struct_has_no_methods
common --incompatible_use_plus_in_repo_names
build --@curl//:use_mbedtls=true
# build --@curl//:http_only=true
mod --lockfile_mode=refresh
# Select clang-cl to be the default compiler on Windows
build:windows --config=clang-cl
# See MODULE.bazel where we've disabled the platform/toolchain setup, but made it back here
build:clang-cl --host_platform=@otel_sdk//:x64_windows-clang-cl
build:clang-cl --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl
build:clang-cl --per_file_copt="protobuf\\+/.*@-Wno-invalid-offsetof"
build:clang-cl --host_per_file_copt="protobuf\\+/.*@-Wno-invalid-offsetof"
build:clang-cl --per_file_copt="c-ares\\+/.*@-Wno-macro-redefined"
build:clang-cl --host_per_file_copt="c-ares\\+/.*@-Wno-macro-redefined"
# LLVM 19.1.0
# opentelemetry/logs/logger.h(76,89):
# error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
# detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
# ^
build:clang-cl --copt=-Wno-missing-template-arg-list-after-template-kw
# still does not work yet
#common --incompatible_enable_proto_toolchain_resolution
# allow newer protobuf to compile
common --experimental_google_legacy_api
## This is what my ../top.bazelrc contains (not in the repo as local to my machine)
# build --disk_cache=f:/b/d
# common --repository_cache=f:/b/r
# startup --output_user_root=f:/b/u
try-import %workspace%/../top.bazelrc