Skip to content

Commit 7f1a00f

Browse files
committed
Disable ANDROID_HOME as it's causing issues with the github windows runner
2 parents 9ca750e + 016155f commit 7f1a00f

File tree

30 files changed

+136
-117
lines changed

30 files changed

+136
-117
lines changed

.bazelrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44
# Track changes in folders referenced by copy_directory
55
startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1
66

7+
# Disable ANDROID detection, as it breaks with github actions on the Windows image
8+
# ERROR: D:/a/opentelemetry-cpp/opentelemetry-cpp/BUILD:141:24: While resolving toolchains for target
9+
# //:otel_sdk_r (1512d13): invalid registered toolchain '@androidsdk//:sdk-toolchain':
10+
# error loading package '@@rules_android++android_sdk_repository_extension+androidsdk//':
11+
# at D:/b/cefevaif/external/rules_android++android_sdk_repository_extension+androidsdk/helper.bzl:16:6:
12+
# Unable to find package for @@[unknown repo 'local_config_platform'
13+
# requested from @@rules_android++android_sdk_repository_extension+androidsdk]//:constraints.bzl:
14+
# The repository '@@[unknown repo 'local_config_platform' requested from @@rules_android++android_sdk_repository_extension+androidsdk]'
15+
# could not be resolved:
16+
# No repository visible as '@local_config_platform' from repository '@@rules_android++android_sdk_repository_extension+androidsdk'.
17+
# The local_config_platform built-in module is disabled by --incompatible_disable_native_repo_rules.
18+
# Either remove that flag, or replace @local_config_platform with @platforms//host.
19+
common --repo_env=ANDROID_HOME=
20+
common --action_env=ANDROID_HOME=
21+
common --host_action_env=ANDROID_HOME=
22+
common --test_env=ANDROID_HOME=
23+
724
#build --features=parse_headers
825
#build --features=layering_check
926

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.3.0rc3
1+
8.3.0

.github/workflows/clang-tidy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
matrix:
1818
include:
1919
- cmake_options: all-options-abiv1-preview
20-
warning_limit: 215
20+
warning_limit: 172
2121
- cmake_options: all-options-abiv2-preview
22-
warning_limit: 216
22+
warning_limit: 173
2323
steps:
2424
- name: Harden the runner (Audit all outbound calls)
2525
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1

BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,8 @@ native_binary(
513513
src = "@multitool//tools/multitool",
514514
)
515515

516+
exports_files(["asan_ignorelist.txt"])
517+
516518
#exports_files("multitool.lock.json")
517519

518520
# copy_file(

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Increment the:
3030
* [REMOVAL] Removed deprecated semantic convention header files
3131
[#3475](https://github.com/open-telemetry/opentelemetry-cpp/pull/3475)
3232

33+
* [CodeHealth] Fix clang-tidy warnings part 1
34+
[#3493](https://github.com/open-telemetry/opentelemetry-cpp/pull/3493)
35+
3336
Important changes:
3437

3538
* [REMOVAL] Removed deprecated semantic convention header files

api/include/opentelemetry/common/macros.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
// # endif
2323
// #endif
2424

25-
// #if !defined(OPENTELEMETRY_HAVE_FEATURE)
26-
// # ifdef __has_feature
27-
// # define OPENTELEMETRY_HAVE_FEATURE(f) __has_feature(f)
28-
// # else
29-
// # define OPENTELEMETRY_HAVE_FEATURE(f) 0
30-
// # endif
31-
// #endif
25+
#if !defined(OPENTELEMETRY_HAVE_FEATURE)
26+
# ifdef __has_feature
27+
# define OPENTELEMETRY_HAVE_FEATURE(f) __has_feature(f)
28+
# else
29+
# define OPENTELEMETRY_HAVE_FEATURE(f) 0
30+
# endif
31+
#endif
3232

3333
/*
3434
has feature
@@ -44,13 +44,13 @@
4444
GCC: https://gcc.gnu.org/gcc-5/changes.html
4545
Clang: https://clang.llvm.org/docs/LanguageExtensions.html
4646
*/
47-
// #if !defined(OPENTELEMETRY_HAVE_ATTRIBUTE)
48-
// # ifdef __has_attribute
49-
// # define OPENTELEMETRY_HAVE_ATTRIBUTE(x) __has_attribute(x)
50-
// # else
51-
// # define OPENTELEMETRY_HAVE_ATTRIBUTE(x) 0
52-
// # endif
53-
// #endif
47+
#if !defined(OPENTELEMETRY_HAVE_ATTRIBUTE)
48+
# ifdef __has_attribute
49+
# define OPENTELEMETRY_HAVE_ATTRIBUTE(x) __has_attribute(x)
50+
# else
51+
# define OPENTELEMETRY_HAVE_ATTRIBUTE(x) 0
52+
# endif
53+
#endif
5454

5555
/*
5656
OPENTELEMETRY_HAVE_CPP_ATTRIBUTE
@@ -470,22 +470,22 @@ point.
470470
// OPENTELEMETRY_HAVE_THREAD_SANITIZER
471471
//
472472
// ThreadSanitizer (TSan) is a fast data race detector.
473-
// #ifndef OPENTELEMETRY_HAVE_THREAD_SANITIZER
474-
// # if defined(__SANITIZE_THREAD__)
475-
// # define OPENTELEMETRY_HAVE_THREAD_SANITIZER 1
476-
// # elif OPENTELEMETRY_HAVE_FEATURE(thread_sanitizer)
477-
// # define OPENTELEMETRY_HAVE_THREAD_SANITIZER 1
478-
// # else
479-
// # define OPENTELEMETRY_HAVE_THREAD_SANITIZER 0
480-
// # endif
481-
// #endif
473+
#ifndef OPENTELEMETRY_HAVE_THREAD_SANITIZER
474+
# if defined(__SANITIZE_THREAD__)
475+
# define OPENTELEMETRY_HAVE_THREAD_SANITIZER 1
476+
# elif OPENTELEMETRY_HAVE_FEATURE(thread_sanitizer)
477+
# define OPENTELEMETRY_HAVE_THREAD_SANITIZER 1
478+
# else
479+
# define OPENTELEMETRY_HAVE_THREAD_SANITIZER 0
480+
# endif
481+
#endif
482482

483-
// #if OPENTELEMETRY_HAVE_THREAD_SANITIZER && OPENTELEMETRY_HAVE_ATTRIBUTE(no_sanitize_thread)
484-
// # define OPENTELEMETRY_SANITIZER_NO_THREAD \
485-
// __attribute__((no_sanitize_thread)) // __attribute__((no_sanitize("thread")))
486-
// #else
487-
// # define OPENTELEMETRY_SANITIZER_NO_THREAD
488-
// #endif
483+
#if OPENTELEMETRY_HAVE_THREAD_SANITIZER && OPENTELEMETRY_HAVE_ATTRIBUTE(no_sanitize_thread)
484+
# define OPENTELEMETRY_SANITIZER_NO_THREAD \
485+
__attribute__((no_sanitize_thread)) // __attribute__((no_sanitize("thread")))
486+
#else
487+
# define OPENTELEMETRY_SANITIZER_NO_THREAD
488+
#endif
489489

490490
// OPENTELEMETRY_HAVE_ADDRESS_SANITIZER
491491
//

bazel/llvm_windows_install.BUILD

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
ASAN_FOLDER = "lib/clang/20/lib/windows/"
1+
LIBCLANG_DIR = "lib/clang/20/"
2+
SHARE_DIR = LIBCLANG_DIR + "share/"
3+
WIN_DIR = LIBCLANG_DIR + "lib/windows/"
24

35
cc_import(
46
name = "asan1",
5-
interface_library = ASAN_FOLDER + "clang_rt.asan_dynamic-x86_64.lib",
6-
shared_library = ASAN_FOLDER + "clang_rt.asan_dynamic-x86_64.dll",
7+
interface_library = WIN_DIR + "clang_rt.asan_dynamic-x86_64.lib",
8+
shared_library = WIN_DIR + "clang_rt.asan_dynamic-x86_64.dll",
79
#alwayslink = 1,
810
visibility = ["//visibility:public"],
911
)
1012

1113
cc_import(
1214
name = "asan2",
13-
static_library = ASAN_FOLDER + "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib",
15+
static_library = WIN_DIR + "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib",
1416
#alwayslink = 1,
1517
visibility = ["//visibility:public"],
1618
)
1719

20+
exports_files(
21+
SHARE_DIR + "asan_ignorelist.txt"
22+
)
23+
1824
cc_library(
1925
name = "asan",
2026
deps = ["asan1", "asan2"],
2127
#alwayslink = 1,
2228
visibility = ["//visibility:public"],
23-
)
29+
)

examples/otlp/grpc_metric_main.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ int main(int argc, char *argv[])
113113
}
114114
}
115115
}
116-
std::cout << "Using endpoint: " << exporter_options.endpoint << std::endl;
117-
std::cout << "Using example type: " << example_type << std::endl;
118-
std::cout << "Using cacert path: " << exporter_options.ssl_credentials_cacert_path << std::endl;
119-
std::cout << "Using ssl credentials: " << exporter_options.use_ssl_credentials << std::endl;
116+
std::cout << "Using endpoint: " << exporter_options.endpoint << "\n";
117+
std::cout << "Using example type: " << example_type << "\n";
118+
std::cout << "Using cacert path: " << exporter_options.ssl_credentials_cacert_path << "\n";
119+
std::cout << "Using ssl credentials: " << exporter_options.use_ssl_credentials << "\n";
120120

121121
// Removing this line will leave the default noop MetricProvider in place.
122122

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ class OPENTELEMETRY_EXPORT_TYPE OtlpFileClient
8181
bool is_shutdown_;
8282

8383
// The configuration options associated with this file client.
84-
const OtlpFileClientOptions options_;
84+
OtlpFileClientOptions options_;
8585
// The runtime options associated with this file client.
86-
const OtlpFileClientRuntimeOptions runtime_options_;
86+
OtlpFileClientRuntimeOptions runtime_options_;
8787

8888
opentelemetry::nostd::shared_ptr<OtlpFileAppender> backend_;
8989
};

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_client_runtime_options.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ namespace otlp
1919
*/
2020
struct OtlpFileClientRuntimeOptions
2121
{
22-
OtlpFileClientRuntimeOptions() = default;
23-
~OtlpFileClientRuntimeOptions() = default;
24-
2522
std::shared_ptr<sdk::common::ThreadInstrumentation> thread_instrumentation =
2623
std::shared_ptr<sdk::common::ThreadInstrumentation>(nullptr);
2724
};

0 commit comments

Comments
 (0)