cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Sometimes-false dependencies

Open treeowl opened this issue 3 years ago • 3 comments

Packages that define orphan instances don't always need all their dependencies to be built. For example, suppose package compat depends on package plain and just defines instances that appear in new versions of plain. It may be that all the uses of plain (module imports and plugins) in compat are guarded by #if !MIN_VERSION_plain(2,12,3). In this case, it should be possible to build compat without actually building plain and its transitive dependencies, although it's necessary to solve for them. We don't, as far as I know, have a way to express that in Cabal. Could such functionality be added?

treeowl avatar Aug 09 '22 17:08 treeowl

If it's not too complex and cumbersome, I guess it could?

Mikolaj avatar Aug 09 '22 21:08 Mikolaj

I wonder how cabal could be aware of cpp conditions ls in the code (in a reliable way)

maybe cabal is already capable of do it using backpack and mixins?

jneira avatar Aug 09 '22 21:08 jneira

I wonder how cabal could be aware of cpp conditions ls in the code (in a reliable way)

it cannot. solving dependencies should only require the index

fgaz avatar Aug 10 '22 14:08 fgaz

I don't think this is a useful feature worth pursuing. Seems like it adds a lot of overhead to how we think about solving, with very little meaningful gain.

gbaz avatar Aug 15 '22 19:08 gbaz