`template-haskell-depends`

Abierto
#12,583 8 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
haskell
Área
build-system

Línea de trabajo

Start by identifying where Cabal defines, parses, and uses dependency fields such as build-depends, then trace how those fields are merged for builds. The feature is done when a template-haskell-depends field is supported and, as described here, its dependencies are merged with build-depends.

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

Descripción

type: enhancement

Describe the feature request
There has long been a somewhat folkloric desire to separate out the dependencies which are needed for Template Haskell from those which are compiled and linked against.

Some people have suggested having a field like native-build-depends, but I think there is more appetite for something that is more semantically named, leaving us with some flexibility in exactly how it's used (c.f. plugin-depends).

So I suggest that we add a field template-haskell-depends for dependencies that are needed only for Template Haskell splice code. Many packages would appear in both, if they e.g. provide a splice that generates code containing identifiers from the library, in which case we also need to link against it. But some could be pure splice code.

For now, cabal would have to just merge this with build-depends since I don't think that GHC currently provides a way to take advantage of the additional information.

Additional context

I am working on buck2 support for cabal. Knowing which packages are used in TH is quite helpful, as we need to wait for their shared libraries to be built before we can proceed. At the moment we are probably going to let users specify which of their build dependencies are TH dependencies with a cabal x- extension field, but it would be nice to have a real field!

Other misc benefits:

  • A TH-only dependency doesn't have to be built with profiling support (since it won't be run at runtime)
  • In principle we could solve for TH-only dependencies separately, since they're not linked in

Non-exhaustive list of previous mentions:

Lenguaje dominante
Haskell
Estrellas
1.8k
Forks
766
Merge medio
5 d 21 h
PR fusionados (30 d)
27

Preparar el entorno

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/cabal

Todos los issues de haskell/cabal

Issues similares

Más issues de Haskell

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.