haskell / haskell/cabal

Support addDependentDirectory

Open
#11,089 0 comments 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

https://gitlab.haskell.org/ghc/ghc/-/merge_requests/14473 is adding a new `addDependentDirectory` method to TemplateHaskell. This is analagous to the `addDependentFile` method that TemplateHaskell already has.

The recompilation support for that is tracked here: https://github.com/haskell/cabal/issues/4746

In short, GHC currently doesn't expose an appropriate interface to tell cabal-install about which files are tracked by TH. There is a workaround though. If we add the files to `extra-source-files`, then cabal-install will recompile when they change.

I have done some testing and the same workaround will not work for `addDependentDirectory`. It seems that even if I specify wildcards in `extra-source-files`, cabal-install will not recompile if new files are matched by the wildcard or old matches are removed.

I am proposing that if `extra-source-files` includes a wildcard, then we should recompile if the set of matches changes.

Contributor guide

Open the contributing guide

Research direction

Start by tracing cabal-install's handling of extra-source-files wildcards and its recompilation checks, then compare that behavior with the existing addDependentFile workaround. Done means changes to the wildcard match set, including added or removed files, trigger recompilation for addDependentDirectory use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.