Skip to content

Conversation

@umaucher
Copy link
Contributor

In more complex repositories the bazel query can have errors but still would give the xml output. To still use it ignore the return value of the subprocess and add additional filtering on the output.

In more complex repositories the bazel query can have errors but still would
give the xml output. To still use it ignore the return value of the subprocess
and add additional filtering on the output.
@AlexanderLanin
Copy link
Member

I don't think we should ignore bazel return codes, as this will ignore every kind of error.

In case of an error in the subprocess (bazel query) add an error message
indicating that the help is not complete. Still report as much as possible and
don't fail.
@umaucher
Copy link
Contributor Author

umaucher commented Oct 1, 2025

changed the behaviour to be more expressive and still try to parse as much as possible. IMHO fair enough for a helper? Sample output (used in inc_mw_per):

✔ machine:~/eclipse-score/inc_mw_per
$ bazel run -- //:help
INFO: Analyzed target //:help (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:cli-help up-to-date:
  bazel-bin/cli-help
  bazel-bin/cli-help.venv.pth
INFO: Elapsed time: 20.912s, Critical Path: 0.01s
INFO: 1 process: 1 action cache hit, 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/cli-help
ERROR: ~/.cache/external/score-baselibs+/score/json/internal/parser/vajson/BUILD:16:11: no such package '@@score-baselibs+//ecu/xpad/ara/vector': BUILD file not found in directory 'ecu/xpad/ara/vector' of external repository @@score-baselibs+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@score-baselibs+//score/json/internal/parser/vajson:vajson_parser'
[...]
ERROR: Evaluation of query "deps(//...)" failed: errors were encountered while computing transitive closure
WARNING: --keep_going specified, ignoring errors. Results may be inaccurate
 !! Error in bazel query, help string is incomplete!!:
BAZEL TARGETS:

//:copyright-check   Check for license headers:
                     bazel run //:copyright-check
//:copyright-fix     Fix license headers:
                     bazel run //:copyright-fix
//:docs              Build documentation:
                     bazel run //:docs
//:docs_check        Verify documentation:
                     bazel run //:docs_check
//:help              Output all bazel targets with cli_help tag:
                     bazel run //:help
//:ide_support       Create virtual environment (.venv_docs) for documentation support:
                     bazel run //:ide_support
//:kvs_cpp           Build KVS CPP [build]
//:live_preview      Live preview documentation in the browser:
                     bazel run //:live_preview
✔ machine:~/eclipse-score/inc_mw_per

@umaucher umaucher marked this pull request as ready for review October 1, 2025 12:03
@AlexanderLanin AlexanderLanin merged commit b8f5895 into eclipse-score:main Oct 2, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from Draft to Done in Infrastructure Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants