Skip to content

sphinxdocs .serve does not work when --symlink_prefix is set #3410

@schenker

Description

@schenker

🐞 bug report

Affected Rule

py_binary(
name = name + ".serve",
srcs = [_SPHINX_SERVE_MAIN_SRC],
main = _SPHINX_SERVE_MAIN_SRC,
data = [html_name],
args = [
"$(execpath {})".format(html_name),
],
**common_kwargs_with_manual_tag
)

Description

When using sphinx_docs to define my_docs, running bazel run //my_docs.serve outputs

Serving directory: /home/me/.../my-project/bazel-out/k8-dbg/bin/my_docs/_build/html

This works, until I use a different symlink prefix (https://bazel.build/reference/command-line-reference#build-flag--symlink_prefix). With a different symlink prefix, the served directory bazel-out does not exist which leads to a 404 error.

🌍 Your Environment

Operating System:

  
      Ubuntu 24.04.3 LTS
  

Output of bazel version:

  
    bazel 8.4.2
  

Rules_python version:

  
    1.6.3
  

Metadata

Metadata

Assignees

No one assigned

    Labels

    sphinxdocsIssues relating to the sphinxdocs code

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions