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

Generate empty files in closure_grpc_web_library() bazel rules #1085

Closed
wants to merge 3 commits into from

Conversation

psigen
Copy link

@psigen psigen commented May 22, 2021

This adds a flag allow_empty_files which forces the generation of output .grpc.js files even if they do not contain service definitions. The flag is False by default, to retain the current behavior. It is set True in the bazel plugin, and should be set when using any build system that tracks generated output files.

This prevents an issue if the source targets do not yield a .grpc.js generated file because they do not contain an rpc definition (e.g. proto files that only contain a message).

Resolves: #1076
Supersedes: #1077

psigen added 3 commits May 2, 2021 01:52
This adds a `ctx.actions.write` to each of the automatically generated source targets
that have been declared.  This prevents an issue if the source targets do not yield a
`.grpc.js` generated file because they do not contain an `rpc` definition (e.g. proto
files that only contain a `message`).

Resolves: grpc#1076
@psigen psigen changed the title Patch 1 Generatee empty files in closure_grpc_web_library() bazel rules May 22, 2021
@psigen psigen changed the title Generatee empty files in closure_grpc_web_library() bazel rules Generate empty files in closure_grpc_web_library() bazel rules May 22, 2021
@psigen
Copy link
Author

psigen commented May 22, 2021

@stanley-cheung this version passed all the tests locally.

@sampajano
Copy link
Collaborator

Thanks a lot for the PR!

But unfortunately, we've decided to clean up our Bazel + javascript uses in #1138..

So this change no longer applies..

Sorry for the change!

@sampajano sampajano closed this Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If an empty .proto is specified to closure_grpc_web_library() it will fail.
2 participants