Refactoring proposal : yet another move towards cabal
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- haskell
- Área
- build-system
Línea de trabajo
Empieza comparando src/Stack/Types/DumpPackage.hs y src/Stack/Types/GhcPkgId.hs con los tipos de Cabal referenciados InstalledPackageInfo, ComponentId y UnqualComponentName. Revisa los cuatro cambios de representación propuestos y sus implicaciones para Backpack. Se considerará terminado cuando exista una dirección acordada para el RFC y se hayan refactorizado de forma coordinada los tipos duplicados, el análisis sintáctico y las representaciones de component-name.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
So, while working on backpack related processing, I realized that there are many things that stack duplicate in very slightly different ways from cabal, with no obvious benefit and pretty obvious downsides (such as conversion costs). I've come to a point where I either have to duplicate yet another huge chunk of backpack related logic into Stack because the types differ, or I can try to refactor current duplicates from Stack which make no sense. This would benefit Stack by reducing the amount of conversion and parsing logic done on stack's side (but some conversation will still be needed at places but I'd expect far less than the current state of things). This should also reduce the amount of code in stack at the cost of slightly hampered flexibility and maintenance burden for the imported logic.
This issue is a request for comment for the following refactorings (That I would do if I'm allowed):
- The entire DumpPackage type and parsing logic is a duplicate of the InstalledPackageInfo in cabal. The parsing function in cabal is expecting strict ByteString whereas the stack one operates on a stream of Text, but I'd expect the transition to be relatively smooth.
- The GhcPkgId is the mix of many different types in Cabal (but mostly, as of now in stack, it's the mirror of the ComponentId). This is a problem for Backpack because Backpack has a notion of OpenModule (that is component which lacks implementation of its signatures) and this notion is hard to represent correctly with current GhcPkgId type.
- StackUnqualComponentName should be a newtype over UnqualComponentName from cabal, there are little reasons for not having this and the current Text based version is less efficient than the cabal one.
- The NamedComponent from Stack should also use the StackUnqualComponentName as the underlying representation for better interop. A Text translating function can be implemented to limit the amount of refactoring needed.
That's it, for now, I believe this is a significant enough refactoring. It would really ease the process for Backpack support.
PS: Not that while Backpack requires component based builds and they incur a significant slowdown compared to package based builds (as explained in #6356), it shouldn't be a problem for now because we'd only enable component based build for backpack packages.
RFC @mpilgrem
- Lenguaje dominante
- Haskell
- Estrellas
- 4.1k
- Forks
- 857
- Merge medio
- 17 h 32 min
- PR fusionados (30 d)
- 5
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 commercialhaskell/stack
-
Build Stack against Cabal >= 3.18Posiblemente ocupada @mpilgrem la tomó hace 14 días. Abierto
commercialhaskell/stack#6976 · 1 asignado ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
commercialhaskell/stack#6954 ·
-
Support type-checking without compilingQuizá libre de nuevo @mpilgrem la tomó hace 135 días y no hay ningún pull request abierto. Abiertocomponent: build type: enhancement
commercialhaskell/stack#6951 · 3 reacciones · 1 asignado ·
-
Support semaphore-compat 2.0.0Quizá libre de nuevo @mpilgrem la tomó hace 158 días y no hay ningún pull request abierto. Abiertocomponent: build in progress type: enhancement
commercialhaskell/stack#6934 · 3 comentarios · 1 asignado ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
commercialhaskell/stack#6864 · 1 comentario ·
Todos los issues de commercialhaskell/stack
Issues similares
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
alunduil/network-arbitrary#293 ·
Los mantenedores suelen responder en 1 día
-
area:client bug priority-low
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
bug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 91/100
simplex-chat/simplex-chat#8372 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
compiler-explorer/compiler-explorer#9710 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
agda/agda#8965 · 1 comentario ·
Los mantenedores suelen responder en 1 día