[llvm] r319461 - [cmake] Include project name in Sphinx doctree dir to fix race conditions

Michal Gorny via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 11:09:22 PST 2017


Author: mgorny
Date: Thu Nov 30 11:09:22 2017
New Revision: 319461

URL: http://llvm.org/viewvc/llvm-project?rev=319461&view=rev
Log:
[cmake] Include project name in Sphinx doctree dir to fix race conditions

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 r283188. However, that
commit presumed that there will be only one target per builder being
run. However, r314863 introduced a second manpage target, reintroducing
the race condition.

Differential Revision: https://reviews.llvm.org/D40656

Modified:
    llvm/trunk/cmake/modules/AddSphinxTarget.cmake

Modified: llvm/trunk/cmake/modules/AddSphinxTarget.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddSphinxTarget.cmake?rev=319461&r1=319460&r2=319461&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddSphinxTarget.cmake (original)
+++ llvm/trunk/cmake/modules/AddSphinxTarget.cmake Thu Nov 30 11:09:22 2017
@@ -19,7 +19,7 @@ endif()
 # ``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)




More information about the llvm-commits mailing list