Skip to content

Commit 3125376

Browse files
alexeaglejasonaden
authored andcommitted
fix(bazel): allow ts_library interop with list-typed inputs (#30600)
_compile_action should take a list since we compute it within one node in the build graph This needs to be cleaned up since Bazel is getting stricter with disallowing iteration over depsets PR Close #30600
1 parent 2cd5294 commit 3125376

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎packages/bazel/src/ng_module.bzl‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,14 @@ def _compile_action(ctx, inputs, outputs, dts_bundles_out, messages_out, tsconfi
489489
# Give the Angular compiler all the user-listed assets
490490
file_inputs = list(ctx.files.assets)
491491

492+
if (type(inputs) == type([])):
493+
file_inputs.extend(inputs)
494+
else:
495+
# inputs ought to be a list, but allow depset as well
496+
# so that this can change independently of rules_typescript
497+
# TODO(alexeagle): remove this case after update (July 2019)
498+
file_inputs.extend(inputs.to_list())
499+
492500
if hasattr(ctx.attr, "node_modules"):
493501
file_inputs.extend(_filter_ts_inputs(ctx.files.node_modules))
494502

@@ -508,7 +516,7 @@ def _compile_action(ctx, inputs, outputs, dts_bundles_out, messages_out, tsconfi
508516
# Collect the inputs and summary files from our deps
509517
action_inputs = depset(
510518
file_inputs,
511-
transitive = [inputs] + [
519+
transitive = [
512520
dep.collect_summaries_aspect_result
513521
for dep in ctx.attr.deps
514522
if hasattr(dep, "collect_summaries_aspect_result")

0 commit comments

Comments
 (0)