-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Existing protoc output causes issues with multiple rules #219
Comments
In general, I would not recommend vendoring projects that already have Bazel build files. Build files have absolute paths within the repository, so when the contents of a repository are vendored, they don't make sense anymore. If the project is buildable with If you can, I'd recommend accessing proto-related dependencies through external repository rules ( You may find |
Thanks for getting back to me, I managed to offload the vendor to use the
Any ideas? |
This error comes from a conflict between two libraries that are linked into the build: one vendored, one not. This is a problem especially with gRPC and proto dependencies because Gazelle currently tries to avoid conflicts by hard coding dependency resolution for the Well Known Type libraries (e.g., For now, try a similar workaround to this comment: in your vendor directory, replace
Other implicit dependencies are:
|
Sorry I don't fully understand the issue it self or the solution. I added a
Re-ran gazelle and same error gets outputted. Would this be fixed by just not vendoring but using go_repositories instead? :/ |
Where exactly is the package
That is the most likely thing to work, though vendor directories in external repositories may still interfere. That would be true whether you're using go build or Bazel though. |
The fixes for bazel-contrib/rules_go#1548 have landed at tip of master and will be in the 0.13.0 release in a couple days. We now basically support two modes of use:
Please re-open if you're still running into issues after this. |
I have run into some trouble, I don't know if it is my fault or the packages fault any help would be appreciated. So the steps I had taken is:
(1)
(2)
(3)
(4)
|
From the warnings in (2) and (3), it sounds like the build files in src/vendor were stale. The warnings in (3) come up because there are multiple libraries with the same Normally stale build files are fine, because Gazelle can fix most things, but the old The error in (4) is related. When Gazelle fails to resolve an import because of a conflict, it won't write out a label in |
Stale how? I only just switched to using |
By stale, I meant that the build files in vendor still have rules that were generated before you added But wait: you said you're adding |
@jayconrod Just curious to know the solution for the issue (4) and how can we identify the conflict? I am also facing the same issue while compilation of a .proto file with "grpc-gateway" annotations. WORKSPACE changes: Below http_archive added to the workspace.
error is: Build.bazel
Any pointers to debug or any known solution(s) are highly appreciated. |
@vvrpradeep Have you opened an issue with grpc-gateway? I can't provide support for that project, but the people over there are pretty knowledgable. I imagine there's a recommended way to import it into a Bazel project, but I don't know what that is. This doesn't seem like a bug with Gazelle or rules_go, but if you do find a bug, please open a new issue. |
@jayconrod I will approach the grpc-gateway team as well. Just to bring to your notice that
Thanks in advance for your support. |
So I have imported my protoc output into my project directly.
However when running Gazelle to generate build files I get the output displayed underneath. Probably because they already have BUILD files here: https://github.com/grpc-ecosystem/grpc-gateway/tree/master/protoc-gen-swagger/options
How would I get around this?
The text was updated successfully, but these errors were encountered: