Replies: 2 comments 1 reply
-
This might be a tangent to the proposal, but I think this is a big, one-way turn solution to a relatively small(?) problem. First, let's talk about why I think this is a small problem: If I read this correctly, this is mainly to improve how we are currently generating documentation for starlark rules. This resulted in me, as well as some folks I know, preferring to read the implementation instead of reading the generated doc for more accurate references. It would be interesting if we could ask some questions related to this topic (starlark rules authoring pain points) in the next user's survey so we could see how relevant documentation vs source navigation. Second, I think the current proposal is a big one-way street. While we are trying to migrate away from native rules over to starlark rules, this would add one more native rule into the mix. Keep in mind: as a user, |
Beta Was this translation helpful? Give feedback.
-
Update: This design has been rejected. See the new Decision section for an explanation of the two possible future designs -- one is a new incarnation of this proposal, and the other is a completely different approach that would involve more magic but more benefits. Unfortunately, we can't really prioritize either one right now, so Stardoc will continue to use its current hack of doing its own direct dependency validation. Thanks to everyone for the very useful comments! |
Beta Was this translation helpful? Give feedback.
-
This is a proposal to create a native rule similar to Skylib's
bzl_library
. The main differences are:It would do proper strict-deps enforcement: If you load foo.bzl, then foo.bzl must appear in srcs of the current target or one of its direct deps.
Native rules would be able to access the underlying .bzl module object represented by the target. This would be useful to the new
starlark_doc_extract
rule, which implements the new version of Stardoc that dumps docstrings directly from Bazel rather than inferring them based on mock evaluation of .bzl files.Only source .bzl files would be allowed, not generated .bzl files (which can't be loaded anyway).
The migration path from
bzl_library
is the part that's most uncertain at this point. (See the Compatibility section.)Beta Was this translation helpful? Give feedback.
All reactions