open-telemetry / open-telemetry/opentelemetry-cpp

no such package '@curl//' when installing through bazel

Open
#3,367 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale triage/accepted
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

Describe your environment Describe any aspect of your environment relevant to the problem, including your platform, build system, version numbers of installed dependencies, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main branch.

opentelemetry-cpp version: v1.16.1
MacOS: 15.3.2

I am installing opentelemetry-cpp as part of a project through bazel. I am seeing:

no such package '@curl//': The repository '@curl' could not be resolved: '@curl' is not a repository rule and 
referenced by '@io_opentelemetry_cpp//ext/src/http/client/curl:http_client_curl'

Steps to reproduce
Describe exactly how to reproduce the error. Include a code sample if applicable.

Following https://github.com/open-telemetry/opentelemetry-cpp/blob/main/INSTALL.md#incorporating-into-an-existing-bazel-project and added the following to my WORKSPACE:

http_archive(
    name = "io_opentelemetry_cpp",
    sha256 = "b8a78bb2a3a78133dbb08bcd04342f4b1e03cb4a19079b8416d408d905fffc37",
    strip_prefix = "opentelemetry-cpp-1.16.1",
    urls = [
        "https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.16.1.tar.gz",
    ],
)

# Load OpenTelemetry dependencies after the archive is downloaded
load("@io_opentelemetry_cpp//bazel:repository.bzl", "opentelemetry_cpp_deps")
opentelemetry_cpp_deps()

Component level bazel file:

envoy_cc_library(
...
    deps = [
        "@io_opentelemetry_cpp//api",
        "@io_opentelemetry_cpp//exporters/ostream:ostream_span_exporter",
        "@io_opentelemetry_cpp//exporters/otlp:otlp_http_exporter",

What is the expected behavior?
What did you expect to see?

What is the actual behavior?
What did you see instead?

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with INSTALL.md's existing Bazel integration instructions and bazel/repository.bzl, then reproduce the failure using the provided WORKSPACE configuration and component-level deps. Trace why the @curl repository is unresolved; done means the documented opentelemetry_cpp_deps setup resolves the curl dependency for the shown targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.