Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 24 additions & 7 deletions deps/opentelemetry-cpp/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ build --copt -DGRPC_BAZEL_BUILD
build:windows --dynamic_mode=off

# Set minimum supported C++ version
build:macos --host_cxxopt=-std=c++14 --cxxopt=-std=c++14
build:linux --host_cxxopt=-std=c++14 --cxxopt=-std=c++14
build:windows --host_cxxopt=/std:c++14 --cxxopt=/std:c++14
build:macos --host_cxxopt=-std=c++17 --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17 --cxxopt=-std=c++17
build:windows --host_cxxopt=/std:c++17 --cxxopt=/std:c++17

# --config=asan : Address Sanitizer.
common:asan --copt -DADDRESS_SANITIZER
common:asan --copt -fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,null,return,returns-nonnull-attribute,shift-exponent,signed-integer-overflow,unreachable,vla-bound
common:asan --copt -fsanitize=address
common:asan --copt -fsanitize-address-use-after-scope
common:asan --copt -fno-sanitize-recover=all
common:asan --linkopt -fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,null,return,returns-nonnull-attribute,shift-exponent,signed-integer-overflow,unreachable,vla-bound
common:asan --copt -fno-omit-frame-pointer
common:asan --linkopt -fsanitize=address
common:asan --linkopt -fsanitize-address-use-after-scope
common:asan --linkopt -fno-sanitize-recover=all
common:asan --cc_output_directory_tag=asan
common:asan --test_env=ASAN_OPTIONS=halt_on_error=1:print_stacktrace=1:detect_stack_use_after_return=1

# --config=tsan : Thread Sanitizer.
common:tsan --copt -fsanitize=thread
Expand All @@ -39,3 +39,20 @@ common:tsan --cc_output_directory_tag=tsan
# This is needed to address false positive problem with abseil.The same setting as gRPC
# https://github.com/google/sanitizers/issues/953
common:tsan --test_env=TSAN_OPTIONS=report_atomic_races=0

# --config=ubsan : Undefined Behavior Sanitizer
# Restrict UBSan compile instrumentation to workspace labels only.
#
# Bazel syntax: --per_file_copt=<label_regex>@<compiler_flag>
# ^//.* matches workspace labels (for example: //sdk/..., //api/...)
# @repo//... are external repositories and intentionally excluded
#
# This avoids sanitizer instrumentation issues in third-party dependencies,
# while still linking UBSan runtime into opentelemetry-cpp test binaries.
common:ubsan --per_file_copt=^//.*@-fsanitize=undefined
common:ubsan --per_file_copt=^//.*@-fno-sanitize-recover=undefined
common:ubsan --per_file_copt=^//.*@-fno-sanitize=vptr
common:ubsan --linkopt -fsanitize=undefined
common:ubsan --linkopt -fno-sanitize=vptr
common:ubsan --cc_output_directory_tag=ubsan
common:ubsan --test_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
2 changes: 1 addition & 1 deletion deps/opentelemetry-cpp/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.1
8.5.0
58 changes: 58 additions & 0 deletions deps/opentelemetry-cpp/.bcr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# BCR Publishing Configuration

This directory contains the template files required for publishing opentelemetry-cpp to the [Bazel Central Registry (BCR)](https://github.com/bazelbuild/bazel-central-registry).

## Files

### metadata.template.json
Contains the module metadata including homepage, maintainers, and repository information. This is used to create/update the BCR metadata for the module.

### source.template.json
Defines the source archive location and format. Placeholders like `{OWNER}`, `{REPO}`, `{TAG}`, and `{VERSION}` are automatically replaced during publishing.

### presubmit.yml
Defines the BCR presubmit tests that run when a new version is published. Currently configured to test on:
- Platforms: debian10, macos, ubuntu2004, windows
- Bazel versions: 7.x, 8.x, 9.*

## Publishing Process

The publish-to-bcr workflow (`.github/workflows/publish-to-bcr.yml`) automates publishing to BCR.

### Prerequisites

**Create a Personal Access Token (PAT)**:
- Create a Classic PAT with `workflow` and `repo` permissions
- Add it as a secret named `BCR_PUBLISH_TOKEN` in repository settings

### How to Publish

The workflow can be triggered in two ways:

1. **Automatically**: When a new GitHub release is published
2. **Manually**: Via workflow dispatch in GitHub Actions UI
- Go to Actions → Publish to BCR → Run workflow
- Enter the tag name (e.g., `v1.24.0`)

### What Happens

When triggered, the workflow:
1. Generates a BCR entry using these templates
2. Pushes the entry to your BCR fork
3. Opens a pull request against the upstream BCR

### Using a Fork Registry

For development and testing, you can use a fork of the Bazel Central Registry:

1. Fork https://github.com/bazelbuild/bazel-central-registry
2. Configure your fork URL in the workflow (modify the `publish-to-bcr.yml` file)
3. Test changes in your fork before submitting to the official BCR

The configuration in this repository points to the **official** Bazel Central Registry at https://github.com/bazelbuild/bazel-central-registry. However, using a fork registry is recommended for testing and development to avoid polluting the official registry during experimentation.

## References

- [Publish to BCR Action](https://github.com/bazel-contrib/publish-to-bcr)
- [Bazel Central Registry](https://github.com/bazelbuild/bazel-central-registry)
- [BCR Module: opentelemetry-cpp](https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/opentelemetry-cpp)
22 changes: 22 additions & 0 deletions deps/opentelemetry-cpp/.bcr/metadata.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"homepage": "https://github.com/open-telemetry/opentelemetry-cpp",
"maintainers": [
{
"name": "Keith Smiley",
"email": "keithbsmiley@gmail.com",
"github": "keith",
"github_user_id": 283886
},
{
"name": "Marc Alff",
"email": "marc.alff@oracle.com",
"github": "marcalff",
"github_user_id": 17238896
}
],
"repository": [
"github:open-telemetry/opentelemetry-cpp"
],
"versions": [],
"yanked_versions": {}
}
14 changes: 14 additions & 0 deletions deps/opentelemetry-cpp/.bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
matrix:
platform: ["debian10", "macos", "ubuntu2004", "windows"]
bazel: ["7.x", "8.x", "9.x"]
tasks:
verify_targets:
platform: ${{ platform }}
bazel: ${{ bazel }}
build_flags:
- '--cxxopt=-std=c++17'
- '--host_cxxopt=-std=c++17'
build_targets:
- '@opentelemetry-cpp//api'
Comment thread
coderabbitai[bot] marked this conversation as resolved.
5 changes: 5 additions & 0 deletions deps/opentelemetry-cpp/.bcr/source.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"integrity": "",
"strip_prefix": "opentelemetry-cpp-{VERSION}",
"url": "https://github.com/{OWNER}/{REPO}/archive/refs/tags/{TAG}.tar.gz"
}
9 changes: 4 additions & 5 deletions deps/opentelemetry-cpp/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ Checks: >
-*,
performance-*,
portability-*,
-portability-template-virtual-member-function,
-portability-avoid-pragma-once,
abseil-*,
-abseil-string-find-str-contains,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-inc-dec-in-conditions,
-bugprone-narrowing-conversions,
-bugprone-unchecked-optional-access,
-bugprone-unhandled-exception-at-new,
-bugprone-unused-local-non-trivial-variable,
google-*,
-google-build-using-namespace,
-google-default-arguments,
Expand All @@ -28,15 +28,14 @@ Checks: >
-misc-const-correctness,
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-unused-alias-decls,
-misc-use-anonymous-namespace,
-misc-multiple-inheritance,
cppcoreguidelines-*,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-pro-*
-cppcoreguidelines-pro-*
6 changes: 6 additions & 0 deletions deps/opentelemetry-cpp/.clomonitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# see https://github.com/cncf/clomonitor/blob/main/docs/checks.md#exemptions
exemptions:
- check: artifacthub_badge
reason: "Artifact Hub doesn't support c++ packages"
34 changes: 23 additions & 11 deletions deps/opentelemetry-cpp/.devcontainer/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,38 @@ ARG USER_GID=1000
ARG INSTALL_PACKAGES=

ARG CXX_STANDARD=17
ARG THIRD_PARTY_BUILD_TYPE=Release

ENV CXX_STANDARD=${CXX_STANDARD}
ENV THIRD_PARTY_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE}

COPY ci /opt/ci

RUN apt update && apt install -y wget \
RUN apt update && apt install -y wget gnupg lsb-release software-properties-common && \
wget -qO- https://apt.llvm.org/llvm.sh | bash -s -- 22 && \
apt install -y \
ninja-build \
llvm-dev \
libclang-dev \
clang-tidy \
llvm-22-dev \
libclang-22-dev \
clang-22 \
clang-tidy-22 \
shellcheck \
sudo \
cmake

RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 200 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 200 && \
update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-22 200 && \
update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-22 200 && \
update-alternatives --config clang && \
update-alternatives --config clang++ && \
update-alternatives --config clang-tidy && \
update-alternatives --config llvm-config

RUN cd /opt/ci && bash setup_ci_environment.sh
RUN cd /opt/ci && bash install_iwyu.sh

ADD https://github.com/bazelbuild/bazelisk/releases/download/v1.22.1/bazelisk-linux-amd64 /usr/local/bin

RUN git config --global core.autocrlf input \
&& chmod +x /usr/local/bin/bazelisk-linux-amd64
RUN cd /opt/ci && bash install_bazelisk.sh
RUN git config --global core.autocrlf input

ENV INSTALL_PACKAGES=${INSTALL_PACKAGES}
ENV USER_NAME=devuser
Expand All @@ -37,15 +48,16 @@ ENV USER_GID=${USER_GID}
ENV IS_CONTAINER_BUILD=true

COPY install /opt/install
COPY third_party_release /opt/third_party_release
COPY ./.devcontainer/customize_container.sh /tmp/opentelemetry_cpp/devcontainer/customize_container.sh
RUN /tmp/opentelemetry_cpp/devcontainer/customize_container.sh
RUN apt install -y npm && npm install -g markdownlint-cli@0.44.0

USER devuser

WORKDIR /workspaces/opentelemetry-cpp
RUN cd /opt && bash ci/install_thirdparty.sh --install-dir /home/devuser/third-party/install-stable --tags-file install/cmake/third_party_stable
ENV CMAKE_PREFIX_PATH=/home/devuser/third-party/install-stable
RUN cd /opt && bash ci/install_thirdparty.sh --install-dir /home/devuser/third-party/install --build-type ${THIRD_PARTY_BUILD_TYPE} --tags-file third_party_release
ENV CMAKE_PREFIX_PATH=/home/devuser/third-party/install

ENTRYPOINT []

Expand Down
7 changes: 7 additions & 0 deletions deps/opentelemetry-cpp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,10 @@ functional/cert/server_cert_b.csr
functional/cert/server_cert_b.pem
functional/cert/server_cert_b-key.pem
functional/cert/unreadable.pem

# CodeQL build artifacts
_codeql_build_dir/
_codeql_detected_source_root

# VSCode
.vscode/
12 changes: 12 additions & 0 deletions deps/opentelemetry-cpp/.iwyu.imp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
{ "include": ["<bits/types/struct_tm.h>", "private", "<time.h>", "public"] },
{ "include": ["<bits/types/struct_FILE.h>", "private", "<stdio.h>", "public"] },

# Work around for ryml
{ "include": ["<c4/std/string.hpp>", "private", "<ryml_std.hpp>", "public"] },

{ "include": ["<c4/yml/common.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/yml/node.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/yml/parse.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/yml/parse_engine.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/yml/tree.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/yml/event_handler_tree.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/substr.hpp>", "private", "<ryml.hpp>", "public"] },
{ "include": ["<c4/substr_fwd.hpp>", "private", "<ryml.hpp>", "public"] },

# Local opentelemetry-cpp style

# We prefer to include <gtest/gtest.h> for simplicity
Expand Down
4 changes: 4 additions & 0 deletions deps/opentelemetry-cpp/.markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
{
"code_blocks": false,
"tables": false
},
"MD059":
{
"prohibited_texts": []
}
}
22 changes: 22 additions & 0 deletions deps/opentelemetry-cpp/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-24.04
tools:
python: "3.12"
apt_packages:
- doxygen
- graphviz

sphinx:
configuration: docs/public/conf.py

python:
install:
- requirements: docs/public/requirements.txt
33 changes: 0 additions & 33 deletions deps/opentelemetry-cpp/.vscode/launch.json

This file was deleted.

Loading
Loading