Skip to content

Commit

Permalink
Migrate uses of struct.to_proto (tensorflow#6801)
Browse files Browse the repository at this point in the history
Reapplies tensorflow#6778 after
tensorflow#6721 inadvertently
reverted part of it.

The "to_proto" method on Starlark structs is deprecated and shouldn't be
used. Instead, the proto module's "encode_text" function should be used.
(https://bazel.build/rules/lib/toplevel/proto)

It, along with "to_json", can be disabled in Bazel using the flag
--incompatible_struct_has_no_methods

The underlying implementation is the same, so there should be no
observable changes in final outputs.
  • Loading branch information
c-mita authored and AnuarTB committed May 3, 2024
1 parent a76ca34 commit 63ba5c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorboard/defs/web.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _tf_web_library(ctx):
],
)
params_file = _new_file(ctx, "-params.pbtxt")
ctx.actions.write(output = params_file, content = params.to_proto())
ctx.actions.write(output = params_file, content = proto.encode_text(params))
ctx.actions.write(
is_executable = True,
output = ctx.outputs.executable,
Expand Down

0 comments on commit 63ba5c2

Please sign in to comment.