Skip to content

Commit 1f404a3

Browse files
authored
Merge branch 'main' into fix-random-memory-leak
2 parents 6b44492 + 4520aa5 commit 1f404a3

File tree

370 files changed

+8075
-4274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+8075
-4274
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ common --enable_platform_specific_config
1010
# Needed by gRPC to build on some platforms.
1111
build --copt -DGRPC_BAZEL_BUILD
1212

13+
# Workaround abseil libraries missing symbols
14+
build:windows --dynamic_mode=off
15+
1316
# Set minimum supported C++ version
1417
build:macos --host_cxxopt=-std=c++14 --cxxopt=-std=c++14
1518
build:linux --host_cxxopt=-std=c++14 --cxxopt=-std=c++14

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.4.1
1+
7.1.1

.clang-tidy

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
Checks: >
5+
-*,
6+
performance-*,
7+
portability-*,
8+
abseil-*,
9+
-abseil-string-find-str-contains,
10+
bugprone-*,
11+
-bugprone-easily-swappable-parameters,
12+
-bugprone-implicit-widening-of-multiplication-result,
13+
-bugprone-inc-dec-in-conditions,
14+
-bugprone-narrowing-conversions,
15+
-bugprone-unchecked-optional-access,
16+
-bugprone-unhandled-exception-at-new,
17+
-bugprone-unused-local-non-trivial-variable,
18+
google-*,
19+
-google-build-using-namespace,
20+
-google-default-arguments,
21+
-google-explicit-constructor,
22+
-google-readability-avoid-underscore-in-googletest-name,
23+
-google-readability-braces-around-statements,
24+
-google-readability-namespace-comments,
25+
-google-readability-todo,
26+
-google-runtime-references,
27+
misc-*,
28+
-misc-const-correctness,
29+
-misc-include-cleaner,
30+
-misc-non-private-member-variables-in-classes,
31+
-misc-unused-alias-decls,
32+
-misc-use-anonymous-namespace,
33+
cppcoreguidelines-*,
34+
-cppcoreguidelines-avoid-c-arrays,
35+
-cppcoreguidelines-avoid-magic-numbers,
36+
-cppcoreguidelines-init-variables,
37+
-cppcoreguidelines-macro-usage,
38+
-cppcoreguidelines-non-private-member-variables-in-classes,
39+
-cppcoreguidelines-pro-*

.github/workflows/ci.yml

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,37 @@ on:
77
branches: [ main ]
88

99
jobs:
10+
arm64_test:
11+
name: CMake test arm64 (with modern protobuf,grpc and abseil)
12+
runs-on: actuated-arm64-4cpu-16gb
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: 'recursive'
17+
- name: setup
18+
env:
19+
PROTOBUF_VERSION: '23.3'
20+
ABSEIL_CPP_VERSION: '20230125.3'
21+
CXX_STANDARD: '14'
22+
CC: /usr/bin/gcc-10
23+
CXX: /usr/bin/g++-10
24+
run: |
25+
sudo -E ./ci/setup_gcc10.sh
26+
sudo -E ./ci/setup_cmake.sh
27+
sudo -E ./ci/setup_ci_environment.sh
28+
sudo -E ./ci/setup_googletest.sh
29+
sudo -E ./ci/install_abseil.sh
30+
sudo -E ./ci/install_protobuf.sh
31+
- name: run otlp exporter tests
32+
env:
33+
CC: /usr/bin/gcc-10
34+
CXX: /usr/bin/g++-10
35+
WITH_ABSEIL: 'ON'
36+
CXX_STANDARD: '14'
37+
run: |
38+
sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp
39+
./ci/do_ci.sh cmake.exporter.otprotocol.test
40+
1041
cmake_test:
1142
name: CMake test (without otlp-exporter)
1243
runs-on: ubuntu-latest
@@ -41,6 +72,7 @@ jobs:
4172
CXX: /usr/bin/g++-14
4273
PROTOBUF_VERSION: 21.12
4374
run: |
75+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
4476
sudo -E ./ci/setup_googletest.sh
4577
sudo -E ./ci/setup_ci_environment.sh
4678
sudo -E ./ci/install_protobuf.sh
@@ -73,6 +105,7 @@ jobs:
73105
CXX: /usr/bin/g++-14
74106
PROTOBUF_VERSION: 21.12
75107
run: |
108+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
76109
sudo -E ./ci/setup_googletest.sh
77110
sudo -E ./ci/setup_ci_environment.sh
78111
sudo -E ./ci/install_protobuf.sh
@@ -105,6 +138,7 @@ jobs:
105138
CXX: /usr/bin/clang++-18
106139
PROTOBUF_VERSION: 21.12
107140
run: |
141+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
108142
sudo -E ./ci/setup_googletest.sh
109143
sudo -E ./ci/setup_ci_environment.sh
110144
sudo -E ./ci/install_protobuf.sh
@@ -137,6 +171,7 @@ jobs:
137171
CXX: /usr/bin/clang++-18
138172
PROTOBUF_VERSION: 21.12
139173
run: |
174+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
140175
sudo -E ./ci/setup_googletest.sh
141176
sudo -E ./ci/setup_ci_environment.sh
142177
sudo -E ./ci/install_protobuf.sh
@@ -169,6 +204,7 @@ jobs:
169204
CXX: /usr/bin/clang++-18
170205
PROTOBUF_VERSION: 21.12
171206
run: |
207+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
172208
sudo -E ./ci/setup_googletest.sh
173209
sudo -E ./ci/setup_ci_environment.sh
174210
sudo -E ./ci/install_protobuf.sh
@@ -532,8 +568,8 @@ jobs:
532568
- name: run tests
533569
run: ./ci/do_ci.sh bazel.test
534570

535-
bazel_test_async:
536-
name: Bazel with async export
571+
bazel_no_bzlmod_test:
572+
name: Bazel without bzlmod
537573
runs-on: ubuntu-latest
538574
steps:
539575
- uses: actions/checkout@v4
@@ -551,10 +587,10 @@ jobs:
551587
sudo ./ci/setup_ci_environment.sh
552588
sudo ./ci/install_bazelisk.sh
553589
- name: run tests
554-
run: ./ci/do_ci.sh bazel.with_async_export.test
590+
run: ./ci/do_ci.sh bazel.no_bzlmod.test
555591

556-
bazel_with_abseil:
557-
name: Bazel with external abseil
592+
bazel_test_async:
593+
name: Bazel with async export
558594
runs-on: ubuntu-latest
559595
steps:
560596
- uses: actions/checkout@v4
@@ -572,7 +608,7 @@ jobs:
572608
sudo ./ci/setup_ci_environment.sh
573609
sudo ./ci/install_bazelisk.sh
574610
- name: run tests
575-
run: ./ci/do_ci.sh bazel.with_abseil
611+
run: ./ci/do_ci.sh bazel.with_async_export.test
576612

577613
bazel_valgrind:
578614
name: Bazel valgrind
@@ -726,11 +762,11 @@ jobs:
726762

727763
format:
728764
name: Format
729-
runs-on: ubuntu-20.04
765+
runs-on: ubuntu-24.04
730766
steps:
731767
- uses: actions/checkout@v4
732768
- name: setup
733-
run: sudo ./ci/install_format_tools.sh
769+
run: sudo apt remove needrestart && sudo ./ci/install_format_tools.sh #refer: https://github.com/actions/runner-images/issues/9937
734770
- name: run tests
735771
run: ./ci/do_ci.sh format
736772

.github/workflows/clang-tidy.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: clang-tidy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
clang-tidy:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
17+
- name: Setup Environment
18+
env:
19+
PROTOBUF_VERSION: '23.3'
20+
ABSEIL_CPP_VERSION: '20230125.3'
21+
CXX_STANDARD: '14'
22+
run: |
23+
sudo apt update -y
24+
sudo apt install -y --no-install-recommends --no-install-suggests \
25+
build-essential \
26+
iwyu \
27+
cmake \
28+
libssl-dev \
29+
libcurl4-openssl-dev \
30+
libprotobuf-dev \
31+
protobuf-compiler \
32+
libgmock-dev \
33+
libgtest-dev \
34+
libbenchmark-dev
35+
36+
if ! command -v clang-tidy &> /dev/null; then
37+
echo "clang-tidy could not be found"
38+
exit 1
39+
fi
40+
echo "Using clang-tidy version: $(clang-tidy --version)"
41+
echo "clang-tidy installed at: $(which clang-tidy)"
42+
43+
44+
- name: Prepare CMake
45+
env:
46+
CC: clang
47+
CXX: clang++
48+
run: |
49+
mkdir -p build && cd build
50+
echo "Running cmake..."
51+
cmake .. \
52+
-DCMAKE_CXX_STANDARD=14 \
53+
-DWITH_STL=CXX14 \
54+
-DWITH_OTLP_HTTP=ON \
55+
-DWITH_OTLP_FILE=ON \
56+
-DWITH_PROMETHEUS=ON \
57+
-DWITH_ZIPKIN=ON \
58+
-DWITH_ELASTICSEARCH=ON \
59+
-DWITH_OTLP_HTTP_COMPRESSION=ON \
60+
-DWITH_EXAMPLES=ON \
61+
-DWITH_EXAMPLES_HTTP=ON \
62+
-DBUILD_W3CTRACECONTEXT_TEST=ON \
63+
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
64+
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
65+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
66+
-DCMAKE_CXX_CLANG_TIDY="clang-tidy"
67+
68+
- name: Run clang-tidy
69+
run: |
70+
cd build
71+
make -j$(nproc) 2>&1 | tee -a clang-tidy.log || exit 1
72+
73+
- uses: actions/upload-artifact@v4
74+
with:
75+
name: Logs (clang-tidy)
76+
path: ./build/clang-tidy.log
77+
78+
- name: Count warnings
79+
run: |
80+
cd build
81+
COUNT=$(grep -c "warning:" clang-tidy.log)
82+
echo "clang-tidy reported ${COUNT} warning(s)"
83+
84+
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.

.github/workflows/dependencies_image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: docker/setup-buildx-action@v3
2222
-
2323
name: Build Image
24-
uses: docker/build-push-action@v5
24+
uses: docker/build-push-action@v6
2525
with:
2626
builder: ${{ steps.buildx.outputs.name }}
2727
context: ci/

.github/workflows/iwyu.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
name: include-what-you-use
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
iwyu:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: 'recursive'
17+
18+
- name: setup dependencies
19+
run: |
20+
sudo apt update -y
21+
sudo apt install -y --no-install-recommends --no-install-suggests \
22+
build-essential \
23+
iwyu \
24+
cmake \
25+
ninja-build \
26+
libssl-dev \
27+
libcurl4-openssl-dev \
28+
libprotobuf-dev \
29+
protobuf-compiler \
30+
libgmock-dev \
31+
libgtest-dev \
32+
libbenchmark-dev
33+
34+
- name: Prepare CMake
35+
run: |
36+
TOPDIR=`pwd`
37+
mkdir build && cd build
38+
CC="clang" CXX="clang++" cmake \
39+
-DCMAKE_CXX_STANDARD=14 \
40+
-DWITH_STL=CXX14 \
41+
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \
42+
-DBUILD_TESTING=OFF \
43+
-DBUILD_W3CTRACECONTEXT_TEST=OFF \
44+
-DWITH_OTLP_GRPC=OFF \
45+
-DWITH_OTLP_HTTP=ON \
46+
-DWITH_OTLP_FILE=ON \
47+
-DWITH_OTLP_HTTP_COMPRESSION=ON \
48+
-DWITH_ZIPKIN=ON \
49+
-DWITH_PROMETHEUS=OFF \
50+
..
51+
52+
- name: iwyu_tool
53+
run: |
54+
cd build
55+
make -k 2>&1 | tee -a iwyu.log
56+
57+
- uses: actions/upload-artifact@v4
58+
if: success() || failure()
59+
with:
60+
name: Logs (include-what-you-use)
61+
path: ./build/*.log
62+
63+
- name: count warnings
64+
run: |
65+
cd build
66+
COUNT=`grep -c "Warning:" iwyu.log`
67+
echo "include-what-you-use reported ${COUNT} warning(s)"
68+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
*.app
3838

3939
# Bazel files
40+
MODULE.bazel.lock
4041
/bazel-*
4142

4243
# Mac

.iwyu.imp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# include-what-you-use mapping file
5+
6+
[
7+
# Work around for C++ STL
8+
{ "include": ["<bits/chrono.h>", "private", "<chrono>", "public"] },
9+
10+
# Local opentelemetry-cpp
11+
12+
]
13+

0 commit comments

Comments
 (0)