buck2
buck2 copied to clipboard
Starlark: support doc strings for records
It would be helpful to be able to specify doc strings for records. This may be possible already and I just can't find it. Providers support a doc argument, but if given in a struct, it fails:
Caused by:
0: Error evaluating module: `toolchains//nix.bzl@root`
1: Traceback (most recent call last):
* toolchains/nix.bzl:129, in <module>
NixDerivationInfo = record(
error: String literals are not allowed in type expressions: `"All the output paths for a derivation."`
--> toolchains/nix.bzl:129:21
|
129 | NixDerivationInfo = record(
| _____________________^
130 | | doc = """All the output paths for a derivation.""",
131 | | derivation = NixPathInfo,
132 | | outputs = dict[str, NixPathInfo],
133 | | )
| |_^
|