rules_foreign_cc icon indicating copy to clipboard operation
rules_foreign_cc copied to clipboard

`runnable_binary` is not usable in `genrule`

Open snakethatlovesstaticlibs opened this issue 1 year ago • 0 comments

I have a python interpreter being built from source:

configure_make(
    name = "python3",
    ...

which is then used in a runnable_binary rule:

runnable_binary(
    name = "python_binary",
    binary = "python3",
    foreign_cc_target = "python3",
    visibility = ["//visibility:public"],
)

however, if I want to use the runnable binary in this genrule

genrule(
    name = "repro",
    cmd = "$(location :python_binary) -c 'from locale import localeconv; localeconv()' > $@",
    srcs = [":python_binary"],
    outs = ["thing.txt"],
)

I get the classic in cmd attribute of genrule rule @@python3.13.0//:repro: label '@@python3.13.0//:python_binary' in $(location) expression expands to more than one file, please use...

Is there a known workaround for this?