-
Notifications
You must be signed in to change notification settings - Fork 14
deps: update opentelemetry-cpp to 1.25.0 #422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: node-v24.x-nsolid-v6.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 7.1.1 | ||
| 8.5.0 |
| 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) |
| 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": "[email protected]", | ||
| "github": "keith", | ||
| "github_user_id": 283886 | ||
| }, | ||
| { | ||
| "name": "Marc Alff", | ||
| "email": "[email protected]", | ||
| "github": "marcalff", | ||
| "github_user_id": 17238896 | ||
| } | ||
| ], | ||
| "repository": [ | ||
| "github:open-telemetry/opentelemetry-cpp" | ||
| ], | ||
| "versions": [], | ||
| "yanked_versions": {} | ||
| } |
| 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' | ||
| 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" | ||
| } |
| 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" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,13 +15,18 @@ COPY ci /opt/ci | |||||||||||||||||
|
|
||||||||||||||||||
| RUN apt update && apt install -y wget \ | ||||||||||||||||||
| ninja-build \ | ||||||||||||||||||
| llvm-dev \ | ||||||||||||||||||
| libclang-dev \ | ||||||||||||||||||
| clang-tidy \ | ||||||||||||||||||
| llvm-20-dev \ | ||||||||||||||||||
| libclang-20-dev \ | ||||||||||||||||||
| clang-tidy-20 \ | ||||||||||||||||||
| shellcheck \ | ||||||||||||||||||
| sudo \ | ||||||||||||||||||
| cmake | ||||||||||||||||||
|
|
||||||||||||||||||
| RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-20 200 && \ | ||||||||||||||||||
| update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-20 200 && \ | ||||||||||||||||||
| update-alternatives --config clang-tidy && \ | ||||||||||||||||||
| update-alternatives --config llvm-config | ||||||||||||||||||
|
Comment on lines
+25
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's confirm the file exists and examine the context around lines 25-28
find . -name "Dockerfile.dev" -type f | head -20Repository: nodesource/nsolid Length of output: 114 🌐 Web query:
💡 Result:
Docker/CI guidance: prefer 🏁 Script executed: # Read the Dockerfile to verify the current code and exact context
cat -n ./deps/opentelemetry-cpp/.devcontainer/Dockerfile.dev | sed -n '20,35p'Repository: nodesource/nsolid Length of output: 763 Replace interactive The Suggested fix RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-20 200 && \
update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-20 200 && \
- update-alternatives --config clang-tidy && \
- update-alternatives --config llvm-config
+ update-alternatives --set clang-tidy /usr/bin/clang-tidy-20 && \
+ update-alternatives --set llvm-config /usr/bin/llvm-config-20📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| RUN cd /opt/ci && bash setup_ci_environment.sh | ||||||||||||||||||
| RUN cd /opt/ci && bash install_iwyu.sh | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,5 +4,9 @@ | |
| { | ||
| "code_blocks": false, | ||
| "tables": false | ||
| }, | ||
| "MD059": | ||
| { | ||
| "prohibited_texts": [] | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: nodesource/nsolid
Length of output: 244
🏁 Script executed:
Repository: nodesource/nsolid
Length of output: 159
🏁 Script executed:
# Read the full presubmit.yml file cat -n ./deps/opentelemetry-cpp/.bcr/presubmit.ymlRepository: nodesource/nsolid
Length of output: 540
🏁 Script executed:
# Read the .bazelrc file cat -n ./deps/opentelemetry-cpp/.bazelrcRepository: nodesource/nsolid
Length of output: 2186
🌐 Web query:
BCR presubmit.yml bazelrc platform windows cxxopt flag💡 Result:
In Bazel Central Registry (BCR), you don’t put these flags in a
bazelrc; you put them in the module version’spresubmit.ymlunder a task’sbuild_flags/test_flags(and each task must declare abazel:version). [1]For C++ standard flags, BCR presubmits typically use:
--cxxopt=-std=c++17(or similar)--cxxopt=/std:c++17(note the/std:form)Example pattern from an actual BCR
presubmit.ymlthat splits Unix vs Windows and uses the correct Windowscxxoptform: [2]If you’re doing this in your own repo via
.bazelrc, enable platform-specific configs and then add per-platform sections, e.g.build:windows ...(this is how Bazel’s own.bazelrcand large projects structure platform-specific options): [3] [4]🌐 Web query:
Bazel presubmit windows platform specific config cxxopt💡 Result:
To make Windows-only C++ compiler options apply in a presubmit (CI) without breaking Linux/macOS, do it via named
.bazelrcconfigs, notselect()inside--cxxopt(that doesn’t work becauseselect()is a BUILD attribute mechanism, not a flag-language feature). (bazel.build)1) Put platform-specific
cxxoptin.bazelrc(Windows uses
/std:c++17vs GCC/Clang-std=c++17.) (stackoverflow.com)2) In presubmit, select the right config per job
bazel test //... --config=windowsbazel test //... --config=posix3) If you need platform-specific options inside BUILD rules, use
select()on platform constraintsPrefer
@platforms//os:windowsover@bazel_tools//src/conditions:windows. (reviews.llvm.org)This is the intended use of configurable attributes (
select()) in BUILD files. (bazel.build)Citations:
🌐 Web query:
BCR presubmit.yml conditional build_flags per platform matrix💡 Result:
In BCR
presubmit.yml,build_flags(andtest_flags) are per task, not per matrix entry—so you can’t directly say “only add this flag whenplatform == windows” inside a single task. The common pattern is to split into multiple tasks with differentplatform:selectors (optionally using YAML anchors to avoid duplication). (android.googlesource.com)Example (platform-conditional flags via separate tasks):
This is exactly how existing BCR-related presubmits handle “flags only on macOS (or only on X)”: duplicate the task with a narrower
platformand attach the platform-specificbuild_flags. (boringssl.googlesource.com)Citations:
Split
verify_targetstask to use platform-specific C++ flags.The
build_flagsapply--cxxopt=-std=c++17universally, but Windows MSVC requires/std:c++17(forward slash). The matrix includes a Windows platform, so this will fail on Windows CI.Create separate tasks: one for Unix-like platforms (debian10, macos, ubuntu2004) with
--cxxopt=-std=c++17, and one for Windows with--cxxopt=/std:c++17. This follows the standard BCR pattern for platform-conditional flags.🤖 Prompt for AI Agents