Skip to content
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 Support #550

Open
lbhdc opened this issue Aug 21, 2023 · 6 comments
Open

Bazel Support #550

lbhdc opened this issue Aug 21, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@lbhdc
Copy link

lbhdc commented Aug 21, 2023

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?

@mwhittaker
Copy link
Member

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?

@mwhittaker mwhittaker self-assigned this Aug 21, 2023
@lbhdc
Copy link
Author

lbhdc commented Aug 21, 2023

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"
  ]
)

@mwhittaker mwhittaker added the enhancement New feature or request label Aug 21, 2023
@mwhittaker
Copy link
Member

I see. Thanks for explaining; I'm not very familiar with bazel. I'll leave the issue open as a TODO then.

@lbhdc
Copy link
Author

lbhdc commented Aug 21, 2023

Thanks, I appreciate it 😁

@lbhdc
Copy link
Author

lbhdc commented Aug 21, 2023

If an open source ruleset was developed, would that be something you would be interested in having contributed back to service weaver?

@mwhittaker
Copy link
Member

Yeah, for sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants