Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Failing to build stackdriver trace exporter because of "rules_python" from protobuf dependency #462

Open
TonyRoussel opened this issue Feb 17, 2022 · 1 comment

Comments

@TonyRoussel
Copy link

Hi,

I'm trying to build the stackdriver trace exporter, from a clean ubuntu 20.04 container, using the folllowing command

bazel build //opencensus/exporters/trace/stackdriver:stackdriver_exporter

But it fails with the following error:

ERROR: /gcp_trace_exporter_opencensus_cpp/opencensus-cpp/opencensus/common/internal/BUILD:62:11: error loading package '@com_google_protobuf//': Unable to find package for @rules_python//python:defs.bzl: The repository '@rules_python' could not be resolved: Repository '@rules_python' is not defined. and referenced by '//opencensus/common/internal:timestamp'
ERROR: Analysis of target '//opencensus/exporters/trace/stackdriver:stackdriver_exporter' failed; build aborted: 
INFO: Elapsed time: 0.110s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 2 targets configured)
    currently loading: @com_google_protobuf//

Apparently, protobuf dependency rely on "rules_python".

I went on protobuf repo and managed to build it correctly. Checking how they declare the "rules_python" dependency, it seems to have a kind of failover when this rule is not existing.

Being very new to bazel, I'm not sure 1) if I'm doing it wrong, 2) the protobuf dependency of opencensus should be declared differently to correctly import that rule, or 3) I should do an extra bazel command before building to have this "rules_python" ready in bazel cache ?

My end goal being able to build this exporter to link it from a codebase relying on cmake

Any input would be appreciated

@g-easy
Copy link
Contributor

g-easy commented Mar 30, 2022

I've added rules_python in #467. Although I'm not sure if it should be in bazel/deps.bzl instead of WORKSPACE now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants