Repository navigation
Build failure when depending on target in // #31
Copy link
Copy link
Open
Description
When I depend on a target in the root package, I get an annoying build failure.
doxygen(
name = "doxygen",
srcs = [
"//:LICENSE.md",
],
outs = ["html"],
doxyfile_template = "Doxyfile",
exclude = "wpiutil/src/main/native/resources/wpilib-128.png docs/theme.css",
html_extra_stylesheet = "docs/theme.css",
project_logo = "wpiutil/src/main/native/resources/wpilib-128.png",
project_name = "WPILibC++",
project_number = "$(WPILIB_VERSION)",
strip_from_inc_path = paths,
strip_from_path = paths,
target_compatible_with = select({
"@platforms//cpu:x86_64": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
)
austin[3762] server1868-1 (doxygen) ~/local/allwpilib3
$ bazel test -c opt //...
INFO: Analyzed 1176 targets (36 packages loaded, 6482 targets configured).
ERROR: /home/austin/local/allwpilib3/docs/BUILD.bazel:55:8: Building doxygen documentation for rule 'doxygen' failed: (Exit 2): doxygen failed: error executing DoxygenBuild command (from target //docs:doxygen) external/doxygen/linux/doxygen bazel-out/k8-opt/bin/docs/Doxyfile
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/dev/shm/bazel-sandbox.4d3c097c0a97f2da7a46adb4ecfab883763059ef5c0a7cd7d6c5786cd12fe713/linux-sandbox/647/execroot/__main__/bazel-out/k8-opt/bin/docs/Doxyfile:2904: warning: Reached end of file while still inside a (nested) comment. Nesting level 1 (probable line reference: 1044)
/dev/shm/bazel-sandbox.4d3c097c0a97f2da7a46adb4ecfab883763059ef5c0a7cd7d6c5786cd12fe713/linux-sandbox/647/execroot/__main__/external/doxygen/linux/doxygen:259971: warning: the \endcond does not have a corresponding \cond in this file
input buffer overflow, can't enlarge buffer because scanner uses REJECT
lexical analyzer: /mnt/hgfs/dimitri/doxygen.git/src/pre.l (for: /dev/shm/bazel-sandbox.4d3c097c0a97f2da7a46adb4ecfab883763059ef5c0a7cd7d6c5786cd12fe713/linux-sandbox/647/execroot/__main__/external/doxygen/linux/doxygen)
INFO: Elapsed time: 1.512s, Critical Path: 1.13s
INFO: 5 processes: 13216 action cache hit, 5 internal.
ERROR: Build did NOT complete successfully
Digging in, this is because . gets added to the inputs path, which then tries to parse external/doxygen and overflows the input buffer.
I fixed it by copying the file out of //, but it would be wonderful if either the rule exploded when I did it, or if it handled it correctly.
wpilibsuite/allwpilib#8157 has the full change (with workaround).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
TendTo commentedon Aug 5, 2025
Hi, thanks for the detailed report.
I was able to reproduce the issue thanks to your pointer.
It is not a problem I had encountered before, but it makes complete sense.
As for the solution, I'm not sure if it something that can be fixed without dangerously limiting other valid potential use cases. But a possible simpler workaround would be to use the
exclude_patternsconfiguration propertydoxygenexposes. You can add more paths you knowdoxygenhas no business investigating.Using the following modified
docs/BUILD.bazelfile to build the documentation in your project seems to work:AustinSchuh commentedon Aug 10, 2025
Yea, that's what I ended up doing to work around it. Thanks! I filed this bug for 2 reasons.
TendTo commentedon Aug 11, 2025
It makes complete sense. I think I may add a warning (and a flag to disable it) if the rule detects that the path
.is used, suggesting includingexclude_patterns = ["*/external/*"]to the rule. This will not preclude access to people who may want to use that folder.AustinSchuh commentedon Aug 11, 2025
I like that! That would have saved me a good chunk of time.