[PATCH] D40656: [cmake] Include project name in Sphinx doctree dir to fix race conditions

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 09:27:47 PST 2017


mgorny created this revision.

Modify add_sphinx_target() to include the project name alongside builder
in Sphinx doctree directory. This aims to avoid crashes due to race
conditions between multiple Sphinx instances running in parallel that
attempt to create or read that directory simultaneously.

This problem has originally been addressed in https://reviews.llvm.org/rL283188. However, that
commit presumed that there will be only one target per builder being
run. However, https://reviews.llvm.org/rL314863 introduced a second manpage target, reintroducing
the race condition.
-


Repository:
  rL LLVM

https://reviews.llvm.org/D40656

Files:
  cmake/modules/AddSphinxTarget.cmake


Index: cmake/modules/AddSphinxTarget.cmake
===================================================================
--- cmake/modules/AddSphinxTarget.cmake
+++ cmake/modules/AddSphinxTarget.cmake
@@ -19,7 +19,7 @@
 # ``project`` should be the project name
 function (add_sphinx_target builder project)
   set(SPHINX_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/${builder}")
-  set(SPHINX_DOC_TREE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees-${builder}")
+  set(SPHINX_DOC_TREE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees-${project}-${builder}")
   set(SPHINX_TARGET_NAME docs-${project}-${builder})
 
   if (SPHINX_WARNINGS_AS_ERRORS)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40656.124956.patch
Type: text/x-patch
Size: 622 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171130/19b65c39/attachment.bin>


More information about the llvm-commits mailing list