Encode flag setting in InstalledPackageInfo? #8702
Labels
re: flag
Concerning user-defined flags in cabal files
re: installed-package-info
recompilation
type: enhancement
Describe the bug
In haskell/text#487 we noticed that there is no robust way to force
cabal-install
to reinstall a pre-existing library when flags are changed. In this case this means that there is no way for a user to enable thetext
package'ssimdutf
flag if GHC ships with the flag disabled.This is due to the fact that the only information
Cabal
has about pre-existing packages is that which is recorded inInstalledPackageInfo
. AsInstalledPackageInfo
includes no knowledge of flags,cabal-install
merely assumes that the pre-existing package's flag setting is compatible with that requested by the user.For this reason, it seems reasonable to encode flag settings in
InstalledPackageInfo
. As, to my eyes, flags seem to be a slightly "higher-level" concern that the otherInstalledPackageInfo
fields (which encode precisely the information needed by GHC to compile and link against the package), I suspect this information best belongs in a "non-normative" IPI field. That is perhaps we introduce the convention that any field starting withX-
will be ignored by GHC. This would allowCabal
to encode flag settings in anX-Flag-Setting
field while keeping separate concerns separate and making it clear that GHC will not depend upon this knowledge.The text was updated successfully, but these errors were encountered: