Skip to content

Commit

Permalink
web.bzl: avoid depset union operators
Browse files Browse the repository at this point in the history
Summary:
The `+`, `+=`, and `|` operators on depsets, as well as `depset.union`,
are deprecated due to performance problems:
<bazelbuild/bazel#5817>

As of a recent Bazel commit, `.union` is removed is removed entirely, so
the operators may be soon on the chopping block:
<bazelbuild/bazel@693963f>

This commit removes remaining uses from TensorBoard.

Google-internal source: <http://cl/283060975> (thanks, @laurentlb!).

Test Plan:
Running `bazel run //tensorboard` still works.

Co-authored-by: Laurent Le Brun <[email protected]>
wchargin-branch: remove-depset-union
  • Loading branch information
wchargin and laurentlb committed Dec 4, 2019
1 parent fd4183f commit bc445d0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tensorboard/defs/web.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,13 @@ def _tf_web_library(ctx):
# If a rule exists purely to export other build rules, then it's
# appropriate for the exported sources to be included in the
# development web server.
devserver_manifests = depset(order="postorder")
export_deps = unfurl(ctx.attr.exports)
for dep in export_deps:
devserver_manifests += dep.webfiles.manifests
devserver_manifests = manifests + devserver_manifests
devserver_manifests = depset(
order = "postorder",
transitive = (
[manifests] + [dep.webfiles.manifests for dep in export_deps]
),
)
params = struct(
label=str(ctx.label),
bind="localhost:6006",
Expand Down

0 comments on commit bc445d0

Please sign in to comment.