More accurate package dependencies
|Reported by:||simonmar||Owned by:||niteria|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||#3560, #8174||Differential Revisions:||Phab:D973|
Description (last modified by simonmar)
The problem we want to solve here is that there is currently no distinction between compile-time package dependencies and link-time package dependencies. Often a compile-time dependency is also a link-time dependency, but there are two instances in which it might not be:
- Template Haskell: some packages might be required for executing TH code at compile-time, but the compiled code doesn't require those packages to be linked in.
- Annotations: we're considering allowing arbitrary attributes to be attached to declarations, where the attributes are compile-time Haskell expressions. The same issue as with TH crops up again here.
Currently we figure out which packages to link by looking at the (transitive closure of the) imports. It would be better to look at the external references of the compiled code; some of the packages referred to by imports may not need to be linked.
Similarly, we should figure out the dependencies of a package by taking the union of the link-time dependencies of its compiled modules. This means a small changes to Cabal.
None of this is particularly hard, and doesn't need any changes to the interface file format or package database: we just record fewer package dependencies than before. The only tricky bit is traversing the code to figure out what the package dependencies should be.
Change History (26)
comment:8 Changed 6 years ago by simonmar
- difficulty changed from Moderate (1 day) to Moderate (less than a day)
comment:10 Changed 5 years ago by igloo
- Milestone changed from 6.12.3 to 6.14.1
- Priority changed from normal to low
comment:14 Changed 3 years ago by igloo
- Milestone changed from 7.4.1 to 7.6.1
- Priority changed from low to lowest
comment:24 Changed 8 weeks ago by niteria
- Differential Revisions set to D973
- Status changed from new to patch
comment:25 Changed 8 weeks ago by thoughtpolice
- Differential Revisions changed from D973 to Phab:D973