Update some deprecated Starlark function calls
The `ctx.action()` call and friends are now under `ctx.actions.*`.
This patch updates the calls to the new locations. Newer bazel
versions removed the old versions altogether.
Change-Id: I748d056054d13a0385a06c0c94a2283acfdb82af
diff --git a/aos/seasocks/gen_embedded.bzl b/aos/seasocks/gen_embedded.bzl
index 5bdb80d..bb27e52 100644
--- a/aos/seasocks/gen_embedded.bzl
+++ b/aos/seasocks/gen_embedded.bzl
@@ -1,5 +1,5 @@
def _gen_embedded_impl(ctx):
- ctx.action(
+ ctx.actions.run(
inputs = ctx.files.srcs,
outputs = [ctx.outputs.source],
executable = ctx.executable._gen_embedded,
diff --git a/aos/vision/download/downloader.bzl b/aos/vision/download/downloader.bzl
index 34a1ec7..c972639 100644
--- a/aos/vision/download/downloader.bzl
+++ b/aos/vision/download/downloader.bzl
@@ -1,8 +1,8 @@
def _aos_vision_downloader_impl(ctx):
all_files = ctx.files.srcs
- ctx.file_action(
+ ctx.actions.write(
output = ctx.outputs.executable,
- executable = True,
+ is_executable = True,
content = "\n".join([
"#!/bin/bash",
"set -e",
diff --git a/frc971/downloader/downloader.bzl b/frc971/downloader/downloader.bzl
index 75a1a9b..e1b535e 100644
--- a/frc971/downloader/downloader.bzl
+++ b/frc971/downloader/downloader.bzl
@@ -1,8 +1,8 @@
def _aos_downloader_impl(ctx):
all_files = ctx.files.srcs + ctx.files.start_srcs + [ctx.outputs._startlist]
- ctx.file_action(
+ ctx.actions.write(
output = ctx.outputs.executable,
- executable = True,
+ is_executable = True,
content = "\n".join([
"#!/bin/bash",
"set -e",
@@ -21,7 +21,7 @@
]),
)
- ctx.file_action(
+ ctx.actions.write(
output = ctx.outputs._startlist,
content = "\n".join([f.basename for f in ctx.files.start_srcs]) + "\n",
)
diff --git a/third_party/protobuf/protobuf.bzl b/third_party/protobuf/protobuf.bzl
index 9589750..7925d18 100644
--- a/third_party/protobuf/protobuf.bzl
+++ b/third_party/protobuf/protobuf.bzl
@@ -105,7 +105,7 @@
inputs += [plugin]
if args:
- ctx.action(
+ ctx.actions.run(
inputs=inputs,
outputs=ctx.outputs.outs,
arguments=args + import_flags + [s.path for s in srcs],
@@ -130,7 +130,7 @@
"protoc": attr.label(
cfg = "host",
executable = True,
- single_file = True,
+ allow_single_file = True,
mandatory = True,
),
"plugin": attr.label(
diff --git a/tools/build_rules/fortran.bzl b/tools/build_rules/fortran.bzl
index 22882ac..9e6e789 100644
--- a/tools/build_rules/fortran.bzl
+++ b/tools/build_rules/fortran.bzl
@@ -59,8 +59,7 @@
_single_fortran_object = rule(
attrs = {
"src": attr.label(
- single_file = True,
- allow_files = FileType([".f"]),
+ allow_single_file = [".f"],
),
"cc_libs": attr.label_list(providers = ["cc"]),
# TODO(Brian): Replace this with something more fine-grained from the