Skip to content

fix(sphinx): recursive dir copy - #4231

Merged
rickeylev merged 1 commit into
bazel-contrib:mainfrom
oxidase:fix/recursive-copy
Oct 7, 2026
Merged

rickeylev merged 1 commit into
bazel-contrib:mainfrom
oxidase:fix/recursive-copy

Conversation

@oxidase

@oxidase oxidase commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

The fix prevents recursive directories copy if srcdir = pathlib.Path(args[1]) at https://github.com/bazel-contrib/rules_python/blob/278664d7/sphinxdocs/sphinxdocs/private/sphinx_build.py#L555 is '.'. which results to

   raise DirectorySyncerError(list(self._errors))
DirectorySyncerError: Encountered 1 error(s) during sync:
  - [Errno 36] File name too long: '.worker-in.d/.worker-in.d/.worker-in.d/.worker-in.d/<repeated many times>

@rickeylev

Copy link
Copy Markdown
Collaborator

How does . end up being passed as the source directory to copy?

@oxidase

oxidase commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

this is my local rule which uses sphinx and doxygen.

What it looks simplified like

    args = ctx.actions.args()  

    args.add(source_prefix) # here it can be "."
    args.add(output_dir.path)
    
    ctx.actions.run(
        executable = ctx.executable._sphinx,
        arguments = [args],
...

where ctx.executable._sphinx is sphinx_build_binary from @sphinxdocs//sphinxdocs:sphinx.bzl and the target is defined in the directory where conf.py is located.

@rickeylev
rickeylev added this pull request to the merge queue Oct 7, 2026
Merged via the queue into bazel-contrib:main with commit 151e441 Oct 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants