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.
Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.
Please include the following checklist in your PR:
OK, this is a bit involved. Ignoring cabal file revisions for a moment, consider you run
stack build
in a project using lts-7.15, and the project usesfoldl-1.2.2
. Suppose you had last updated your package index when foldl-1.2.2 wasn't available. Stack will automatically update your index before trying to build so that it can get the .cabal file for foldl-1.2.2.Now consider a similar situation: your project uses yesod-core, which for nightly-2017-01-10 is version 1.4.30, with cabal file revision #1. If your index is missing that revision, previously you would get an error message about a missing revision. With this patch, you'll instead get the behavior that the index will automatically update.
In addition, there are commits here to improve the error messages delivered (to indicate whether the lookup occurred in a Git repo or in the tarball), and to standardize logic around choosing Git vs HTTP index methods.
Testing
In order to test, I first created a
00-index.tar
file with the most recent content (by runningstack update
), and then pruned all recent .cabal files (including the first revision of yesod-core-1.4.30) with the following program run from~/.stack/indices/Hackage
:Then, I ran the following:
Before this change: I would get an error message about a missing Git SHA. After this change, I get the following:
I also confirmed that the output yesod-core-1.4.30/yesod-core.cabal file contains: