Skip to content

Commit

Permalink
Fix depset/list confusion in #7458.
Browse files Browse the repository at this point in the history
See
#7458 (comment).

release notes: no

Signed-off-by: Harvey Tuch <htuch@google.com>
  • Loading branch information
htuch authored and acozzette committed May 29, 2020
1 parent 24fa955 commit e492e5a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions protobuf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,14 @@ def _proto_gen_impl(ctx):
import_flags = depset(direct=["-I."])

for dep in ctx.attr.deps:
import_flags = depset(transitive=[import_flags, depset(direct=dep.proto.import_flags)])
deps = depset(transitive=[deps, depset(direct=dep.proto.deps)])
if type(dep.proto.import_flags) == "list":
import_flags = depset(transitive=[import_flags], direct=dep.proto.import_flags)
else:
import_flags = depset(transitive=[import_flags, dep.proto.import_flags])
if type(dep.proto.deps) == "list":
deps = depset(transitive=[deps], direct=dep.proto.deps)
else:
deps = depset(transitive=[deps, dep.proto.deps])

if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin:
return struct(
Expand Down

0 comments on commit e492e5a

Please sign in to comment.