From e509ccd704f3045bb340b6d19b041ad5833c4936 Mon Sep 17 00:00:00 2001 From: Paul Johnston Date: Tue, 25 Nov 2025 17:54:14 -0700 Subject: [PATCH] proto_compiled_sources: do not emit rule if no srcs --- pkg/protoc/proto_compiled_sources.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/protoc/proto_compiled_sources.go b/pkg/protoc/proto_compiled_sources.go index 28cab0d26..a9e61bd9e 100644 --- a/pkg/protoc/proto_compiled_sources.go +++ b/pkg/protoc/proto_compiled_sources.go @@ -44,6 +44,9 @@ func (s *protoCompiledSources) LoadInfo() rule.LoadInfo { // ProvideRule implements part of the LanguageRule interface. func (s *protoCompiledSources) ProvideRule(cfg *LanguageRuleConfig, config *ProtocConfiguration) RuleProvider { + if len(config.Outputs) == 0 { + return nil + } return &protoCompileRule{ kind: "proto_compiled_sources", nameSuffix: "compiled_sources",