Conversation
Reference mw_com_rst - the sphinx_docs_library that dependable_element generates so external Sphinx builds can include a dependable element's pages - from docs(data = ...) in the root BUILD. //:docs then fails analysis: non-test target '//:docs_bundle' depends on testonly target '@@score_communication+//score/mw/com/dependability:mw_com_rst' and doesn't have testonly attribute set testonly = False on dependable_element does not help: <name>_index reaches Bazel test rules through components (mandatory, component() creates a test rule), deps (other elements' _dependable_element_test) and tests. Test rules are unconditionally testonly. Not for merge - demonstration only.
antonkri
force-pushed
the
repro/dependable-element-testonly
branch
from
September 29, 2026 14:23
cf70fa5 to
d483cc8
Compare
|
The created documentation from the pull request is available at: docu-html |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Communication generates verification reports for its dependable elements
(
mw_com,message_passing) via thedependable_elementrule fromeclipse-score/tooling. We would like to
mount those pages into the reference integration documentation instead of only
linking them (#378). This PR shows why that does not work today.
The change
One line in the root
BUILD:<name>_rstis thesphinx_docs_librarythatdependable_elementgenerates in"Step 4" precisely so that an external Sphinx build can include the element's pages.
docs(data = ...)is the documented way to add files to this project's root bundle, sothis is the natural attempt.
Result
CI hits the same error through
//:docs_shim. Communication is pinned at313f1178per
known_good.json. The--extra_toolchainsflag is unrelated — without it analysisstops earlier on a missing
libclangtoolchain.dependable_element_message_passing_rstbehaves identically.Why
testonly = Falseis not the answerdependable_elementhas atestonlyparameter that only defaults toTrue, so theobvious idea is to flip it. It does not help: the graph underneath
<name>_rstis builtout of Bazel test rules, which are unconditionally testonly.
<name>_rsthassrcs = [":<name>_index"], and<name>_indexreaches test rulesthrough three independent attributes:
_dependable_element_indexcomponents(mandatory)<x>_component/<x>fromcomponent()_component_test(component.bzl:359)deps<dep>of other dependable elements_dependable_element_test(dependable_element.bzl:2036,test = True)dep.label.name(line 693)testscc_testetc.ctx.attr.testsanywhereThe
componentsrow is the important one:component()creates its main target as atest rule, and
componentsis a mandatory attribute ofdependable_element. Thecontamination is therefore structural, not an artifact of the two optional attributes.
Possible directions (for discussion)
depsandtestsare cheap wins.ctx.attr.testsis never read, andctx.attr.depsis only used fordep.label.name— no providers, no files (the realprovider edge is
processed_deps→<dep>_index). Makingdepsastring_listanddropping
testsremoves two of three paths with no loss of functionality.componentsneeds a split into a docs-producing target and a traceability testtarget — the same split that already exists for
<name>vs<name>_doc.Any fix belongs in
eclipse-score/tooling, not here. This PR only makes the currentstate reproducible.
Contents
BUILD— the onedata = [...]line that breaks//:docsrepro/dependable_element_testonly/README.md— full analysis, commands, expected output