Skip to content

Commit ae11735

Browse files
committed
merged from upstream
2 parents fa97afc + 6673570 commit ae11735

File tree

6 files changed

+9
-208
lines changed

6 files changed

+9
-208
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -735,32 +735,6 @@ jobs:
735735
- name: run tests
736736
run: ./ci/do_ci.sh bazel.test
737737

738-
bazel_no_bzlmod_test:
739-
name: Bazel without bzlmod
740-
runs-on: ubuntu-latest
741-
steps:
742-
- name: Harden the runner (Audit all outbound calls)
743-
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
744-
with:
745-
egress-policy: audit
746-
747-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
748-
with:
749-
submodules: 'recursive'
750-
- name: Mount Bazel Cache
751-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
752-
env:
753-
cache-name: bazel_cache
754-
with:
755-
path: /home/runner/.cache/bazel
756-
key: bazel_test
757-
- name: setup
758-
run: |
759-
sudo ./ci/setup_ci_environment.sh
760-
sudo ./ci/install_bazelisk.sh
761-
- name: run tests
762-
run: ./ci/do_ci.sh bazel.no_bzlmod.test
763-
764738
bazel_test_async:
765739
name: Bazel with async export
766740
runs-on: ubuntu-latest

.github/workflows/cmake_install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ jobs:
238238
- name: Install Conan
239239
run: |
240240
python3 -m pip install pip==25.0.1
241-
pip install "conan==2.15.1"
241+
pip install "conan==2.21.0"
242242
conan profile detect --force
243243
- name: Install or build all dependencies with Conan
244244
run: |

INSTALL.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -336,38 +336,10 @@ Bazel](https://docs.bazel.build/versions/3.7.0/install.html) guide.
336336

337337
### Incorporating into an existing Bazel Project
338338

339-
- WORKSPACE file:
340-
341-
```console
342-
http_archive(
343-
name = "io_opentelemetry_cpp",
344-
sha256 = "<sha256>",
345-
strip_prefix = "opentelemetry-cpp-1.0.1",
346-
urls = [
347-
"https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.0.1.tar.gz"
348-
],
349-
)
350-
351-
# Load OpenTelemetry dependencies after load.
352-
load("@io_opentelemetry_cpp//bazel:repository.bzl", "opentelemetry_cpp_deps")
353-
354-
opentelemetry_cpp_deps()
355-
356-
# (required after v1.8.0) Load extra dependencies required for OpenTelemetry
357-
load("@io_opentelemetry_cpp//bazel:extra_deps.bzl", "opentelemetry_extra_deps")
358-
359-
opentelemetry_extra_deps()
360-
361-
# Load gRPC dependencies after load.
362-
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
363-
364-
grpc_deps()
365-
366-
# Load extra gRPC dependencies due to https://github.com/grpc/grpc/issues/20511
367-
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
368-
369-
grpc_extra_deps()
339+
- MODULE.bazel file:
370340

341+
```bzl
342+
bazel_dep(name = "opentelemetry-cpp", version = "<VERSION>", repo_name = "io_opentelemetry_cpp")
371343
```
372344

373345
- Component level BUILD file:

WORKSPACE.bzlmod

Lines changed: 0 additions & 4 deletions
This file was deleted.

ci/do_ci.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -545,13 +545,6 @@ EOF
545545
make load_plugin_example
546546
examples/plugin/load/load_plugin_example ${PLUGIN_DIR}/libexample_plugin.so /dev/null
547547
exit 0
548-
elif [[ "$1" == "bazel.no_bzlmod.test" ]]; then
549-
# Rapidyaml 0.9.0 as is does not support bazel,
550-
# modules in bazel central repository required
551-
# to build configuration.
552-
bazel $BAZEL_STARTUP_OPTIONS build --enable_bzlmod=false $BAZEL_OPTIONS -- //... -//examples/configuration/... -//sdk/src/configuration/... -//sdk/test/configuration/...
553-
bazel $BAZEL_STARTUP_OPTIONS test --enable_bzlmod=false $BAZEL_TEST_OPTIONS -- //... -//examples/configuration/... -//sdk/src/configuration/... -//sdk/test/configuration/...
554-
exit 0
555548
elif [[ "$1" == "bazel.test" ]]; then
556549
bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS $BAZEL_WITH_PREVIEW //...
557550
bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS $BAZEL_WITH_PREVIEW //...

docs/maintaining-dependencies.md

Lines changed: 5 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ index 0bbf67f3..7362473f 100644
8686
vcpkg=2024.02.14
8787
```
8888

89-
#### file bazel/repository.bzl
90-
91-
Please follow the guide [Upgrade a bazel dependency](#upgrade-a-bazel-dependency)
92-
for more details.
93-
9489
#### file cmake/opentelemetry-proto.cmake
9590

9691
Update the tag in the CMake logic:
@@ -141,16 +136,6 @@ In this case, it is better to:
141136
When the C++ code requires a newer minimum version of opentelemetry-proto,
142137
make sure to document this, including in the release notes.
143138

144-
### Known issues (opentelemetry-proto)
145-
146-
For bazel, two different methods to build exists.
147-
148-
First, the code can build using file `bazel/repository.bzl`.
149-
This option does not depend on bazel central.
150-
151-
Secondly, there is also a build using modules, with file `MODULE.bazel`.
152-
This option does depend on bazel central, and CI depends on it.
153-
154139
## semantic-conventions and weaver
155140

156141
### Comments (semantic-conventions)
@@ -378,50 +363,13 @@ index abc1234..def5678 100644
378363
+prometheus-cpp=v1.2.4
379364
```
380365

381-
In file bazel/repository.bzl locate the entry for prometheus-cpp:
382-
383-
```shell
384-
# C++ Prometheus Client library.
385-
maybe(
386-
http_archive,
387-
name = "com_github_jupp0r_prometheus_cpp",
388-
sha256 = "ac6e958405a29fbbea9db70b00fa3c420e16ad32e1baf941ab233ba031dd72ee",
389-
strip_prefix = "prometheus-cpp-1.2.3",
390-
urls = [
391-
"https://github.com/jupp0r/prometheus-cpp/archive/refs/tags/v1.2.3.tar.gz",
392-
],
393-
)
394-
```
395-
396-
Update the URL to the new tag:
397-
398-
```shell
399-
urls = [
400-
"https://github.com/jupp0r/prometheus-cpp/archive/v1.2.4.tar.gz",
401-
],
402-
```
403-
404-
Update strip_prefix to match the new version:
405-
406-
```shell
407-
strip_prefix = "prometheus-cpp-1.2.4",
408-
```
409-
410-
Download the new URL:
411-
412-
```shell
413-
wget https://github.com/jupp0r/prometheus-cpp/archive/v1.2.4.tar.gz
414-
```
415-
416-
Calculate the checksum:
366+
In file `MODULE.bazel` locate the entry for prometheus-cpp and update it
367+
to the new version:
417368

418-
```shell
419-
sha256sum v1.2.4.tar.gz
420-
abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234 v1.2.4.tar.gz
369+
```bzl
370+
bazel_dep(name = "prometheus-cpp", version = "1.3.0", repo_name = "com_github_jupp0r_prometheus_cpp")
421371
```
422372

423-
Update the `sha256`.
424-
425373
## Upgrade a git submodule
426374

427375
All the git submodule are under the folder `third_party`.
@@ -502,89 +450,7 @@ git add third_party/opentelemetry-proto
502450
503451
## Upgrade a bazel dependency
504452
505-
Same as git submodule, we will continue use `opentelemetry-proto` as example.
506-
507-
All the bazel dependencies are defined in [repository.bzl](https://github.com/open-telemetry/opentelemetry-cpp/blob/main/bazel/repository.bzl)
508-
and [MODULE.bazel](https://github.com/open-telemetry/opentelemetry-cpp/blob/main/MODULE.bazel).
509-
510-
### Update the dependency in repository.bzl
511-
512-
Locate the entry for opentelemetry-proto:
513-
514-
```text
515-
# OTLP Protocol definition
516-
maybe(
517-
http_archive,
518-
name = "com_github_opentelemetry_proto",
519-
build_file = "@io_opentelemetry_cpp//bazel:opentelemetry_proto.BUILD",
520-
sha256 = "bed250ceec8e4a83aa5604d7d5595a61945059dc662edd058a9da082283f7a00",
521-
strip_prefix = "opentelemetry-proto-1.3.1",
522-
urls = [
523-
"https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.1.tar.gz",
524-
],
525-
)
526-
```
527-
528-
Update the URL to the new tag:
529-
530-
```text
531-
urls = [
532-
"https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.2.tar.gz",
533-
],
534-
```
535-
536-
Update strip_prefix to the new tag:
537-
538-
```text
539-
strip_prefix = "opentelemetry-proto-1.3.2",
540-
```
541-
542-
Download the new URL:
543-
544-
```shell
545-
wget https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.2.tar.gz
546-
```
547-
548-
Run a checksum on the new file:
549-
550-
```shell
551-
sha256sum v1.3.2.tar.gz
552-
```
553-
554-
```shell
555-
c069c0d96137cf005d34411fa67dd3b6f1f8c64af1e7fb2fe0089a41c425acd7 v1.3.2.tar.gz
556-
```
557-
558-
Update the checksum in file bazel/repository.bzl:
559-
560-
```text
561-
sha256 = "c069c0d96137cf005d34411fa67dd3b6f1f8c64af1e7fb2fe0089a41c425acd7",
562-
```
563-
564-
Typical change:
565-
566-
```shell
567-
[malff@malff-desktop opentelemetry-cpp]$ git diff bazel/repository.bzl
568-
diff --git a/bazel/repository.bzl b/bazel/repository.bzl
569-
index bac1e45b..508b95a3 100644
570-
--- a/bazel/repository.bzl
571-
+++ b/bazel/repository.bzl
572-
@@ -88,10 +88,10 @@ def opentelemetry_cpp_deps():
573-
http_archive,
574-
name = "com_github_opentelemetry_proto",
575-
build_file = "@io_opentelemetry_cpp//bazel:opentelemetry_proto.BUILD",
576-
- sha256 = "bed250ceec8e4a83aa5604d7d5595a61945059dc662edd058a9da082283f7a00",
577-
- strip_prefix = "opentelemetry-proto-1.3.1",
578-
+ sha256 = "c069c0d96137cf005d34411fa67dd3b6f1f8c64af1e7fb2fe0089a41c425acd7",
579-
+ strip_prefix = "opentelemetry-proto-1.3.2",
580-
urls = [
581-
- "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.1.tar.gz",
582-
+ "https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.2.tar.gz",
583-
],
584-
)
585-
```
586-
587-
#### Update MODULE.bazel
453+
### Update MODULE.bazel
588454
589455
> Remember, the link is different in your case.
590456
Replace `opentelemetry-proto` to correct target.

0 commit comments

Comments
 (0)