Skip to content

Allow run_binary to have executable's execute tools #594

@finn-ball

Description

@finn-ball

Currently if a binary foo internally executes binary bar, then bar's runfiles tree may not be populated as bar can only be added as an input and not as part of the tools.

    ctx.actions.run(
        outputs = ctx.outputs.outs,
        inputs = ctx.files.srcs,
        tools = [ctx.executable.tool],
        executable = ctx.executable.tool,
        arguments = args,
        mnemonic = "RunBinary",
        use_default_shell_env = False,
        env = dicts.add(ctx.configuration.default_shell_env, envs),
    )

https://github.com/bazelbuild/bazel-skylib/blob/471f368fc95a7323078f69d569a164ee5bc07f8b/rules/run_binary.bzl#L44C1-L53C6

Instead to ensure it is, it could be better to have:

        tools = ctx.executable.tools,
        executable = ctx.executable.executable,

This would require a minor change in the attributes in that tool now becomes a list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions