Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not discard package location #3714 #3759

Merged
merged 2 commits into from
Jan 11, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ Bug fixes:
* 1.6.1 introduced a change that made some precompiled cache files use
longer paths, sometimes causing builds to fail on windows. This has been
fixed. See [#3649](https://github.com/commercialhaskell/stack/issues/3649)
* When promoting packages from snapshot to local, we were
occassionally discarding the actual package location content and
instead defaulting to pulling the package from the index. We now
correctly retain this information. Note that if you were affected by
this bug, you will likely need to delete the binary build cache
associated with the relevant custom snapshot. See
[#3714](https://github.com/commercialhaskell/stack/issues/3714).


## v1.6.3
Expand Down
6 changes: 3 additions & 3 deletions src/Stack/Snapshot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ calculatePackagePromotion

-- Put together the two split out groups of packages
noLongerGlobals3 :: Map PackageName (LoadedPackageInfo SinglePackageLocation)
noLongerGlobals3 = Map.union (Map.mapWithKey globalToSnapshot noLongerGlobals1) noLongerGlobals2
noLongerGlobals3 = Map.mapWithKey globalToSnapshot (Map.union noLongerGlobals1 noLongerGlobals2)

-- Now do the same thing with parent packages: take out the
-- packages to be upgraded and then split out unmet
Expand Down Expand Up @@ -715,14 +715,14 @@ globalToSnapshot name lpi = lpi
splitUnmetDeps :: Map PackageName Version -- ^ extra dependencies available
-> Map PackageName (LoadedPackageInfo loc)
-> ( Map PackageName (LoadedPackageInfo loc)
, Map PackageName (LoadedPackageInfo (PackageLocationIndex FilePath))
, Map PackageName (LoadedPackageInfo loc)
)
splitUnmetDeps extra =
start Map.empty . Map.toList
where
start newGlobals0 toProcess0
| anyAdded = start newGlobals1 toProcess1
| otherwise = (newGlobals1, Map.mapWithKey globalToSnapshot $ Map.fromList toProcess1)
| otherwise = (newGlobals1, Map.fromList toProcess1)
where
(newGlobals1, toProcess1, anyAdded) = loop False newGlobals0 id toProcess0

Expand Down