-
Notifications
You must be signed in to change notification settings - Fork 95
Bazel problem with opencensus-proto as transitive dependency #200
Comments
I'm less familiar with transitive proto dependencies in Bazel. (We usually recommend Go users to depend on the gen-go files directly.) /cc @g-easy any advice here? |
Where does Like you said, WORKSPACE declares |
I haven't got |
I added With the manual addition, this succeeds:
Now the question is how to properly fix the dep. (sorry, I know very little about golang) |
Ping @jayconrod, any ideas? I don't understand the interplay between Gazelle and go-gen. It looks like metrics/ needs a dependency on resources/ but the autogenerated BUILD file is missing that dep. How do we add it? |
If that's the case @g-easy, I found this yesterday, but didn't know how to use it. It's looks like a pretty recent POC. I didn't know the EDIT: I see that bazel-contrib/bazel-gazelle#518 was created for this POC repo and closed by @jayconrod with comments as well. EDIT 2: Should have tested the outer build though, still the same error. Changes are pushed. EDIT 3: Combine everything together.. the rename of the |
I read bazel-contrib/bazel-gazelle#498 (comment) but I don't understand what the way forward is. It looks like a lot of people are running into problems with opencensus-proto + golang + bazel. Should opencensus-proto be doing something different? "Manual" build rules instead of gen-go? Let's wait a day and see what @jayconrod says. |
This sounds like it might be the same issue reported in bazel-contrib/bazel-gazelle#498? bazel-contrib/bazel-gazelle#518 was a dup of that.
The crux of the issue is that this repository already has some build files. Normally You also mentioned something about naming |
There are a lot of options here. I think the simplest thing to do to make
When Gazelle is run in other repositories, it will assume the existence of |
Any update on a long term fix from opencensus side of things? |
Managed to get it working but required me to make a |
I don't think anyone has the bandwidth to work on this. @bweston92 which approach did you take in your fix? |
I copied the
|
@bweston92 could you explain what that entails? |
cc @whizard |
My working copy attached. |
Related: bazel-contrib/bazel-gazelle#669 One of the options listed there worked for me. I added to WORKSPACE:
|
Thank you, @rutsky. I was able to adapt your I sure hope #217 or something like this can fix this once and for all. |
contour ingress controller also has this transitive dependency via envoy. I was able to compile with the following: go_repository(
name = "com_github_census_instrumentation_opencensus_proto",
importpath = "github.com/census-instrumentation/opencensus-proto",
sum = "h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=",
version = "v0.2.1",
build_extra_args = ["-exclude=src"], # keep
) |
Having a problem declaring opencensus-proto as a transitive dependency in https://github.com/briantopping/freeipa-operator/tree/bazel-transitive-issue (just a Bazel build around the “Create and deploy an app-operator” section at https://github.com/operator-framework/operator-sdk#quick-start). @songy23 thought the at what I have here should work, but it gives the following:
Changing the name of this
go_repository
element to match the previous error changes the error to:Note that the errors indeterminately flip between
trace
andmetrics
packages, but it's always the same semantics.This looks very similar to #105, although Bazel-Go rules and Gazelle have deprecated
git_repository
since those changes were made.What I expected
operator-sdk
presumably ties into metrics, but as a developer with no direct dependency onopencensus-proto
, it's surprising that it's so difficult (I'm five days into this error so far) to get it building under Bazel. I assume this has to do with the combination of it being both a transitive and depending on protobuf.The text was updated successfully, but these errors were encountered: