Support .buildinfo files in stack ghci. #2242
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Distribution.SimplebasedSetup.hssometimes create<package>.buildinfofiles as an artifact of the configure phase.This is the case in particular when using the autoconf hooks. Since
this is an internal detail private to any given package's
Setup.hs,Stack shouldn't (and doesn't) need to care or be aware of this. But
stack ghcidoes, since in that use case we're not using Cabal tobuild - we're taking care of the build ourselves. In particular,
ignoring the
<package.buildinfofile can mean that a successfulbuild using
stack buildcan't be replicated usingstack ghci.E.g. in the case of the
networkpackage, the set of C files to buildis decided at configure time, based on the current platform. So the
c-filesstanza in the .cabal file is not complete. This in turnmeans
stack ghciisn't aware of all object files it has to link in,leading to obscure link errors (see #1239).
See 1 for more on .buildinfo files.
Fixes #2239.
To test:
Without this patch the above sequence of commands doesn't work.