Skip to content

Commit 6673570

Browse files
authored
[bazel] Drop WORKSPACE support (open-telemetry#3699)
Bazel 7.x (the current minimum supported version) supports using this repo with bzlmod. With bazel 9.x coming out next month, it doesn't support WORKSPACE anymore. It's getting quite hard to support both of these versions at once as many rules repos no longer test WORKSPACE support.
1 parent 6c8df48 commit 6673570

File tree

9 files changed

+8
-419
lines changed

9 files changed

+8
-419
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

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

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

WORKSPACE.bzlmod

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

bazel/extra_deps.bzl

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

bazel/repository.bzl

Lines changed: 0 additions & 177 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 //...

0 commit comments

Comments
 (0)