Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stardoc build fails unless you test first #112

Open
keith opened this issue Oct 21, 2021 · 4 comments
Open

Stardoc build fails unless you test first #112

keith opened this issue Oct 21, 2021 · 4 comments

Comments

@keith
Copy link
Member

keith commented Oct 21, 2021

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
@tetromino
Copy link
Collaborator

Hmm, very strange. I get a different error along the same lines:

$ bazelisk build doc/...
INFO: Analyzed 22 targets (0 packages loaded, 0 targets configured).
INFO: Found 22 targets...
ERROR: /Users/arostovtsev/bazelbuild/rules_apple/doc/BUILD.bazel:28:12: Generating proto for Starlark doc for resources_doc failed: (Exit 1): stardoc failed: error executing command bazel-out/host/bin/external/io_bazel_stardoc/stardoc/stardoc '--input=//apple:resources.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 external/rules_cc/cc/defs.bzl imported '//cc/private/rules_impl:cc_flags_supplier.bzl', yet external/rules_cc/cc/private/rules_impl/cc_flags_supplier.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: external/rules_cc/cc/private/rules_impl/cc_flags_supplier.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 external/rules_cc/cc/defs.bzl imported '//cc/private/rules_impl:cc_flags_supplier.bzl', yet external/rules_cc/cc/private/rules_impl/cc_flags_supplier.bzl was not found, even at roots [., external/build_bazel_rules_apple].
INFO: Elapsed time: 2.470s, Critical Path: 2.03s
INFO: 10 processes: 9 internal, 1 darwin-sandbox.
FAILED: Build did NOT complete successfully

But the error makes no sense: $(bazelisk info execution_root)/external/rules_cc/cc/private/rules_impl/cc_flags_supplier.bzl exists.

@keith
Copy link
Member Author

keith commented Oct 22, 2021

Yea I think there's some racing with the errors so I've seen multiple as well

@tetromino
Copy link
Collaborator

tetromino commented Oct 25, 2021

FWIW, I've tried regenerating Stardoc's bundled jars at bazelbuild/bazel@15a0939 (release 5.0.0-pre.20211011.2) and I am still seeing the same error.

@keith
Copy link
Member Author

keith commented Oct 29, 2021

Looks like disabling sandboxing avoids this bazelbuild/rules_apple#1255 so maybe some input isn't correctly defined?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants