buck2 icon indicating copy to clipboard operation
buck2 copied to clipboard

DefaultInfo docs: `attrs.output()` does not exist

Open lf- opened this issue 3 months ago • 1 comments

https://buck2.build/docs/api/build/DefaultInfo/ gives the following in an example:

foo_binary = rule(
    impl=impl,
    attrs={
        "srcs": attrs.list(attrs.source()),
        "out": attrs.output(),
        "stripped": attrs.output(),
        "debug_info": attrs.output(),
        "_cc": attrs.dep(default="//tools:cc", providers=[RunInfo]),
        "_strip_script": attrs.dep(default="//tools:strip", providers=[RunInfo])
)

Besides the missing } at the end there, there's an attrs.output() that is not a thing that exists. I am not sure what it is intended to be either.

The meta-issue of this is that the examples in the documentation need to be doc-tested somehow.

lf- avatar Aug 27 '25 22:08 lf-

Thank you for reporting. We don't have attrs.output() any more. I will update it.

The meta-issue of this is that the examples in the documentation need to be doc-tested somehow.

That's true. We need to find way to do that. Also the idea for the example can provide a env for user to be run for users

Nero5023 avatar Aug 28 '25 00:08 Nero5023