Skip to content

Commit

Permalink
Merge branch 'main' into fix-msvc-library-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Jun 5, 2024
2 parents b70f658 + cb9cd1d commit dcb26a6
Show file tree
Hide file tree
Showing 178 changed files with 4,889 additions and 2,609 deletions.
69 changes: 37 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,26 @@ jobs:
./ci/do_ci.sh cmake.test
cmake_gcc_maintainer_sync_test:
name: CMake gcc 13 (maintainer mode, sync)
runs-on: ubuntu-latest
name: CMake gcc 14 (maintainer mode, sync)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-13
CXX: /usr/bin/g++-13
CC: /usr/bin/gcc-14
CXX: /usr/bin/g++-14
PROTOBUF_VERSION: 21.12
run: |
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake gcc (maintainer mode, sync)
env:
CC: /usr/bin/gcc-13
CXX: /usr/bin/g++-13
CC: /usr/bin/gcc-14
CXX: /usr/bin/g++-14
run: |
./ci/do_ci.sh cmake.maintainer.sync.test
- name: generate test cert
Expand All @@ -61,25 +62,26 @@ jobs:
(cd ./functional/otlp; ./run_test.sh)
cmake_gcc_maintainer_async_test:
name: CMake gcc 13 (maintainer mode, async)
runs-on: ubuntu-latest
name: CMake gcc 14 (maintainer mode, async)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-13
CXX: /usr/bin/g++-13
CC: /usr/bin/gcc-14
CXX: /usr/bin/g++-14
PROTOBUF_VERSION: 21.12
run: |
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake gcc (maintainer mode, async)
env:
CC: /usr/bin/gcc-13
CXX: /usr/bin/g++-13
CC: /usr/bin/gcc-14
CXX: /usr/bin/g++-14
run: |
./ci/do_ci.sh cmake.maintainer.async.test
- name: generate test cert
Expand All @@ -93,25 +95,26 @@ jobs:
(cd ./functional/otlp; ./run_test.sh)
cmake_clang_maintainer_sync_test:
name: CMake clang 15 (maintainer mode, sync)
runs-on: ubuntu-latest
name: CMake clang 18 (maintainer mode, sync)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
PROTOBUF_VERSION: 21.12
run: |
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, sync)
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
run: |
./ci/do_ci.sh cmake.maintainer.sync.test
- name: generate test cert
Expand All @@ -125,25 +128,26 @@ jobs:
(cd ./functional/otlp; ./run_test.sh)
cmake_clang_maintainer_async_test:
name: CMake clang 15 (maintainer mode, async)
runs-on: ubuntu-latest
name: CMake clang 18 (maintainer mode, async)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
PROTOBUF_VERSION: 21.12
run: |
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, async)
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
run: |
./ci/do_ci.sh cmake.maintainer.async.test
- name: generate test cert
Expand All @@ -157,25 +161,26 @@ jobs:
(cd ./functional/otlp; ./run_test.sh)
cmake_clang_maintainer_abiv2_test:
name: CMake clang 15 (maintainer mode, abiv2)
runs-on: ubuntu-latest
name: CMake clang 18 (maintainer mode, abiv2)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
PROTOBUF_VERSION: 21.12
run: |
sudo apt remove needrestart #refer: https://github.com/actions/runner-images/issues/9937
sudo -E ./ci/setup_googletest.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, abiv2)
env:
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
run: |
./ci/do_ci.sh cmake.maintainer.abiv2.test
- name: generate test cert
Expand Down Expand Up @@ -726,11 +731,11 @@ jobs:

format:
name: Format
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: setup
run: sudo ./ci/install_format_tools.sh
run: sudo apt remove needrestart && sudo ./ci/install_format_tools.sh #refer: https://github.com/actions/runner-images/issues/9937
- name: run tests
run: ./ci/do_ci.sh format

Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

name: include-what-you-use

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
iwyu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: setup dependencies
run: |
sudo apt update -y
sudo apt install -y --no-install-recommends --no-install-suggests \
build-essential \
iwyu \
cmake \
ninja-build \
libssl-dev \
libcurl4-openssl-dev \
libprotobuf-dev \
protobuf-compiler \
libgmock-dev \
libgtest-dev \
libbenchmark-dev
- name: Prepare CMake
run: |
TOPDIR=`pwd`
mkdir build && cd build
CC="clang" CXX="clang++" cmake \
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \
-DBUILD_TESTING=OFF \
-DBUILD_W3CTRACECONTEXT_TEST=OFF \
..
- name: iwyu_tool
run: |
cd build
make -k 2>&1 | tee -a iwyu.log
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Logs (include-what-you-use)
path: ./build/*.log

- name: count warnings
run: |
cd build
COUNT=`grep -c "Warning:" iwyu.log`
echo "include-what-you-use reported ${COUNT} warning(s)"
13 changes: 13 additions & 0 deletions .iwyu.imp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# include-what-you-use mapping file

[
# Work around for C++ STL
{ "include": ["<bits/chrono.h>", "private", "<chrono>", "public"] },

# Local opentelemetry-cpp

]

57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,63 @@ Increment the:
* [SDK] Update ExemplarFilter and ExemplarReservoir for spec
[#2372](https://github.com/open-telemetry/opentelemetry-cpp/pull/2372)

* [CI] Upgrade to clang-format 18
[#2684](https://github.com/open-telemetry/opentelemetry-cpp/pull/2684)

* [API/SDK] Provider cleanup
[#2664](https://github.com/open-telemetry/opentelemetry-cpp/pull/2664)

Important changes:

* [API/SDK] Provider cleanup
[#2664](https://github.com/open-telemetry/opentelemetry-cpp/pull/2664)
* Before this fix:
* The API class `opentelemetry::trace::Tracer` exposed methods such
as `ForceFlush()`, `ForceFlushWithMicroseconds()`, `Close()`
and `CloseWithMicroseconds()`.
* These methods are meant to be used when configuring the SDK,
and should not be part of the API. Exposing them was an oversight.
* Two of these methods are virtual, and therefore part of the ABI.
* After this fix:
* In `OPENTELEMETRY_ABI_VERSION_NO 1`, nothing is changed,
because removing this code would break the ABI.
* In `OPENTELEMETRY_ABI_VERSION_NO 2`, these methods are moved
from the API to the SDK. This is a breaking change for ABI version 2,
which is still experimental.
* In all cases, instrumenting an application should not
invoke flush or close on a tracer, do not use these methods.

Breaking changes:

* [API/SDK] Provider cleanup
[#2664](https://github.com/open-telemetry/opentelemetry-cpp/pull/2664)
* Before this fix:
* SDK factory methods such as:
* opentelemetry::sdk::trace::TracerProviderFactory::Create()
* opentelemetry::sdk::metrics::MeterProviderFactory::Create()
* opentelemetry::sdk::logs::LoggerProviderFactory::Create()
* opentelemetry::sdk::logs::EventLoggerProviderFactory::Create()
returned an API object (opentelemetry::trace::TracerProvider)
to the caller.
* After this fix, these methods return an SDK level object
(opentelemetry::sdk::trace::TracerProvider) to the caller.
* Returning an SDK object is necessary for the application to
cleanup and invoke SDK level methods, such as ForceFlush(),
on a provider.
* The application code that configures the SDK, by calling
the various provider factories, may need adjustment.
* All the examples have been updated, and in particular no
longer perform static_cast do convert an API object to an SDK object.
Please refer to examples for guidance on how to adjust.
* If adjusting application code is impractical,
an alternate and temporary solution is to build with option
WITH_DEPRECATED_SDK_FACTORY=ON in CMake.
* Option WITH_DEPRECATED_SDK_FACTORY=ON will allow to build code
without application changes, posponing changes for later.
* WITH_DEPRECATED_SDK_FACTORY=ON is temporary, only to provide
an easier migration path. Expect this flag to be removed,
as early as by the next release.

Notes on experimental features:

* [#2372](https://github.com/open-telemetry/opentelemetry-cpp/issues/2372)
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ message(STATUS "OPENTELEMETRY_VERSION=${OPENTELEMETRY_VERSION}")

option(WITH_NO_DEPRECATED_CODE "Do not include deprecated code" OFF)

# This option is temporary, and will be removed. Set
# WITH_DEPRECATED_SDK_FACTORY=OFF to migrate to the new SDK code.
option(WITH_DEPRECATED_SDK_FACTORY "Use deprecated SDK provider factory" ON)

if(WITH_DEPRECATED_SDK_FACTORY)
message(WARNING "WITH_DEPRECATED_SDK_FACTORY=ON is temporary and deprecated")
endif()

set(WITH_STL
"OFF"
CACHE STRING "Which version of the Standard Library for C++ to use")
Expand Down
Loading

0 comments on commit dcb26a6

Please sign in to comment.