From aa59acfdd2e3b42c43cc3fb08eb8fc94390b95f5 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 4 Jun 2026 15:38:18 +0800 Subject: [PATCH 1/3] ci: allow Windows make segfaults --- .github/workflows/ci_docs.yml | 24 ++++++++++++++++++++---- .github/workflows/ci_tests.yaml | 10 +++++++++- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index 4080b6bea1d..3a11b1b378a 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -53,8 +53,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] - # os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] # Is it a draft Pull Request (true or false)? isDraft: - ${{ github.event.pull_request.draft }} @@ -136,10 +135,27 @@ jobs: python -m pip install dist/* - name: Build the HTML documentation - run: make -C doc clean html + run: | + log_file="${RUNNER_TEMP}/sphinx-html.log" + make -C doc clean html 2>&1 | tee "${log_file}" + exit_code=${PIPESTATUS[0]} + if [[ "${RUNNER_OS}" == "Windows" && "${exit_code}" -eq 2 ]] && grep -q "make: .* Error 2816" "${log_file}"; then + echo "Sphinx HTML build exited with make error 2816 (segmentation fault) on Windows; allowing workflow to continue." + exit 0 + fi + exit "${exit_code}" - name: Build the PDF documentation - run: make -C doc pdf + run: | + log_file="${RUNNER_TEMP}/sphinx-latex.log" + make -C doc latex 2>&1 | tee "${log_file}" + exit_code=${PIPESTATUS[0]} + if [[ "${RUNNER_OS}" == "Windows" && "${exit_code}" -eq 2 ]] && grep -q "make: .* Error 2816" "${log_file}"; then + echo "Sphinx LaTeX build exited with make error 2816 (segmentation fault) on Windows; continuing to PDF compilation." + elif [[ "${exit_code}" -ne 0 ]]; then + exit "${exit_code}" + fi + tectonic -X compile doc/_build/latex/pygmt.tex - name: Create the HTML ZIP archive and rename the PDF file run: | diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 0a456fc6ae2..504d7f51c39 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -189,7 +189,15 @@ jobs: # Run the regular tests - name: Run tests - run: make test PYTEST_EXTRA="-r P --reruns 2" + run: | + log_file="${RUNNER_TEMP}/pytest.log" + make test PYTEST_EXTRA="-r P --reruns 2" 2>&1 | tee "${log_file}" + exit_code=${PIPESTATUS[0]} + if [[ "${RUNNER_OS}" == "Windows" && "${exit_code}" -eq 2 ]] && grep -q "make: .* Error 2816" "${log_file}"; then + echo "Tests exited with make error 2816 (segmentation fault) on Windows; allowing workflow to continue." + exit 0 + fi + exit "${exit_code}" # Upload diff images on test failure - name: Upload diff images if any test fails From 0bc9998404ecd1e1067c80de93e5d0b708eeb527 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 4 Jun 2026 18:01:33 +0800 Subject: [PATCH 2/3] Apply suggestion from @seisman --- .github/workflows/ci_docs.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index 3a11b1b378a..287df2ff6ab 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -151,11 +151,8 @@ jobs: make -C doc latex 2>&1 | tee "${log_file}" exit_code=${PIPESTATUS[0]} if [[ "${RUNNER_OS}" == "Windows" && "${exit_code}" -eq 2 ]] && grep -q "make: .* Error 2816" "${log_file}"; then - echo "Sphinx LaTeX build exited with make error 2816 (segmentation fault) on Windows; continuing to PDF compilation." - elif [[ "${exit_code}" -ne 0 ]]; then - exit "${exit_code}" + echo "Sphinx LaTeX build exited with make error 2816 (segmentation fault) on Windows; allowing workflow to continue." fi - tectonic -X compile doc/_build/latex/pygmt.tex - name: Create the HTML ZIP archive and rename the PDF file run: | From 3ef7cde7093ef1195706a9131cd4e9a121380429 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 4 Jun 2026 18:02:05 +0800 Subject: [PATCH 3/3] Apply suggestion from @seisman --- .github/workflows/ci_docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index 287df2ff6ab..baf28850e06 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -152,6 +152,7 @@ jobs: exit_code=${PIPESTATUS[0]} if [[ "${RUNNER_OS}" == "Windows" && "${exit_code}" -eq 2 ]] && grep -q "make: .* Error 2816" "${log_file}"; then echo "Sphinx LaTeX build exited with make error 2816 (segmentation fault) on Windows; allowing workflow to continue." + exit 0 fi - name: Create the HTML ZIP archive and rename the PDF file