Support `OsString`
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 42/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- haskell
- Domínio
- operating-systems
Direção de pesquisa
Comece revisando a documentação de System.OsPath e as APIs de migração filepath, unix e Win32 referenciadas; em seguida, acompanhe como process trata caminhos em cada plataforma. Considera-se concluído quando process oferecer suporte consistente a OsString em todas as plataformas compatíveis, depois que essas dependências forem atualizadas e sincronizadas.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Haskell
- Estrelas
- 91
- Forks
- 93
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de haskell/process
-
bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
-
HAVE_PIPE2 at compile time but not at runtime causes segfault on macOSTalvez já em andamento @alt-romes assumiu há 3 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
-
posix_spawn falls back to fork() when create_group = True due to HAVE_DECL_ macro mismatchTalvez já em andamento @lei-jia-xing assumiu há 11 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 57/100
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
Todas as issues de haskell/process
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
haskell/bytestring#730 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
seal-harness/seal-harness#399 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
fmidue/codeworld-tasks#124 ·
-
allow haskell-src-exts-1.24Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
reflex-frp/reflex#563 ·