Skip to content

ci: Windows cross-build job (Linux runner) - #449

Merged
csete merged 9 commits into
csete:masterfrom
nmaas87:windows-cross-ci
Nov 14, 2026
Merged

csete merged 9 commits into
csete:masterfrom
nmaas87:windows-cross-ci

Conversation

@nmaas87

@nmaas87 nmaas87 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Single commit, .github/workflows/ci.yml only: adds the windows-cross
job using the tooling from the base branch — ubuntu runner, distro
mingw-w64 + sysroot via tools/msys2-sysroot.py, standalone zip via
tools/cross-package.sh, uploaded as the gpredict-windows-x86_64-cross
artifact. No native-Windows job by design: the cross-build removes the
need for a Windows build server (native flow stays documented).

Warning: Code generated by qwen3.8-flash-next-iq3_s

…asestr

The existing guards used the macro WIN32, which GCC for MinGW only
predefines in GNU dialects, never in the strict ISO mode (-std=c11)
that configure enables. On Windows the code therefore took the POSIX
branch: arpa/inet.h, netdb.h, sys/socket.h were included (fatal),
timegm() was used instead of _mkgmtime, and the gmtime_r() shim plus
the winsock2 initialization were compiled out.

Switch all platform/socket guards to _WIN32, which the compiler
defines on every Windows target regardless of dialect. In
gtk-rig-ctrl.c and gtk-rot-ctrl.c, replace the glibc-only strcasestr()
with the existing portable helper gpredict_strcasestr()
(gpredict-utils.c), which the rest of the code already uses.

Warning: Code generated by qwen3.8-flash-next-iq3_s
WIN32 is not a reliable backend selector: mingw-w64's curl/curl.h
itself defines WIN32 on inclusion, so in a native MSYS2 build (which
links libcurl) the later '#ifdef WIN32' blocks in tle-update.c and
trsp-update.c silently switched to win32_fetch() from win32/, which
the autotools build neither includes nor compiles -> implicit
declaration, link failure.

Make the choice explicit: define HAVE_WIN32_FETCH from win32/Makefile
(the only build that compiles win32-fetch.c and skips libcurl) and
guard the fetch code with it. The autotools build now always uses
libcurl, on every platform.

Warning: Code generated by qwen3.8-flash-next-iq3_s
The rigctld/rotctld TCP clients in gtk-rig-ctrl.c/gtk-rot-ctrl.c call
socket/connect/send/... On Unix these live in libc; on MinGW they are
exported by ws2_32.dll, which was never linked -> undefined __imp_*
references at link time. AC_SEARCH_LIBS finds them in libc on Unix and
adds -lws2_32 only where needed.

Warning: Code generated by qwen3.8-flash-next-iq3_s
Step-by-step prereqs/build/install for MSYS2, the Win32 quirks the
build now handles, and the win32/README pointer.

Warning: Code generated by qwen3.8-flash-next-iq3_s
…runners

Warning: Code generated by qwen3.8-flash-next-iq3_s
…Windows hosts

Double-clicking the built gpredict.exe opened a console window
(PE CUI subsystem) and the file had no icon or version info.
win32/Makefile has always handled both (-mwindows + windres over
win32/gpredict.rc); do the same from the autotools build: on a
Windows host (mingw, msys, cygwin - note that autotools inside
MSYS2 reports the host as *-*-msys) link with -mwindows and compile
win32/gpredict.rc (icon + VERSIONINFO with the numeric VERSION)
with windres when available. The rc/ico/resource.h files themselves
are pre-existing. Quirk table row added to doc/BUILDING-WINDOWS.md.

Warning: Code generated by qwen3.8-flash-next-iq3_s
tools/msys2-sysroot.py assembles a Windows dependency sysroot from
MSYS2 repo packages (pacman DB -> per-package .pkg.tar.zst closure,
rewrites .pc prefixes). tools/cross-package.sh stages exe + DLL
closure (objdump BFS) + data in the compat.c layout into a
standalone tree. doc/BUILDING-WINDOWS.md section 5 documents the
flow; README points at both.

Warning: Code generated by qwen3.8-flash-next-iq3_s
libtoolize 2.4.7+ (Ubuntu 24.04) hard-errors during the
bootstrap with 'AC_CONFIG_MACRO_DIRS([m4]) conflicts with
ACLOCAL_AMFLAGS=-I m4' unless the canonical plural spelling is
used. No behavioural change on older toolchains.

Warning: Code generated by qwen3.8-flash-next-iq3_s
Adds the windows-cross job: ubuntu runner, distro mingw-w64 +
the MSYS2-repo sysroot from tools/msys2-sysroot.py, standalone
zip via tools/cross-package.sh, uploaded as the
gpredict-windows-x86_64-cross artifact. Deliberately no
native-Windows job: the Linux cross-build removes the need for
a Windows build server; the native MSYS2 flow (incl. local
packaging) is documented in doc/BUILDING-WINDOWS.md sections
1-3 and 5-7 on windows-build.

Warning: Code generated by qwen3.8-flash-next-iq3_s
@csete

csete commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Very nice, thanks! This was high on the wish list.

@csete
csete merged commit 94f9b78 into csete:master Nov 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants