Repository navigation
Evaluate the coverage scope for the run's platform - #24
Conversation
baselibs' QNX report listed score/os/linux at 0 % and no score/os/qnx file at all (coverage_tool#23). Bazel analyses --coverage_report_generator in the exec configuration, and the scope is a dependency of it, so every select() on the platform resolved for the Linux host whatever --platforms the coverage run used; the allowlist was identical for the Linux and the QNX run. score_coverage_scope gains `platform`: the transition on `deps` sets --platforms to it next to --collect_code_coverage, so the traversal, the baseline objects and the gcno notes are those of the target platform. Without `platform` nothing changes. Consumers declare one scope per platform and put platform-only roots behind a select(). - Analysis tests: a library selected on a fixture-only constraint is listed as the target variant with `platform` and as the host variant without. - Integration workspace: //src:platform_dep selected on //platforms:gcov_target, a child of the GCC platform; coverage:gcov targets it while the host platform stays the plain GCC platform. The LLVM golden gets platform_host.cpp, the gcov golden platform_target.cpp; two checks assert the other variant is absent. - Docs: manual steps 3 and 4b, architecture, requirement tool_req__coverage_scope_platform, ERR-14, known problem, release notes 0.4.0 (0.3.1 dated), verification report (16 analysis tests, 27 checks). Closes #23 Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
|
Documentation preview for this pull request is available at: |
Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
0edecc7 to
e9be6fe
Compare
A wildcard build on the host analyses a platform scope for the other platform without that platform's toolchains registered and fails toolchain resolution (seen on baselibs' Linux jobs). Document the tag next to the attribute and apply it in the integration workspace. Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
Seen on baselibs: a Rust root incompatible with QNX made the scope, the report generator and every test incompatible; bazel coverage executed no test and wrote no report. Manual, known problems and ERR-14 describe the symptom, the diagnostic build of the scope and the remedy. Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
A select() in an attribute is resolved in the configuration of the rule that owns the attribute. With the transition on `deps` only, a per-platform root list in the scope's deps resolved for the host while the roots were built for the target platform: on baselibs the QNX scope received the Linux-only roots, became incompatible, and with it the report generator and every test (bazel coverage skipped all 284). The transition now sits on the rule (incoming edge), so the rule, its select()s and its dependencies all live in the target platform's configuration. - Analysis test: a per-platform root select in the scope's deps with the host root incompatible with the fixture platform; the allowlist holds the target root and the scope is compatible. - Integration workspace: the same pattern with //src:host_root (incompatible on //platforms:gcov_target) and //src:target_root in the scope's deps; both goldens gain the untested root at 0 %; checks assert the other root is absent. - Manual and release notes: the select() in deps is resolved for the platform too. Verified on baselibs with a stand-in toolchain for the QNX platform: the QNX allowlist now has 976 files, 86 under score/os/qnx, none under score/os/linux, no Rust; acl_test is compatible under the coverage flags. Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
|
Validated end to end on eclipse-score/baselibs#626 (QNX on target, run 37473583990): with a QNX scope the report contains 56 |
5d74f70 to
afefbed
Compare
| "Coverage by directory" "Files at exact 0% (3)" \ | ||
| "| In-scope files without coverage data | 2 |" \ | ||
| "In-scope files without coverage data (2)" '- `src/unused_api.h`' '- `src/platform_dep.h`' \ |
There was a problem hiding this comment.
Can this be explained? Why suddenly a change in the number?
Closes #23.
Why
baselibs' first QNX report (eclipse-score/baselibs#626, found by @4og) listed
score/os/linux/*at 0 % and contained no file fromscore/os/qnx/. Bazel analyses--coverage_report_generatorin the exec configuration (BaseRuleClasses.coverageReportGeneratorAttributewithExecutionTransitionFactory), and the scope is a dependency of it. So everyselect()on the platform resolved for the Linux host whatever--platformsthe coverage run used, and the allowlist of the QNX run was identical to the Linux run's (978 files).What
score_coverage_scopegains an optionalplatformlabel. The transition that already set--collect_code_coveragenow also sets--platformsto that label and is applied to the scope rule itself (incoming edge), not only todeps: aselect()in an attribute is resolved in the configuration of the rule that owns it, so a per-platform root list in the scope'sdepsmust be resolved for the platform too. The aspect traversal, the baseline objects, the gcno notes and the scope's ownselect()s are therefore those of the target platform, while the report generator keeps running on the host. Platform scopes carrytags = ["manual"], like the gcov reporter. Withoutplatformnothing changes. Consumers declare one scope per platform (coverage_scope_qnx) and point the gcov reporter at it; platform-only roots go behind aselect(), since an incompatible root fails the analysis.Verification
select()on a fixture-only constraint resolves to the target variant withplatform, to the host variant without//src:platform_depselected on//platforms:gcov_target(child of the GCC platform with a fixture-only constraint);coverage:gcovtargets it, host platform unchangedplatform_host.cpp, gcov goldenplatform_target.cpp, hand-derived; two checks assert the other variant is absent; 27 checks passbazel test //score_coverage/tests/... //tools:all//docs:docs_checkDocs
Manual step 3 (the scope is evaluated for a platform, one scope per platform) and step 4b (the gcov reporter uses
coverage_scope_qnx); architecture; requirementtool_req__coverage_scope_platform; potential error ERR-14; known-problems row for scopes declared withoutplatform; release notes 0.4.0, and 0.3.1 dated; verification report counts.Validated on baselibs
Pinned to this branch in eclipse-score/baselibs#626 with a QNX scope (
platform = x86_64-qnx-sdp_8.0.0-posix, Linux-only and QNX-only roots behind aselect()). Three findings went back into this PR: the scope must be taggedmanual(wildcard Linux builds otherwise analyse it for QNX without the toolchains); a root incompatible with the platform does not fail the run but makes Bazel skip every test, documented with the diagnostic; and theselect()in the scope'sdepswas resolved for the host until the transition moved to the rule. With a stand-in toolchain the QNX allowlist now has 976 files, 86 underscore/os/qnx, none underscore/os/linux, and the tests are compatible.Follow-up after release
baselibs #626 and communication #1171: add
coverage_scope_qnxwith the QNX platform, point the gcov reporters at it, and move baselibs' explicit Linux-only roots (//score/os/linux,//score/os/linux/utils:network_interface) behind aselect().