Skip to content

Commit

Permalink
Migrate uses of struct.to_proto
Browse files Browse the repository at this point in the history
Reapplies #6778 after
#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 committed Mar 26, 2024
1 parent c01e0bc commit ce40040
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 ce40040

Please sign in to comment.