Skip to content

Make the package build for native Windows - #139

Merged
fingolfin merged 3 commits into
masterfrom
mh/mingw
Sep 12, 2026
Merged

fingolfin merged 3 commits into
masterfrom
mh/mingw

Conversation

@fingolfin

Copy link
Copy Markdown
Member

On mingw the package failed to compile, so it was unavailable together with everything depending on it. Guard what native Windows lacks and use its equivalent where there is one:

  • child processes need SIGCHLD and waitpid; the new IO_HAVE_SIGCHLD covers the bookkeeping, the handlers and IO_WaitPid
  • IO_realpath uses _fullpath, IO_mkdir uses _mkdir (which has no mode argument), IO_setenv and IO_unsetenv use _putenv_s
  • IO_pipe and IO_fcntl are guarded by new configure checks, as is st_blksize and st_blocks in the record IO_stat returns
  • environ is spelled _environ

38 of the 72 functions remain, enough for files, directories, streams and pickling. Sockets are absent for now; they need Winsock.

Co-Authored-By: Claude Opus 5 [email protected]

fingolfin and others added 3 commits September 12, 2026 08:12
On mingw the package failed to compile, so it was unavailable together
with everything depending on it. Guard what native Windows lacks and
use its equivalent where there is one:

- child processes need SIGCHLD and waitpid; the new IO_HAVE_SIGCHLD
  covers the bookkeeping, the handlers and IO_WaitPid
- IO_realpath uses _fullpath, IO_mkdir uses _mkdir (which has no mode
  argument), IO_setenv and IO_unsetenv use _putenv_s
- IO_pipe and IO_fcntl are guarded by new configure checks, as is
  st_blksize and st_blocks in the record IO_stat returns
- environ is spelled _environ

38 of the 72 functions remain, enough for files, directories, streams
and pickling. Sockets are absent for now; they need Winsock.

Co-Authored-By: Claude Opus 5 <[email protected]>
The C part registers 56 of its functions only when configure finds the
system call behind them, so on native Windows about half are absent.
Reading the GAP code then warns about unbound globals, which also lands
in the output of packages testing against it, and calling one fails
with a message that says nothing about why.

Bind whichever are missing to a function reporting that, before any
code mentioning them is read. On a platform providing all of them, as
POSIX does, nothing is bound and nothing changes.

Co-Authored-By: Claude Opus 5 <[email protected]>
The condition also tested defined(SIGCHLD), at a point before
<signal.h> is included. Whether SIGCHLD is visible there differs
between platforms: on macOS another header happens to provide it, on
Linux nothing does, so the child process handling was compiled out and
IO_WaitPid and IO_IgnorePid became unavailable.

Co-Authored-By: Claude Opus 5 <[email protected]>
@fingolfin
fingolfin merged commit ea35672 into master Sep 12, 2026
9 checks passed
@fingolfin
fingolfin deleted the mh/mingw branch September 12, 2026 23:29
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.

1 participant