Skip to content

Commit

Permalink
Fix OTELCPP_MAINTAINER_MODE (#1844)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored Dec 9, 2022
1 parent 722ad4e commit 75f3900
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 15 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,36 @@ jobs:
CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/do_ci.sh cmake.test
cmake_gcc_maintainer_test:
name: CMake gcc (maintainer mode)
name: CMake gcc 12 (maintainer mode)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_cmake.sh
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_ci_environment.sh
sudo CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 GOOGLETEST_VERSION=1.12.1 ./ci/setup_cmake.sh
sudo CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 ./ci/setup_ci_environment.sh
- name: run cmake gcc (maintainer mode)
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_thrift.sh
CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/do_ci.sh cmake.maintainer.test
sudo CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 ./ci/setup_thrift.sh
CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 ./ci/do_ci.sh cmake.maintainer.test
cmake_clang_maintainer_test:
name: CMake clang (maintainer mode)
name: CMake clang 14 (maintainer mode)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
run: |
sudo CC=/usr/bin/clang-12 CXX=/usr/bin/clang++-12 ./ci/setup_cmake.sh
sudo CC=/usr/bin/clang-12 CXX=/usr/bin/clang++-12 ./ci/setup_ci_environment.sh
sudo CC=/usr/bin/clang-14 CXX=/usr/bin/clang++-14 GOOGLETEST_VERSION=1.12.1 ./ci/setup_cmake.sh
sudo CC=/usr/bin/clang-14 CXX=/usr/bin/clang++-14 ./ci/setup_ci_environment.sh
- name: run cmake clang (maintainer mode)
run: |
sudo CC=/usr/bin/clang-12 CXX=/usr/bin/clang++-12 ./ci/setup_thrift.sh
CC=/usr/bin/clang-12 CXX=/usr/bin/clang++-12 ./ci/do_ci.sh cmake.maintainer.test
sudo CC=/usr/bin/clang-14 CXX=/usr/bin/clang++-14 ./ci/setup_thrift.sh
CC=/usr/bin/clang-14 CXX=/usr/bin/clang++-14 ./ci/do_ci.sh cmake.maintainer.test
cmake_msvc_maintainer_test:
name: CMake msvc (maintainer mode)
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Increment the:

## [Unreleased]

* [BUILD] Fix OTELCPP_MAINTAINER_MODE [#1844](https://github.com/open-telemetry/opentelemetry-cpp/pull/1844)

## [1.8.1] 2022-12-04

* [ETW Exporter] Tail based sampling support [#1780](https://github.com/open-telemetry/opentelemetry-cpp/pull/1780)
Expand Down
4 changes: 4 additions & 0 deletions api/include/opentelemetry/nostd/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class span

span(const span &) noexcept = default;

span &operator=(const span &) noexcept = default;

bool empty() const noexcept { return Extent == 0; }

T *data() const noexcept { return data_; }
Expand Down Expand Up @@ -223,6 +225,8 @@ class span<T, dynamic_extent>

span(const span &) noexcept = default;

span &operator=(const span &) noexcept = default;

bool empty() const noexcept { return extent_ == 0; }

T *data() const noexcept { return data_; }
Expand Down
1 change: 1 addition & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ elif [[ "$1" == "cmake.maintainer.test" ]]; then
-DWITH_PROMETHEUS=ON \
-DWITH_ZIPKIN=ON \
-DWITH_JAEGER=ON \
-DBUILD_W3CTRACECONTEXT_TEST=ON \
-DWITH_ELASTICSEARCH=ON \
-DWITH_LOGS_PREVIEW=ON \
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
Expand Down
9 changes: 7 additions & 2 deletions ci/setup_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update

export CMAKE_VERSION=3.15.2
export GOOGLETEST_VERSION=1.10.0
if [ "x$CMAKE_VERSION" = "x" ]; then
export CMAKE_VERSION=3.15.2
fi

if [ "x$GOOGLETEST_VERSION" = "x" ]; then
export GOOGLETEST_VERSION=1.10.0
fi

cmake_install() {
tmp_dir=$(mktemp -d)
Expand Down
10 changes: 7 additions & 3 deletions ext/test/w3c_tracecontext_test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ struct Uri
class NoopEventHandler : public http_client::EventHandler
{
public:
void OnEvent(http_client::SessionState state, nostd::string_view reason) noexcept override {}
void OnEvent(http_client::SessionState /* state */,
nostd::string_view /* reason */) noexcept override
{}

void OnConnecting(const http_client::SSLCertificate &) noexcept override {}

void OnResponse(http_client::Response &response) noexcept override {}
void OnResponse(http_client::Response & /* response */) noexcept override {}
};
} // namespace

Expand Down Expand Up @@ -165,7 +167,9 @@ int main(int argc, char *argv[])

for (auto &part : body)
{
const TextMapCarrierTest carrier((std::map<std::string, std::string> &)req.headers);
auto headers_2 = const_cast<std::map<std::string, std::string> &>(req.headers);

const TextMapCarrierTest carrier(headers_2);
auto current_ctx = context::RuntimeContext::GetCurrent();
auto ctx = propagator_format.Extract(carrier, current_ctx);
auto token = context::RuntimeContext::Attach(ctx);
Expand Down

0 comments on commit 75f3900

Please sign in to comment.