-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Bazel Rule? #1010
Comments
I was able to compile the Gateway go file using Bazel, but it's a bit hacky. I'm sharing couple of core points, and perhaps someone knows of a better solution. First, use
Both are going into your
The actual
|
I'm not sure I understand the problem here. You successfully added the WRT adding a dependency on the runtime, why would you expect that you could use code from the runtime without adding a dep to it? That's sort of bazel's thing, isn't it? What's wrong with using our |
Hello achew22 :-) I miss-used the word 'Hack'. What I mean is that the above wasn't very 'straight-forward'. Take this other gateway rule I mentioned. It have a "public" rule called What I currently do is almost accessing a "private" API in a sense, because I navigate inside the project and stating for example I'm using Now it's fine of-course if you guys prefer not to create a dedicated Thanks! |
We have
The To me, these seem like public rules. Maybe you could speak about what is missing from them that would make them more "public"? I'm asking for specific and actionable feedback here. I'd like to make things better, but I don't know how. Maybe a PR or a sample repo describing your issue would be useful to understand as well. |
Completely understand. This issue was originally opened as a question. To figure out if I'm consuming and using your Bazel build files correctly from a remote Bazel build system. You seems to approve of that way, and that's enough for me as for now. In case I'll have a more concentrate example on what I think can be improved, I'll open a detailed PR and sample repo as you rightfully requested. Let's close this issue, but just in-case I'm attaching a minimal example on how I did things. People might find it useful, as the examples on the Thank you achew22 ! :-) |
Oh, @achew22 - forgot to mention something. |
Hello,
I'm using Bazel to build a project consists of gRPC protobuf files, and would also like to generate a grpc-gateway/swagger along with that.
There's no build-in Bazel rule for the gateway, and the only alternative I could find was here. The problem with this rule is that it generated the
main.go
file for you, and in my-case, I already have a gatewaymain.go
file I want to just compile and create binary from.I noticed you guys using Bazel to build your code, so I was trying to compile the Gateway like a normal Go file with
go_binary
, but failed to consume grpc-gateway as remote dependency (maybe I missed something). Is that even possible? and if not - is there any alternative? or the only way I can compile a gateway/swagger is from command-line?Thanks!
The text was updated successfully, but these errors were encountered: