Fix PlantUML and Graphviz execution in Zuul CI documentation builds - #433
Fix PlantUML and Graphviz execution in Zuul CI documentation builds#433vishwajitdandage wants to merge 2 commits into
Conversation
When the PlantUML wrapper invokes plantuml_java, explicitly set the JAVA_RUNFILES environment variable so that the Java launcher can locate its runfiles directory. This is critical in Bazel sandbox contexts where the Java process cannot rely on default runfiles discovery mechanisms. Tries two locations: 1. First, plantuml_java.runfiles adjacent to the Java binary 2. Fallback to the sh_binary's RUNFILES_DIR if available Fixes 'Cannot locate runfiles directory' errors when PlantUML is invoked from Sphinx actions in Bazel sandboxes. fix(plantuml): resolve JDK via runfiles manifest when no runfiles tree exists The empty-placeholder JAVA_RUNFILES fallback satisfied the launcher's directory-exists check but the generated Java launcher itself resolves its own JDK as $JAVA_RUNFILES/<jdk repo>/bin/java, so an empty directory still failed with 'No such file or directory'. Resolve the real JDK location from the runfiles manifest and symlink it into a synthetic runfiles directory instead. fix(plantuml): materialize full runfiles tree when no directory exists The JDK-only symlink fixed 'Cannot locate runfiles directory' but the Java launcher also resolves PlantUML's own classpath jars purely as paths under $JAVA_RUNFILES, causing ClassNotFoundException. Build a full synthetic runfiles tree from the manifest instead (one symlink per entry), cached by manifest checksum so repeated diagram renders within the same action reuse it instead of rebuilding it each time.
|
Thanks for tracking down the sandbox/runfiles-materialization root cause — we hit the One simplification idea for Happy to help prototype this simplification if useful. |
f9e1066 to
552bd39
Compare
Issue: #324
Why
PlantUML and Graphviz diagrams fail during documentation builds executed in Zuul Bazel sandbox environments, especially when runfiles are not materialized as symlinks.
The tools cannot reliably locate their Java runtime, classpath dependencies, or Graphviz executable when only the runfiles manifest is available. This results in errors such as missing runfiles directories, unresolved PlantUML classes, and unavailable Graphviz binaries. Consequently, documentation builds either fail or produce missing diagrams.
How
Updated the tooling to support sandboxed execution by:
JAVA_RUNFILESfor PlantUML invocations.Graphviz error -
Plantuml error -