summaryrefslogtreecommitdiff
path: root/bazel
diff options
context:
space:
mode:
authorLaurent Le Brun <laurentlb@gmail.com>2019-05-24 14:22:13 +0200
committerLaurent Le Brun <laurentlb@gmail.com>2019-05-24 14:22:13 +0200
commit1a5a609b0e504aa5bf25e5b79d505974e34f0f98 (patch)
tree915e4e9389142d8ee750102a032f35af50633f2b /bazel
parent9f49efef6203973931894a4ed9b862b3e3d639f0 (diff)
Update upb_proto_library.bzl for Bazel compatibility
With this change, the code now builds with the flags --incompatible_depset_is_not_iterable, --incompatible_new_actions_api, and --incompatible_no_support_tools_in_action_inputs. These flags will soon be enabled by default in Bazel.
Diffstat (limited to 'bazel')
-rw-r--r--bazel/upb_proto_library.bzl7
1 files changed, 4 insertions, 3 deletions
diff --git a/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl
index 09d557c..bb3eb57 100644
--- a/bazel/upb_proto_library.bzl
+++ b/bazel/upb_proto_library.bzl
@@ -42,7 +42,7 @@ def _generate_output_file(ctx, src, extension):
else:
real_short_path = paths.relativize(src.short_path, ctx.label.package)
output_filename = paths.replace_extension(real_short_path, extension)
- ret = ctx.new_file(ctx.genfiles_dir, output_filename)
+ ret = ctx.actions.declare_file(output_filename)
return ret
def _filter_none(elems):
@@ -149,12 +149,13 @@ _WrappedGeneratedSrcs = provider(fields = ["srcs"])
def _compile_upb_protos(ctx, proto_info, proto_sources, ext):
srcs = [_generate_output_file(ctx, name, ext + ".c") for name in proto_sources]
hdrs = [_generate_output_file(ctx, name, ext + ".h") for name in proto_sources]
- transitive_sets = list(proto_info.transitive_descriptor_sets)
+ transitive_sets = proto_info.transitive_descriptor_sets.to_list()
ctx.actions.run(
inputs = depset(
- direct = [ctx.executable._upbc, proto_info.direct_descriptor_set],
+ direct = [proto_info.direct_descriptor_set],
transitive = [proto_info.transitive_descriptor_sets],
),
+ tools = [ctx.executable._upbc],
outputs = srcs + hdrs,
executable = ctx.executable._protoc,
arguments = [
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback