Support `OsString`
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- haskell
- Área
- operating-systems
Línea de trabajo
Comienza revisando la documentación de System.OsPath y las API de migración filepath, unix y Win32 referenciadas; después, sigue cómo process gestiona las rutas en cada plataforma. Se considera terminado cuando process admite OsString de forma coherente en todas las plataformas compatibles, una vez que esas dependencias se hayan actualizado y estén sincronizadas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Motivation
The next filepath release will add support for a new API, which fixes subtle encoding issues and improves cross platform code and memory residence.
You can read about the state of the newly added API here: https://github.com/haskellfoundation/tech-proposals/issues/35
Release is here: https://hackage.haskell.org/package/filepath-1.4.100.0
Demonstration about unsoundness of base with exotic encodings and how the new API fixes them is here: https://gist.github.com/hasufell/c600d318bdbe010a7841cc351c835f92
Migrations
Migrations can happen once the filepath, unix and Win32 packages are updated and in sync. A migration would usually involve using the new types from System.OsPath and the new API variants from unix/Win32.
When writing low-level cross platform code manually (shouldn't generally be necessary), the usual strategy is this:
#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
import qualified System.OsPath.Data.ByteString.Short.Word16 as SBS
import qualified System.OsPath.Windows as PFP
#else
import qualified System.OsPath.Data.ByteString.Short as SBS
import qualified System.OsPath.Posix as PFP
#endif
crossPlatformFunction :: OsPath -> IO ()
#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
crossPlatformFunction (OsString pfp@(WS ba)) = do
-- use filepath functions for windows specific operating system strings
let ext = PFP.takeExtension pfp
-- operate directly on the underlying bytestring (which is a wide character bytestring, so uses Word16)
let foo = SBS.takeWhile
...
#else
crossPlatformFunction (OsString pfp@(PS ba)) = do
-- use filepath functions for posix specific operating system strings
let ext = PFP.takeExtension pfp
-- operate directly on the underlying bytestring (which is just Word8 bytestring)
let foo = SBS.takeWhile
...
#endif
Platform specific code can be written using PosixPath/WindowsPath types.
If you have further questions, please let me know. I'm going to write a blog post outlining the affairs and more in-depth intro and migration strategies close after the release. This is a heads up.
- Lenguaje dominante
- Haskell
- Estrellas
- 91
- Forks
- 93
- Métricas de merge de PR
- Sin PR fusionados en 30 d
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de haskell/process
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
HAVE_PIPE2 at compile time but not at runtime causes segfault on macOSPosiblemente ocupada @alt-romes la tomó hace 3 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
posix_spawn falls back to fork() when create_group = True due to HAVE_DECL_ macro mismatchPosiblemente ocupada @lei-jia-xing la tomó hace 11 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Todos los issues de haskell/process
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
haskell/bytestring#730 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
seal-harness/seal-harness#399 ·
Los mantenedores suelen responder en 1 día
-
add previously overlooked rulesAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
fmidue/codeworld-tasks#124 ·
-
allow haskell-src-exts-1.24Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
reflex-frp/reflex#563 ·