Skip to content

fix: make sphinxdocs support directory inputs#2375

Merged
rickeylev merged 1 commit intobazel-contrib:mainfrom
rickeylev:sphinxdocs.dir.inputs
Nov 7, 2024
Merged

fix: make sphinxdocs support directory inputs#2375
rickeylev merged 1 commit intobazel-contrib:mainfrom
rickeylev:sphinxdocs.dir.inputs

Conversation

@rickeylev
Copy link
Copy Markdown
Collaborator

The logic to relocate files assumed that all the inputs were plain file artifacts. When
a directory artifact was used, then ctx.actions.symlink() would fail because it requires
the output artifact and input target artifact to be the same type of file (plain file or
directory).

To fix, use File.is_directory to detect if the input is a directory or file, then call
declare_file() or declare_directory() as appropriate. The later symlink() call is
then happy the two args match.

Fixes #2374

@rickeylev rickeylev requested a review from aignas as a code owner November 6, 2024 03:16
@rickeylev rickeylev added this pull request to the merge queue Nov 6, 2024
Merged via the queue into bazel-contrib:main with commit 2038975 Nov 7, 2024
@rickeylev rickeylev deleted the sphinxdocs.dir.inputs branch December 5, 2024 23:57
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.

Support directory sources in sphinx_docs_library

2 participants