diff --git a/cuda_bindings_13/docs/build_docs.sh b/cuda_bindings_13/docs/build_docs.sh index 199ababce60..3a536cb5f9a 100755 --- a/cuda_bindings_13/docs/build_docs.sh +++ b/cuda_bindings_13/docs/build_docs.sh @@ -51,6 +51,13 @@ cp source/_templates/main.html build/html/index.html # ensure that the latest docs is the one we built if [[ $LATEST_ONLY == "0" ]]; then + # Refuse to publish a versioned subdir for pre-release or local + # versions, which otherwise leak orphan trees onto gh-pages that + # are not reachable via nv-versions.json. See #3231. + if [[ "${SPHINX_CUDA_BINDINGS_VER}" == *.dev* || "${SPHINX_CUDA_BINDINGS_VER}" == *+* ]]; then + echo "refusing to publish versioned docs for pre-release version '${SPHINX_CUDA_BINDINGS_VER}'" >&2 + exit 1 + fi cp -r build/html/${SPHINX_CUDA_BINDINGS_VER} build/html/latest else mv build/html/${SPHINX_CUDA_BINDINGS_VER} build/html/latest diff --git a/cuda_core/docs/build_docs.sh b/cuda_core/docs/build_docs.sh index 28ae6dd07fd..0c4a67bf1f0 100755 --- a/cuda_core/docs/build_docs.sh +++ b/cuda_core/docs/build_docs.sh @@ -46,6 +46,13 @@ cp source/_templates/main.html build/html/index.html # ensure that the latest docs is the one we built if [[ $LATEST_ONLY == "0" ]]; then + # Refuse to publish a versioned subdir for pre-release or local + # versions, which otherwise leak orphan trees onto gh-pages that + # are not reachable via nv-versions.json. See #3231. + if [[ "${SPHINX_CUDA_CORE_VER}" == *.dev* || "${SPHINX_CUDA_CORE_VER}" == *+* ]]; then + echo "refusing to publish versioned docs for pre-release version '${SPHINX_CUDA_CORE_VER}'" >&2 + exit 1 + fi cp -r build/html/${SPHINX_CUDA_CORE_VER} build/html/latest else mv build/html/${SPHINX_CUDA_CORE_VER} build/html/latest diff --git a/cuda_pathfinder/docs/build_docs.sh b/cuda_pathfinder/docs/build_docs.sh index 4720cd458f6..70385913e31 100755 --- a/cuda_pathfinder/docs/build_docs.sh +++ b/cuda_pathfinder/docs/build_docs.sh @@ -50,6 +50,13 @@ cp source/_templates/main.html build/html/index.html # ensure that the latest docs is the one we built if [[ $LATEST_ONLY == "0" ]]; then + # Refuse to publish a versioned subdir for pre-release or local + # versions, which otherwise leak orphan trees onto gh-pages that + # are not reachable via nv-versions.json. See #3231. + if [[ "${SPHINX_CUDA_PATHFINDER_VER}" == *.dev* || "${SPHINX_CUDA_PATHFINDER_VER}" == *+* ]]; then + echo "refusing to publish versioned docs for pre-release version '${SPHINX_CUDA_PATHFINDER_VER}'" >&2 + exit 1 + fi cp -r build/html/${SPHINX_CUDA_PATHFINDER_VER} build/html/latest else mv build/html/${SPHINX_CUDA_PATHFINDER_VER} build/html/latest