Skip to content

WIP ci: fix the Windows "Install GMT" step in tests.yml and docs.yml - #9134

Open
Esteban82 wants to merge 3 commits into
masterfrom
fix-windows-install-ci
Open

WIP ci: fix the Windows "Install GMT" step in tests.yml and docs.yml#9134
Esteban82 wants to merge 3 commits into
masterfrom
fix-windows-install-ci

Conversation

@Esteban82

Copy link
Copy Markdown
Member

This PR fixes the Windows build problem in tests.yml and docs.yml.

It applies the same fix already merged for build.yml in #9097: the install moves into the cmd step that sources vcvars64.bat, and the Unix install step is guarded with if: runner.os != 'Windows'.

Assisted-by: Claude Opus 5 (extra effort)

PR #9097 fixed the Windows install step in build.yml but the same fix was
never applied to tests.yml and docs.yml, so the Windows jobs of both
workflows have been failing at "Install GMT" ever since.

The step ran `cmake --build . --target install` with the default
`bash -el {0}` shell and no OS guard, so on Windows it executed outside
the MSVC environment set up by vcvars64.bat. It also inherited INSTALLDIR
with backslashes, which CMake treats as escape sequences.

Consequences on Windows:

- tests.yml: "Run full tests" and "Run DOS batch examples" were reported
  as `skipped` in every recent run, i.e. the Windows test suite has not
  been executed at all while still reporting a red job.
- docs.yml: the Windows job failed before packaging.

Apply the same fix as build.yml: move the install into the existing `cmd`
step that already sets up vcvars64 (normalising INSTALLDIR and the vcpkg
root along the way), and guard the Unix install step with
`if: runner.os != 'Windows'`. The Windows step bodies are now identical
across build.yml, tests.yml and docs.yml.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Esteban82
Esteban82 requested review from joa-quim and seisman August 21, 2026 18:29
@Esteban82 Esteban82 added the AI-assisted All (or most) of the code was written by Artificial Intelligence. label Aug 21, 2026
@Esteban82 Esteban82 changed the title ci: fix the Windows "Install GMT" step in tests.yml and docs.yml WIP ci: fix the Windows "Install GMT" step in tests.yml and docs.yml Aug 21, 2026
Esteban82 and others added 2 commits August 21, 2026 22:55
With the Windows install step fixed, the Windows job now reaches
"Check a few simple commands" for the first time and crashes immediately on
the bare `gmt` call:

    + gmt
    *** stack smashing detected ***: terminated

The cause is the shell, not GMT. The workflow default is `bash -el {0}`, and
the login shell sources Git Bash's /etc/profile, which puts /usr/bin and
/mingw64/bin ahead of the vcpkg directories in PATH. gmt.exe then resolves its
netCDF/GDAL/curl DLLs to the MSYS2/MinGW copies instead of the vcpkg ones it
was linked against, and the ABI mismatch corrupts the stack.

build.yml runs the same script against the same binary with
`shell: bash` (i.e. `--noprofile --norc`) and passes, printing the splash
screen normally.

Split the step so Windows uses the same non-login shell as build.yml while
Linux and macOS keep the login shell they need for conda. Doing this per-OS
rather than globally is deliberate: macOS currently passes this step in
tests.yml, and build.yml's macOS job -- which does use `shell: bash` for it --
fails later in `gmt end` with `gmtinit_process_figures returned error 79`, so
that shell is not safe to adopt for every platform here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The previous commit's theory was wrong: giving Windows the same non-login
`shell: bash` and `export PATH` that build.yml uses did not help, and gmt.exe
still dies on the bare `gmt` call:

    + gmt
    *** stack smashing detected ***: terminated

So the crash is not caused by the login shell. What does work, and is proven
green in build.yml, is running the checks from cmd via
ci/simple-gmt-tests.bat: the same binary prints its splash screen normally
there.

Restrict the bash check to Linux/macOS and let Windows use the cmd script
alone. This also removes a genuine duplication: until now Windows ran the
simple checks twice, once through simple-gmt-tests.sh and once through
simple-gmt-tests.bat.

`where gmt` is added to the cmd step so the log records which gmt.exe is
picked up, which is the first thing needed if this ever regresses.

If the cmd script also crashes, the problem is in the binary itself rather
than in the shell environment -- the Windows test build differs from the
build.yml one only by SUPPORT_EXEC_IN_BINARY_DIR and the DO_* test flags --
and it will need a fix in the C code rather than in CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-assisted All (or most) of the code was written by Artificial Intelligence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant