Skip to content

Improve bazel scan-headers error message #8386

@KangarooKoala

Description

@KangarooKoala

Is your feature request related to a problem? Please describe.
When scan-headers fails, it prints out some lines to add to pyproject.toml but provides absolutely no context or explanation about what those lines mean. If you've read README-RobotPy.md, then you know what to do with the error message, but if you don't, you're left extremely confused about what the error message means.

Describe the solution you'd like
Somehow provide more information within the error message itself about the message means.

Describe alternatives you've considered
We could rely on developers reading README-RobotPy.md. This generally works (especially since the number of developers is relatively few), but it's still annoying that the tool itself doesn't provide more of a nudge towards how to do things. No other .md files referencing README-RobotPy.md doesn't help matters either. (I looked in README-Bazel.md since I knew that bazel was used for working with the robotpy integration, but nothing in there talked about robotpy stuff so I was left looking for Discord messages.)

Additional context
Here's an example error message I got when running bazel run //wpimath:robotpy-wpimath-scan-headers:

exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //wpimath:robotpy-wpimath-scan-headers
-----------------------------------------------------------------------------
# wpi
units-usc = "wpi/units-usc.hpp"
units = "wpi/units.hpp"

Traceback (most recent call last):
  File "/private/var/tmp/.../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/wpimath/robotpy-wpimath-scan-headers.runfiles/__main__/shared/bazel/rules/robotpy/wrapper.py", line 37, in main
    tool_main()
  File "/private/var/tmp/.../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/wpimath/robotpy-wpimath-scan-headers.runfiles/allwpilib_pip_deps_semiwrap/site-packages/semiwrap/tool/__main__.py", line 38, in main
    sys.exit(retval)
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/private/var/tmp/.../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/wpimath/robotpy-wpimath-scan-headers.runfiles/__main__/wpimath/_robotpy-wpimath-scan-headers_stage2_bootstrap.py", line 499, in <module>
    main()
  File "/private/var/tmp/.../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/wpimath/robotpy-wpimath-scan-headers.runfiles/__main__/wpimath/_robotpy-wpimath-scan-headers_stage2_bootstrap.py", line 493, in main
    _run_py_path(main_filename, args=sys.argv[1:])
...
  File "/private/var/tmp/.../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/wpimath/robotpy-wpimath-scan-headers.runfiles/__main__/shared/bazel/rules/robotpy/wrapper.py", line 55, in <module>
    main()
  File "/private/var/tmp/.../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/wpimath/robotpy-wpimath-scan-headers.runfiles/__main__/shared/bazel/rules/robotpy/wrapper.py", line 40, in main
    raise Exception(
Exception: ('sys.exit() explicitly called with a non-zero error code', SystemExit(1))

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featureBrand new functionality, features, pages, workflows, endpoints, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions