From: Michal Gorny Date: Thu, 30 Nov 2017 19:09:22 +0000 (+0000) Subject: [cmake] Include project name in Sphinx doctree dir to fix race conditions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=14540ca766d421bd46b55757c1c92c48a5ad22b6;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319461 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake index 4540c5c36c8..22e3dcb776a 100644 --- a/cmake/modules/AddSphinxTarget.cmake +++ b/cmake/modules/AddSphinxTarget.cmake @@ -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)