Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ END_UNRELEASED_TEMPLATE
* (gazelle) Fix `gazelle_python_manifest.test` so that it accesses manifest files via `runfile` path handling rather than directly ([#3397](https://github.com/bazel-contrib/rules_python/issues/3397)).
* (core rules) For the system_python bootstrap, the runfiles root is added to
sys.path.
* (sphinxdocs) The sphinxdocs `.serve` target is now compatible with Bazel's `--symlink_prefix`
flag ([#3410](https://github.com/bazel-contrib/rules_python/issues/3410)).

{#v1-8-0-added}
### Added
Expand Down
3 changes: 2 additions & 1 deletion sphinxdocs/private/sphinx.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ def sphinx_docs(
srcs = [_SPHINX_SERVE_MAIN_SRC],
main = _SPHINX_SERVE_MAIN_SRC,
data = [html_name],
deps = [Label("//python/runfiles")],
args = [
"$(execpath {})".format(html_name),
"$(rlocationpath {})".format(html_name),
],
**common_kwargs_with_manual_tag
)
Expand Down
7 changes: 4 additions & 3 deletions sphinxdocs/private/sphinx_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import time
from http import server

from python.runfiles import Runfiles


def main(argv):
build_workspace_directory = os.environ["BUILD_WORKSPACE_DIRECTORY"]
docs_directory = argv[1]
serve_directory = os.path.join(build_workspace_directory, docs_directory)
r = Runfiles.Create()
serve_directory = r.Rlocation(argv[1])

class DirectoryHandler(server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
Expand Down