bazelbuild / bazelbuild/stardoc

Stardoc build fails unless you test first

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

Description

On rules apple, when attempting to build documentation it fails:

```
% bazel clean --expunge
...
% bazel build doc/...
INFO: Analyzed 21 targets (0 packages loaded, 0 targets configured).
INFO: Found 21 targets...
ERROR: /Users/ksmiley/dev/rules_apple/doc/BUILD.bazel:28:12: Generating proto for Starlark doc for tvos.doc_doc failed: (Exit 1): stardoc failed: error executing command bazel-out/host/bin/external/io_bazel_stardoc/stardoc/stardoc '--input=//apple:tvos.doc.bzl' '--workspace_name=build_bazel_rules_apple' '--dep_roots=.' '--dep_roots=external/build_bazel_rules_apple' ... (remaining 1 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
com.google.devtools.build.skydoc.SkydocMain$StarlarkEvaluationException: File apple/internal/tvos_rules.bzl imported '@build_bazel_rules_apple//apple/internal/aspects:swift_dynamic_framework_aspect.bzl', yet apple/internal/aspects/swift_dynamic_framework_aspect.bzl was not found, even at roots [., external/build_bazel_rules_apple].
at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:412)
at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:402)
at com.google.devtools.build.skydoc.SkydocMain.eval(SkydocMain.java:260)
at com.google.devtools.build.skydoc.SkydocMain.main(SkydocMain.java:163)
Caused by: java.nio.file.NoSuchFileException: apple/internal/aspects/swift_dynamic_framework_aspect.bzl
at com.google.devtools.build.skydoc.SkydocMain.getInputSource(SkydocMain.java:454)
at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:385)
at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:402)
... 3 more
Stardoc documentation generation failed: File apple/internal/tvos_rules.bzl imported '@build_bazel_rules_apple//apple/internal/aspects:swift_dynamic_framework_aspect.bzl', yet apple/internal/aspects/swift_dynamic_framework_aspect.bzl was not found, even at roots [., external/build_bazel_rules_apple].
INFO: Elapsed time: 1.681s, Critical Path: 1.46s
INFO: 10 processes: 10 internal.
FAILED: Build did NOT complete successfully
```

If you instead run some `diff_test` targets that depend on the docs, they pass:

```
% bazel test doc/...
INFO: Build option --test_env has changed, discarding analysis cache.
INFO: Analyzed 9 targets (0 packages loaded, 687 targets configured).
INFO: Found 9 test targets...
INFO: Elapsed time: 5.168s, Critical Path: 4.68s
INFO: 28 processes: 36 local.
INFO: Build completed, 1 test FAILED, 28 total actions
//doc:check_dtrace PASSED in 0.6s
//doc:check_ios.doc PASSED in 0.5s
//doc:check_macos.doc PASSED in 0.5s
//doc:check_providers PASSED in 0.2s
//doc:check_resources PASSED in 0.3s
//doc:check_tvos.doc PASSED in 0.4s
//doc:check_versioning PASSED in 0.4s
...
```

and then subsequent builds are successful:

```
% bazel build doc/...
INFO: Build option --test_env has changed, discarding analysis cache.
INFO: Analyzed 21 targets (0 packages loaded, 691 targets configured).
INFO: Found 21 targets...
INFO: Elapsed time: 0.339s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
```

Contributor guide

Open the contributing guide

Research direction

Start with doc/BUILD.bazel and the import from apple/internal/tvos_rules.bzl to the missing swift_dynamic_framework_aspect.bzl. Reproduce with bazel clean --expunge followed by bazel build doc/..., then compare with bazel test doc/...; done means a clean documentation build succeeds without running tests first.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.