bazelbuild / bazelbuild/stardoc

`input` attribute of `stardoc` rule is not optional, despite what the documentation says

Open
#99 0 comments 0 reactions 0 assignees View on GitHub
P3 type: bug
Dominant language
Java
Stars
118
Forks
51
PR merge metrics
No merged PRs in 30d

Description

The documentation for `stardoc` says that the `input` attribute is `optional`. However, leaving out this attribute leads to the following error:

```
ERROR: /foo/rules_kotlin/kotlin/BUILD:38:8: in stardoc rule //kotlin:stardoc:
Traceback (most recent call last):
File "/private/var/tmp/_bazel_shs/71d26a4c57cf01b6c7f0c561a4a031b5/external/io_bazel_stardoc/stardoc/stardoc.bzl", line 29, column 25, in _stardoc_impl
input_files = depset(direct = [ctx.file.input], transitive = [
Error in depset: cannot add an item of type 'File' to a depset of 'NoneType'
```

Either the field is mandatory, or a check must be done to correctly identify whether `input` has been set.

Contributor guide

Open the contributing guide

Research direction

Start with stardoc/stardoc.bzl around line 29, where the reported traceback constructs input_files, and compare that behavior with the stardoc rule documentation for input. Confirm the behavior without input, then make the implementation and documentation agree and verify the rule no longer produces the reported depset error.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.