Skip to content

aspect actions with non-Bazel attributes in execution_requirements are not included in remote spawns #28095

@Silic0nS0ldier

Description

@Silic0nS0ldier

Description of the bug:

aspects with spawnable actions (ctx.actions.run and ctx.actions.run_shell) are not including unknown attributes in remote spawns.

e.g.

def _aspect_impl(ctx):
    # ...
    output_marker = ctx.actions.declare_file(target.label.name + ".marker")
    ctx.actions.run(
        inputs = depset(
            direct = [...],
            transitive = [...],
        ),
        outputs = [output_marker],
        executable = ctx.executable._foo_tool,
        arguments = [...],
        execution_requirements = {
            "Pool": "foo",
          # ^^^^^^^^^^^^^ not included
        },
    )
    return [
        OutputGroupInfo(_validation = depset([output_marker])),
    ]

foo_aspect = aspect(
    implementation = _aspect_impl,
    attrs = {
        "_foo_tool": attr.label(
            default = "//:foo",
            executable = True,
            cfg = "exec",
        ),
    },
)

Which category does this issue belong to?

Remote Execution

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

A remote execution setup is required, other than that all that's needed is an aspect with a ctx.actions.run action.

The output isn't important, nor is the executable. It can just be an executable shell script with a she-bang that has exit 1 and an arbitrary output that goes into OutpuGroupInfo(_validation = depset([...])).

Actually observing the missing attributes may be a little tricky (our remote execution vendor includes the values in server-side profiles). They may be in the execlog, though I've not checked.

Which operating system are you running Bazel on?

GNU/Linux (22.04.1-Ubuntu)

What is the output of bazel info release?

release 8.5.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

NA - private source

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions