Skip to content

Commit 46f37c7

Browse files
authored
Merge branch 'main' into ks/bazel-enable-incompatible_disallow_empty_glob
2 parents 707df3e + 5089105 commit 46f37c7

File tree

188 files changed

+5191
-2828
lines changed

Some content is hidden

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

188 files changed

+5191
-2828
lines changed

.bazelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# bazel configurations for running tests under sanitizers.
55
# Based on https://github.com/bazelment/trunk/blob/master/tools/bazel.rc
66

7+
# TODO: Remove once support is added, avoid MODULE.bazel creation for now
8+
common --enable_bzlmod=false
9+
710
# Enable automatic configs based on platform
811
common --enable_platform_specific_config
912

@@ -13,6 +16,9 @@ common --incompatible_disallow_empty_glob
1316
# Needed by gRPC to build on some platforms.
1417
build --copt -DGRPC_BAZEL_BUILD
1518

19+
# Workaround abseil libraries missing symbols
20+
build:windows --dynamic_mode=off
21+
1622
# Set minimum supported C++ version
1723
build:macos --host_cxxopt=-std=c++14 --cxxopt=-std=c++14
1824
build:linux --host_cxxopt=-std=c++14 --cxxopt=-std=c++14

.github/workflows/ci.yml

Lines changed: 37 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,26 @@ jobs:
2929
./ci/do_ci.sh cmake.test
3030
3131
cmake_gcc_maintainer_sync_test:
32-
name: CMake gcc 13 (maintainer mode, sync)
33-
runs-on: ubuntu-latest
32+
name: CMake gcc 14 (maintainer mode, sync)
33+
runs-on: ubuntu-24.04
3434
steps:
3535
- uses: actions/checkout@v4
3636
with:
3737
submodules: 'recursive'
3838
- name: setup
3939
env:
40-
CC: /usr/bin/gcc-13
41-
CXX: /usr/bin/g++-13
40+
CC: /usr/bin/gcc-14
41+
CXX: /usr/bin/g++-14
4242
PROTOBUF_VERSION: 21.12
4343
run: |
44+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
4445
sudo -E ./ci/setup_googletest.sh
4546
sudo -E ./ci/setup_ci_environment.sh
4647
sudo -E ./ci/install_protobuf.sh
4748
- name: run cmake gcc (maintainer mode, sync)
4849
env:
49-
CC: /usr/bin/gcc-13
50-
CXX: /usr/bin/g++-13
50+
CC: /usr/bin/gcc-14
51+
CXX: /usr/bin/g++-14
5152
run: |
5253
./ci/do_ci.sh cmake.maintainer.sync.test
5354
- name: generate test cert
@@ -61,25 +62,26 @@ jobs:
6162
(cd ./functional/otlp; ./run_test.sh)
6263
6364
cmake_gcc_maintainer_async_test:
64-
name: CMake gcc 13 (maintainer mode, async)
65-
runs-on: ubuntu-latest
65+
name: CMake gcc 14 (maintainer mode, async)
66+
runs-on: ubuntu-24.04
6667
steps:
6768
- uses: actions/checkout@v4
6869
with:
6970
submodules: 'recursive'
7071
- name: setup
7172
env:
72-
CC: /usr/bin/gcc-13
73-
CXX: /usr/bin/g++-13
73+
CC: /usr/bin/gcc-14
74+
CXX: /usr/bin/g++-14
7475
PROTOBUF_VERSION: 21.12
7576
run: |
77+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
7678
sudo -E ./ci/setup_googletest.sh
7779
sudo -E ./ci/setup_ci_environment.sh
7880
sudo -E ./ci/install_protobuf.sh
7981
- name: run cmake gcc (maintainer mode, async)
8082
env:
81-
CC: /usr/bin/gcc-13
82-
CXX: /usr/bin/g++-13
83+
CC: /usr/bin/gcc-14
84+
CXX: /usr/bin/g++-14
8385
run: |
8486
./ci/do_ci.sh cmake.maintainer.async.test
8587
- name: generate test cert
@@ -93,25 +95,26 @@ jobs:
9395
(cd ./functional/otlp; ./run_test.sh)
9496
9597
cmake_clang_maintainer_sync_test:
96-
name: CMake clang 15 (maintainer mode, sync)
97-
runs-on: ubuntu-latest
98+
name: CMake clang 18 (maintainer mode, sync)
99+
runs-on: ubuntu-24.04
98100
steps:
99101
- uses: actions/checkout@v4
100102
with:
101103
submodules: 'recursive'
102104
- name: setup
103105
env:
104-
CC: /usr/bin/clang-15
105-
CXX: /usr/bin/clang++-15
106+
CC: /usr/bin/clang-18
107+
CXX: /usr/bin/clang++-18
106108
PROTOBUF_VERSION: 21.12
107109
run: |
110+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
108111
sudo -E ./ci/setup_googletest.sh
109112
sudo -E ./ci/setup_ci_environment.sh
110113
sudo -E ./ci/install_protobuf.sh
111114
- name: run cmake clang (maintainer mode, sync)
112115
env:
113-
CC: /usr/bin/clang-15
114-
CXX: /usr/bin/clang++-15
116+
CC: /usr/bin/clang-18
117+
CXX: /usr/bin/clang++-18
115118
run: |
116119
./ci/do_ci.sh cmake.maintainer.sync.test
117120
- name: generate test cert
@@ -125,25 +128,26 @@ jobs:
125128
(cd ./functional/otlp; ./run_test.sh)
126129
127130
cmake_clang_maintainer_async_test:
128-
name: CMake clang 15 (maintainer mode, async)
129-
runs-on: ubuntu-latest
131+
name: CMake clang 18 (maintainer mode, async)
132+
runs-on: ubuntu-24.04
130133
steps:
131134
- uses: actions/checkout@v4
132135
with:
133136
submodules: 'recursive'
134137
- name: setup
135138
env:
136-
CC: /usr/bin/clang-15
137-
CXX: /usr/bin/clang++-15
139+
CC: /usr/bin/clang-18
140+
CXX: /usr/bin/clang++-18
138141
PROTOBUF_VERSION: 21.12
139142
run: |
143+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
140144
sudo -E ./ci/setup_googletest.sh
141145
sudo -E ./ci/setup_ci_environment.sh
142146
sudo -E ./ci/install_protobuf.sh
143147
- name: run cmake clang (maintainer mode, async)
144148
env:
145-
CC: /usr/bin/clang-15
146-
CXX: /usr/bin/clang++-15
149+
CC: /usr/bin/clang-18
150+
CXX: /usr/bin/clang++-18
147151
run: |
148152
./ci/do_ci.sh cmake.maintainer.async.test
149153
- name: generate test cert
@@ -157,25 +161,26 @@ jobs:
157161
(cd ./functional/otlp; ./run_test.sh)
158162
159163
cmake_clang_maintainer_abiv2_test:
160-
name: CMake clang 15 (maintainer mode, abiv2)
161-
runs-on: ubuntu-latest
164+
name: CMake clang 18 (maintainer mode, abiv2)
165+
runs-on: ubuntu-24.04
162166
steps:
163167
- uses: actions/checkout@v4
164168
with:
165169
submodules: 'recursive'
166170
- name: setup
167171
env:
168-
CC: /usr/bin/clang-15
169-
CXX: /usr/bin/clang++-15
172+
CC: /usr/bin/clang-18
173+
CXX: /usr/bin/clang++-18
170174
PROTOBUF_VERSION: 21.12
171175
run: |
176+
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
172177
sudo -E ./ci/setup_googletest.sh
173178
sudo -E ./ci/setup_ci_environment.sh
174179
sudo -E ./ci/install_protobuf.sh
175180
- name: run cmake clang (maintainer mode, abiv2)
176181
env:
177-
CC: /usr/bin/clang-15
178-
CXX: /usr/bin/clang++-15
182+
CC: /usr/bin/clang-18
183+
CXX: /usr/bin/clang++-18
179184
run: |
180185
./ci/do_ci.sh cmake.maintainer.abiv2.test
181186
- name: generate test cert
@@ -553,27 +558,6 @@ jobs:
553558
- name: run tests
554559
run: ./ci/do_ci.sh bazel.with_async_export.test
555560

556-
bazel_with_abseil:
557-
name: Bazel with external abseil
558-
runs-on: ubuntu-latest
559-
steps:
560-
- uses: actions/checkout@v4
561-
with:
562-
submodules: 'recursive'
563-
- name: Mount Bazel Cache
564-
uses: actions/cache@v4
565-
env:
566-
cache-name: bazel_cache
567-
with:
568-
path: /home/runner/.cache/bazel
569-
key: bazel_test
570-
- name: setup
571-
run: |
572-
sudo ./ci/setup_ci_environment.sh
573-
sudo ./ci/install_bazelisk.sh
574-
- name: run tests
575-
run: ./ci/do_ci.sh bazel.with_abseil
576-
577561
bazel_valgrind:
578562
name: Bazel valgrind
579563
runs-on: ubuntu-latest
@@ -726,11 +710,11 @@ jobs:
726710

727711
format:
728712
name: Format
729-
runs-on: ubuntu-20.04
713+
runs-on: ubuntu-24.04
730714
steps:
731715
- uses: actions/checkout@v4
732716
- name: setup
733-
run: sudo ./ci/install_format_tools.sh
717+
run: sudo apt remove needrestart && sudo ./ci/install_format_tools.sh #refer: https://github.com/actions/runner-images/issues/9937
734718
- name: run tests
735719
run: ./ci/do_ci.sh format
736720

.github/workflows/iwyu.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \
40+
-DBUILD_TESTING=OFF \
41+
-DBUILD_W3CTRACECONTEXT_TEST=OFF \
42+
..
43+
44+
- name: iwyu_tool
45+
run: |
46+
cd build
47+
make -k 2>&1 | tee -a iwyu.log
48+
49+
- uses: actions/upload-artifact@v4
50+
if: success() || failure()
51+
with:
52+
name: Logs (include-what-you-use)
53+
path: ./build/*.log
54+
55+
- name: count warnings
56+
run: |
57+
cd build
58+
COUNT=`grep -c "Warning:" iwyu.log`
59+
echo "include-what-you-use reported ${COUNT} warning(s)"
60+

.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+

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,63 @@ Increment the:
1818
* [SDK] Update ExemplarFilter and ExemplarReservoir for spec
1919
[#2372](https://github.com/open-telemetry/opentelemetry-cpp/pull/2372)
2020

21+
* [CI] Upgrade to clang-format 18
22+
[#2684](https://github.com/open-telemetry/opentelemetry-cpp/pull/2684)
23+
24+
* [API/SDK] Provider cleanup
25+
[#2664](https://github.com/open-telemetry/opentelemetry-cpp/pull/2664)
26+
27+
Important changes:
28+
29+
* [API/SDK] Provider cleanup
30+
[#2664](https://github.com/open-telemetry/opentelemetry-cpp/pull/2664)
31+
* Before this fix:
32+
* The API class `opentelemetry::trace::Tracer` exposed methods such
33+
as `ForceFlush()`, `ForceFlushWithMicroseconds()`, `Close()`
34+
and `CloseWithMicroseconds()`.
35+
* These methods are meant to be used when configuring the SDK,
36+
and should not be part of the API. Exposing them was an oversight.
37+
* Two of these methods are virtual, and therefore part of the ABI.
38+
* After this fix:
39+
* In `OPENTELEMETRY_ABI_VERSION_NO 1`, nothing is changed,
40+
because removing this code would break the ABI.
41+
* In `OPENTELEMETRY_ABI_VERSION_NO 2`, these methods are moved
42+
from the API to the SDK. This is a breaking change for ABI version 2,
43+
which is still experimental.
44+
* In all cases, instrumenting an application should not
45+
invoke flush or close on a tracer, do not use these methods.
46+
47+
Breaking changes:
48+
49+
* [API/SDK] Provider cleanup
50+
[#2664](https://github.com/open-telemetry/opentelemetry-cpp/pull/2664)
51+
* Before this fix:
52+
* SDK factory methods such as:
53+
* opentelemetry::sdk::trace::TracerProviderFactory::Create()
54+
* opentelemetry::sdk::metrics::MeterProviderFactory::Create()
55+
* opentelemetry::sdk::logs::LoggerProviderFactory::Create()
56+
* opentelemetry::sdk::logs::EventLoggerProviderFactory::Create()
57+
returned an API object (opentelemetry::trace::TracerProvider)
58+
to the caller.
59+
* After this fix, these methods return an SDK level object
60+
(opentelemetry::sdk::trace::TracerProvider) to the caller.
61+
* Returning an SDK object is necessary for the application to
62+
cleanup and invoke SDK level methods, such as ForceFlush(),
63+
on a provider.
64+
* The application code that configures the SDK, by calling
65+
the various provider factories, may need adjustment.
66+
* All the examples have been updated, and in particular no
67+
longer perform static_cast do convert an API object to an SDK object.
68+
Please refer to examples for guidance on how to adjust.
69+
* If adjusting application code is impractical,
70+
an alternate and temporary solution is to build with option
71+
WITH_DEPRECATED_SDK_FACTORY=ON in CMake.
72+
* Option WITH_DEPRECATED_SDK_FACTORY=ON will allow to build code
73+
without application changes, posponing changes for later.
74+
* WITH_DEPRECATED_SDK_FACTORY=ON is temporary, only to provide
75+
an easier migration path. Expect this flag to be removed,
76+
as early as by the next release.
77+
2178
Notes on experimental features:
2279

2380
* [#2372](https://github.com/open-telemetry/opentelemetry-cpp/issues/2372)

0 commit comments

Comments
 (0)