Automatic package reconfiguration and ConfigExFlags

Thomas Tuegel ttuegel at
Tue Aug 14 00:29:57 CEST 2012


Today I merged commits for automatic reconfiguration and rebuilding of
a package as necessary when 'cabal test' and 'cabal bench' are
invoked. The automatic reconfiguration code is based on the code
already used to reconfigure packages when './Setup build' and 'cabal
build' are invoked. I noticed that the existing reconfiguration code
does not account for ConfigExFlags that may have been passed to 'cabal
configure' the last time the package was configured. (My alterations
do not affect this behaviour.) The purpose of this message is to bring
attention to the problems I think this could cause and with the help
of the community, determine the actual severity of the issue. Then we
can decide if/when and how to resolve it.

Obviously, if Cabal is being invoked through a 'Setup' script, there
is no need for concern. However, ConfigExFlags affect dependency
resolution during configuration, so automatic reconfiguration that
ignores them may silently and unexpectedly change how the package is
linked. I'm concerned this could (hypothetically) lead to linking to a
different version of a dependency, causing build failure (or worse, if
different versions of the dependency have different behaviours).

I also have some reason to believe the situation is not that dire.
After the initial configuration, the resolved dependencies are saved
in the ConfigFlags in the LocalBuildInfo. When reconfiguring, the
worst possible outcome should be that the dependency resolver cannot
resolve the given dependencies and versions without some ConfigExFlags
that would now be missing.

To get my patches merged, I ignored this issue. The easiest solution
is simply to include the ConfigExFlags in the LocalBuildInfo. That is
something that could be done when/if the 'Setup' script builds
actually become deprecated, since the ConfigExFlags reside in
cabal-install, but the LocalBuildInfo is in Cabal. We may want to take
care of this in the short term, but on the other hand, it could
probably wait: this is far from a new issue, and I can't document any
case of someone actually bitten by this bug.

Feel free to tell me I'm making this out to be more than it is, but I
thought I should present it before the community.


Thomas Tuegel

More information about the cabal-devel mailing list