bazelbuild/bazel

Documentation issue: attr

Open

#13,782 创建于 2021年7月31日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Java (4,465 fork)batch import
P3help wantedteam-Configurabilityteam-Documentationtype: documentation (cleanup)

仓库指标

Star
 (25,384 star)
PR 合并指标
 (平均合并 22天 20小时) (30 天内合并 77 个 PR)

描述

Documentation URL: https://docs.bazel.build/versions/main/skylark/lib/attr.html

The documentation for the cfg parameter is incomplete and misleading to those who have not grok-ed all of Bazel's concepts yet.

It currently states:

cfg default = None Configuration of the attribute. It can be either "host", "exec", or "target". This parameter is required if executable is True to guard against accidentally building host tools in the target configuration. "target" has no semantic effect, so don't set it when executable is False unless it really helps clarify your intentions.

If one does not navigate to the configuration link and read all of that documentation, it is unclear that you can provide your own transition. This can be problematic when first learning bazel and assuming the value can actually only be unspecified, "host", "exec", or "target".

贡献者指南