diff options
-rw-r--r-- | site/docs/skylark/repository_rules.md | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/site/docs/skylark/repository_rules.md b/site/docs/skylark/repository_rules.md index 8e492ac091..44e40e3240 100644 --- a/site/docs/skylark/repository_rules.md +++ b/site/docs/skylark/repository_rules.md @@ -51,8 +51,15 @@ If an attribute name starts with `_` it is private and users cannot set it. Every repository rule requires an `implementation` function. It contains the actual logic of the rule and is executed strictly in the Loading Phase. -The function has exactly one input parameter, `repository_ctx`, and should -always returns `None`. The input parameter `repository_ctx` can be used to + +The function has exactly one input parameter, `repository_ctx`. The function +returns either `None` to signify that the rule is reproducible, or a dict with a +set of parameters for that rule that would turn that rule into a reproducible +one generating the same repository. For example, for a rule tracking a git +repository that would mean returning a specific commit identifier instead of a +floating branch that was originally specified. + +The input parameter `repository_ctx` can be used to access attribute values, and non-hermetic functions (finding a binary, executing a binary, creating a file in the repository or downloading a file from the Internet). See [the library](lib/repository_ctx.html) for more |