Add with-compiler to snapshot's cabal.config file #313
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.
This patch adds the specification of what compiler to use for a snapshot using cabal's "with-compiler" option.
Context
cabal-install 3.8 has gained the ability of using remote imports in cabal project files (https://cabal.readthedocs.io/en/latest/cabal-project.html#conditionals-and-imports). This was done as a first attempt to support using stackage snapshots directly with cabal (see haskell/cabal#7556 for a discussion of the problem).
In short, one can create a
cabal.project
file as followsand cabal use the package versions specified by lts-19.10. To reproduce the stackage snapshot (modulo revisions, see note below), one has to use the same compiler as the snapshot, therefore I believe it's important to add the
with-compiler
flag above.This PR adds the
with-compiler
line to thecabal.config
files as generated by stackage-server. Shortening the boilerplate down to:Notes
cabal.config
and feed it to cabal ascabal.project.freeze
for a long time. What's next is just the convenience of pointing directly to stackage.cabal.config
fixes the package versions but not the package cabal file revisions. I am aware of the difference and this PR does not improve on that regard.cabal.config
file. I haven't implemented this yet.