From 7c6b9dbcaf43af9a281029121392aef31445b770 Mon Sep 17 00:00:00 2001 From: Carbo Kuo Date: Tue, 6 Aug 2024 13:43:02 -0400 Subject: [PATCH 1/2] [BUILD] Add abi_version_no bazel flag. (#3020) --- api/BUILD | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/api/BUILD b/api/BUILD index fdfe3ca146..dfc7d3c645 100644 --- a/api/BUILD +++ b/api/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "int_flag", "string_flag") package(default_visibility = ["//visibility:public"]) @@ -35,6 +35,9 @@ cc_library( ":set_cxx_stdlib_2020": ["OPENTELEMETRY_STL_VERSION=2020"], ":set_cxx_stdlib_2023": ["OPENTELEMETRY_STL_VERSION=2023"], "//conditions:default": [], + }) + select({ + ":abi_version_no_1": ["OPENTELEMETRY_ABI_VERSION_NO=1"], + ":abi_version_no_2": ["OPENTELEMETRY_ABI_VERSION_NO=2"], }), strip_include_prefix = "include", tags = ["api"], @@ -61,3 +64,18 @@ bool_flag( build_setting_default = False, deprecation = "The value of this flag is ignored. Bazel builds always depend on Abseil for its pre-adopted `std::` types. You should remove this flag from your build command.", ) + +int_flag( + name = "abi_version_no", + build_setting_default = 1, +) + +config_setting( + name = "abi_version_no_1", + flag_values = {":abi_version_no": "1"}, +) + +config_setting( + name = "abi_version_no_2", + flag_values = {":abi_version_no": "2"}, +) From cc60934199c39506b69e80263eaa1503a03bf7f3 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 8 Aug 2024 21:13:54 +0200 Subject: [PATCH 2/2] [Code health] Expand iwyu coverage to include unit tests. (#3022) --- .github/workflows/iwyu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index 2c84b84cdc..c675193cdb 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -39,8 +39,8 @@ jobs: -DCMAKE_CXX_STANDARD=14 \ -DWITH_STL=CXX14 \ -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \ - -DBUILD_TESTING=OFF \ - -DBUILD_W3CTRACECONTEXT_TEST=OFF \ + -DBUILD_TESTING=ON \ + -DBUILD_W3CTRACECONTEXT_TEST=ON \ -DWITH_OTLP_GRPC=OFF \ -DWITH_OTLP_HTTP=ON \ -DWITH_OTLP_FILE=ON \