diff --git a/ffi/BUILD.bazel b/ffi/BUILD.bazel new file mode 100644 index 000000000..e69de29bb diff --git a/rust/private/rust.bzl b/rust/private/rust.bzl index 30c24fddc..3e89d50ae 100644 --- a/rust/private/rust.bzl +++ b/rust/private/rust.bzl @@ -963,7 +963,9 @@ rust_proc_macro = rule( # https://docs.bazel.build/versions/main/skylark/config.html#user-defined-transitions. attrs = dict( _common_attrs.items(), - _allowlist_function_transition = attr.label(default = Label("//tools/allowlists/function_transition_allowlist")), + _allowlist_function_transition = attr.label( + default = Label("//tools/allowlists/function_transition_allowlist"), + ), deps = attr.label_list( doc = dedent("""\ List of other libraries to be linked to this library target. diff --git a/test/cc_common_link/unit/cc_common_link_test.bzl b/test/cc_common_link/unit/cc_common_link_test.bzl index 8b3c551f0..89b62bfc6 100644 --- a/test/cc_common_link/unit/cc_common_link_test.bzl +++ b/test/cc_common_link/unit/cc_common_link_test.bzl @@ -36,8 +36,13 @@ def _use_cc_common_link_on_target_impl(ctx): use_cc_common_link_on_target = rule( implementation = _use_cc_common_link_on_target_impl, attrs = { - "target": attr.label(cfg = use_cc_common_link_transition, aspects = [collect_dep_actions_aspect]), - "_allowlist_function_transition": attr.label(default = "@bazel_tools//tools/allowlists/function_transition_allowlist"), + "target": attr.label( + cfg = use_cc_common_link_transition, + aspects = [collect_dep_actions_aspect], + ), + "_allowlist_function_transition": attr.label( + default = Label("@bazel_tools//tools/allowlists/function_transition_allowlist"), + ), }, ) diff --git a/test/unit/force_all_deps_direct/generator.bzl b/test/unit/force_all_deps_direct/generator.bzl index 6501b3621..7286b640d 100644 --- a/test/unit/force_all_deps_direct/generator.bzl +++ b/test/unit/force_all_deps_direct/generator.bzl @@ -6,21 +6,21 @@ load("//rust/private:providers.bzl", "BuildInfo", "CrateInfo", "DepInfo", "DepVa # buildifier: disable=bzl-visibility load("//rust/private:rustc.bzl", "rustc_compile_action") -def _generator_impl(ctx): - rs_file = ctx.actions.declare_file(ctx.label.name + "_generated.rs") - ctx.actions.run_shell( - outputs = [rs_file], - command = """cat < {} +_TEMPLATE = """\ use direct::direct_fn; use transitive::transitive_fn; -pub fn call_both() {} +pub fn call_both() { direct_fn(); transitive_fn(); -{} -EOF -""".format(rs_file.path, "{", "}"), - mnemonic = "WriteRsFile", +} +""" + +def _generator_impl(ctx): + rs_file = ctx.actions.declare_file(ctx.label.name + "_generated.rs") + ctx.actions.write( + output = rs_file, + content = _TEMPLATE, ) toolchain = ctx.toolchains[Label("//rust:toolchain_type")] @@ -72,7 +72,10 @@ EOF generator = rule( implementation = _generator_impl, attrs = { - "deps": attr.label_list(), + "deps": attr.label_list( + doc = "List of other libraries to be linked to this library target.", + providers = [CrateInfo], + ), "_cc_toolchain": attr.label( default = Label("@bazel_tools//tools/cpp:current_cc_toolchain"), ),