Supporting WinIO in the same shape as POSIX (network 4.0)

Abierto
#642 1 comentario 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
12/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c, haskell
Área
ci-cd, networking

Línea de trabajo

This is a tracking issue for the network 4.0 WinIO plan, not a single self-contained change. Read the linked plan issues (#557, #602) and the checklist: nearly every item is complete, and the only unchecked item is Windows CI on GHC 9.14.2 once released. Done means the Windows CI matrix builds with WinIO on that GHC and the cabal guard still selects v3.2 where __IO_MANAGER_WINIO__ is below 2.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

This continues #602 as the plan for network 4.0 (#557): on Windows, support WinIO only, and in the same shape as POSIX.

Decisions
  • WinIO only. Windows means WinIO (+RTS --io-manager=native) from 4.0. The I/O manager is chosen by the executable's RTS options, so a library cannot pick it; keeping No IO Manager and WinIO side by side (<!> throughout, Network.Socket.Win32.Cancel, cbits/overlapped.c, cbits/asyncAccept.c) is most of the cost of Windows. v3.2 remains the line for No IO Manager and for older GHCs.
  • GHC with __IO_MANAGER_WINIO__ >= 2: 9.12.5 or later in 9.12, 9.14.2 or later.
  • Readiness through IOCTL_AFD_POLL. Completion ports alone report that an operation finished, not that one could be started, but the AFD driver beneath Winsock does report readiness, read and write alike. The ioctl is undocumented but long stable, and libuv (uv_poll), wepoll and mio rely on it. Issued overlapped on the socket, it completes on the I/O manager's port. We rely on it.
  • FILE_SKIP_COMPLETION_PORT_ON_SUCCESS on every socket (#639), so that an operation or poll which finishes at once leaves no packet behind (#638).
  • Sockets behind a non-IFS Layered Service Provider are not supported. Such LSPs return handles which are not AFD files, so neither the flag nor the poll works on them; they have been deprecated since Windows 8.
Plan
  • Basic WinIO support (#612, #626)
  • No stray completion packets (#639)
  • Readiness: waitReadSocketSTM, waitWriteSocketSTM and their waitAndCancel versions through IOCTL_AFD_POLL (#641)
  • The give-up API (withReadable, withWritable, acceptWith, recvWith and so on) built from readiness as on POSIX, instead of running the operation in a thread of its own and cancelling it with CancelIoEx (#643, which also makes WinIO sockets non-blocking)
  • Removing the No IO Manager code (#644): Network.Socket.Win32.Cancel, cbits/overlapped.c, cbits/asyncAccept.c, the No IO Manager side of every <!>, and the readRawBufferPtr/writeRawBufferPtr paths
  • A clear error when a program starts with No IO Manager on Windows (#644), saying that --io-manager=native is needed
  • buildable: False on Windows with a GHC whose __IO_MANAGER_WINIO__ is below 2, so that the solver picks v3.2 there (#644)
  • Windows CI on GHC 9.14.2 once it is released (9.4 and 9.14.1 compile WinIO out)
  • Documentation and README: WinIO is required on Windows; non-IFS LSPs are not supported (#641, #644)
Lenguaje dominante
Haskell
Estrellas
371
Forks
211
Merge medio
12 h 42 min
PR fusionados (30 d)
26

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de haskell/network

Todos los issues de haskell/network

Issues similares

Más issues de Haskell

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.