From daa36668e7a15acfe373eca2f264dafc3d4062e2 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Thu, 11 Feb 2021 22:14:59 -0500 Subject: [PATCH] [SCons] Fix Sphinx docs build in parallel The Sphinx build requires both the Cython module to have been built and the doxygen run to have finished. When running the build in parallel with scons build -j#, there was the possibility that Sphinx could run before all its dependencies were built. This change adds dependencies for the Sphinx builder on Doxygen and the Cython module, resolving the problem. --- .github/workflows/main.yml | 2 +- doc/SConscript | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f029027b3..ca514b162 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -141,7 +141,7 @@ jobs: python3 -m pip install ruamel.yaml scons numpy cython sphinx\<4.0 \ sphinxcontrib-katex sphinxcontrib-matlabdomain sphinxcontrib-doxylink - name: Build Cantera with documentation - run: python3 `which scons` build doxygen_docs=y sphinx_docs=y + run: python3 `which scons` build -j2 doxygen_docs=y sphinx_docs=y # The known_hosts key is generated with `ssh-keygen -F cantera.org` from a # machine that has previously logged in to cantera.org and trusts # that it logged in to the right machine diff --git a/doc/SConscript b/doc/SConscript index 1587dee48..f513d1790 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -112,6 +112,7 @@ if localenv['sphinx_docs']: 'sphinx/conf.py', '${sphinx_cmd} -b html -d ${SPHINXBUILD}/doctrees ${SPHINXSRC} ${SPHINXBUILD}/html')) env.Alias('sphinx', sphinxdocs) + env.Depends(sphinxdocs, env['python_module']) # Create a list of MATLAB classes to document. This uses the NamedTuple # structure defined at the top of the file. The @Data and @Utilities @@ -206,5 +207,7 @@ if localenv['sphinx_docs']: localenv.Depends(sphinxdocs, c) localenv.AlwaysBuild(sphinxdocs) + if localenv['doxygen_docs']: + localenv.Depends(sphinxdocs, docs) install(localenv.RecursiveInstall, '$inst_docdir/sphinx/html', '#/build/docs/sphinx/html')