Skip to content

ci: multiversion.sh passes an unquoted $(pwd) to --post-build #1110

Open

Description

@nikagra

docs/_utils/multiversion.sh:5 passes an unquoted command substitution as the post-build command:

cd .. && sphinx-multiversion docs/source docs/_build/dirhtml \
    --pre-build "..." \
    --post-build "$(pwd)/docs/_utils/javadoc-multiversion.sh"

sphinx-multiversion runs shlex.split on --post-build (sphinx_multiversion/main.py:307), so the absolute path is re-split on whitespace. A checkout under a path containing a space — /home/me/my repos/java-driver/... — becomes two argv entries. check_call then raises FileNotFoundError, which is an OSError, and run_commands (main.py:217-228) rescues exactly OSError and logs it as a debug warning.

The result is that every version builds with no api/ and the run reports success. With deploy.sh force-pushing an orphan gh-pages, that publishes the whole site with all 17 javadoc trees deleted — silently. This is the same failure class as #1101, reached by a different route.

The relative form this replaced could not hit it. Quoting the argument so shlex keeps it as one token is enough:

-    --post-build "$(pwd)/docs/_utils/javadoc-multiversion.sh"
+    --post-build "'$(pwd)/docs/_utils/javadoc-multiversion.sh'"

Not reachable on GitHub-hosted runners, whose workspace path (/home/runner/work/java-driver/java-driver) has no spaces — this bites local multiversion builds and any self-hosted runner with a space in its path. Low priority, but silent when it happens.

Raised on #1004 as a Minor; the PR squash-merged before it was applied, so it is filed here rather than left on a merged PR.

Part of the docs publish hardening set — see #1101 and https://scylladb.atlassian.net/browse/DRIVER-1086.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions