Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions rust/private/rust.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,11 @@ _common_attrs = {
"edition": attr.string(
doc = "The rust edition to use for this crate. Defaults to the edition specified in the rust_toolchain.",
),
"extra_outdirs": attr.string_list(
doc = dedent("""\
List of additional output directories which are expected to be written by the compiler.
"""),
),
"lint_config": attr.label(
doc = "Set of lints to apply when building this crate.",
providers = [LintsInfo],
Expand Down
3 changes: 3 additions & 0 deletions rust/private/rustc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,9 @@ def rustc_compile_action(
interface_library = ctx.actions.declare_file(crate_info.output.basename + ".lib", sibling = crate_info.output)
outputs.append(interface_library)

if hasattr(ctx.attr, "extra_outdirs"):
outputs.extend([ctx.actions.declare_directory(outdir) for outdir in ctx.attr.extra_outdirs])

# The action might generate extra output that we don't want to include in the `DefaultInfo` files.
action_outputs = list(outputs)
if rustc_output:
Expand Down