`template-haskell-depends`
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- haskell
- Domain
- build-system
Research direction
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.
Written by the indexing model from the issue text.
Description
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:
- https://github.com/haskell/cabal/issues/2965#issuecomment-607282235 ("And if template haskell step would ever be separated, then a separate package db & dependencies for that too.")
- https://github.com/haskell/cabal/pull/4104#issuecomment-266838873 ("host-only" dependencies)
- https://ghc-proposals.readthedocs.io/en/latest/proposals/0682-explicit-level-imports.html ("Ultimately, it would make sense to expose this distinction at the level of Cabal packages, so that Cabal could build package dependencies only for the stages at which they are required. This would primarily be of value in cross-compilation scenarios.")
- Dominant language
- Haskell
- Stars
- 1.8k
- Forks
- 766
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 27
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/cabal
-
needs triage type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
haskell/cabal#12568 · 1 comment ·
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
haskell/cabal#12525 · 3 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
Required version of `cabal-install` to build CabalPossibly taken @philderbeast claimed this 24 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
haskell/cabal#12477 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
Document which are our LTS releasesPossibly taken @KeuqS claimed this 41 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
haskell/cabal#12373 · 2 comments ·
Maintainers usually reply within 3 days
Similar issues
-
bug desktop
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
simplex-chat/simplex-chat#8291 ·
Maintainers usually reply within 1 day
-
[BUG]: C# programs with top-level statements fail to compilePossibly taken @AsyncNigam claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
compiler-explorer/compiler-explorer#9625 · 1 comment ·
Maintainers usually reply within 1 day
-
reflex-0.10Open
Difficulty 1/5 Under an hour Newbie friendliness 62/100
commercialhaskell/stackage#8180 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenZeppelin/canton-contracts#140 ·
Maintainers usually reply within 1 day
-
takeInterval yields nothing, dropInterval drops nothingPossibly taken @GuillaumedeVolpiano claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
composewell/streamly#3271 ·