Support `OsString`
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 42/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- haskell
- Domaine
- operating-systems
Piste de recherche
Commencez par examiner la documentation de System.OsPath et les API de migration filepath, unix et Win32 référencées, puis suivez la manière dont process gère les chemins sur chaque plateforme. Le travail est terminé lorsque process prend en charge OsString de manière cohérente sur toutes les plateformes prises en charge, après la mise à jour et la synchronisation de ces dépendances.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Haskell
- Étoiles
- 91
- Forks
- 93
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de haskell/process
-
bug
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
-
HAVE_PIPE2 at compile time but not at runtime causes segfault on macOSPeut-être pris @alt-romes l’a pris il y a 3 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
-
posix_spawn falls back to fork() when create_group = True due to HAVE_DECL_ macro mismatchPeut-être pris @lei-jia-xing l’a pris il y a 11 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 57/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
Toutes les issues de haskell/process
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
haskell/bytestring#730 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
seal-harness/seal-harness#399 ·
Les mainteneurs répondent en général sous 1 jour
-
add previously overlooked rulesOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
fmidue/codeworld-tasks#124 ·
-
allow haskell-src-exts-1.24Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
reflex-frp/reflex#563 ·