Skip to content

Can't use rules_go toolchain as toolchains attribute in genrule #2255

@gkousik

Description

@gkousik

What version of rules_go are you using?

0.20.1

What version of gazelle are you using?

0.17.0

What version of Bazel are you using?

1.1.0

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

Linux x86_64

Any other potentially useful information about your toolchain?

None

What did you do?

I have a genrule like:

genrule(
    name = "foo",
    srcs = [],
    outs = ["foo.txt"],
    cmd = "touch foo.txt > $@",
    toolchains = [
        "@io_bazel_rules_go//go:toolchain",
    ],
)

What did you expect to see?

That this toolchain is successfully provided to the execution of the genrule.

What did you see instead?

'@io_bazel_rules_go//go:toolchain' does not have mandatory providers: 'TemplateVariableInfo'
ERROR: Analysis of target '//foo:bar' failed; build aborted: Analysis of target '//foo:bar' failed; build aborted
INFO: Elapsed time: 0.662s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (6 packages loaded, 9 targets configured)

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