Bazel Support
Hey! I am really interested in exploring how service weaver would fit in a bazel project.
I asked in the bazel slack if there was an integration with service weaver, and it was suggested that perhaps there was internal blaze support.
If that support exists, would it be possible to open source it?
Hi @lbhdc, we do not have any official bazel support.
To build a Service Weaver application, you have to run weaver generate ./... and go build. Does bazel support that?
Thanks for such a quick response @mwhittaker!
It does supports something similar to that. The canonical way to build go programs is with the rules_go ruleset which downloads the toolchain, and handles calling go build, go run, or go test. Related rulesets also handle generating all the bazel integrations for third party packages.
https://github.com/bazelbuild/rules_go
As for the weaver command, support in the form of a ruleset is needed to make it available to bazel users.
Just brainstorming the api, but I would imagine using such a ruleset would kinda look like this. A user would add this glob to their BUILD file, and bazel would invoke the weaver command when any of the dependencies have been updated. The code would then be able to be consumed by yet another down stream tools (like kubectl for manifests).
weaver_generate(
name = "foo",
deps = [
"//my/top/level/weaver:component"
]
)
I see. Thanks for explaining; I'm not very familiar with bazel. I'll leave the issue open as a TODO then.
Thanks, I appreciate it :grin:
If an open source ruleset was developed, would that be something you would be interested in having contributed back to service weaver?
Yeah, for sure!