File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -680,8 +680,8 @@ getPackageDatabases bconfig BTDeps =
680680 liftIO $ liftM return $ runReaderT packageDatabaseDeps bconfig
681681getPackageDatabases bconfig BTLocals = liftIO $ flip runReaderT bconfig $
682682 sequence
683- [ packageDatabaseDeps
684- , packageDatabaseLocal
683+ [ packageDatabaseLocal
684+ , packageDatabaseDeps
685685 ]
686686
687687getInstallRoot :: MonadIO m => BuildConfig -> BuildType -> m (Path Abs Dir )
Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ ghcPkg menv pkgDbs args = do
104104
105105-- | In the given databases, get a single version for all packages, chooses the
106106-- latest version of each package.
107+ --
108+ -- Package databases passed to these function override eachother in a
109+ -- left-biased way when containing two packages of the same name.
107110getPackageVersionMapWithGlobalDb
108111 :: (MonadCatch m , MonadIO m , MonadThrow m , MonadLogger m )
109112 => EnvOverride
@@ -126,20 +129,15 @@ getPackageVersionMapWithGlobalDb menv mmbp pkgDbs = do
126129 Just mbp ->
127130 filtering gdb mbp allGlobals
128131 $ logDebug (" Filtered globals: " <> T. pack (show globals))
129- -- Use unionsWith max to account for cases where the snapshot introduces a
130- -- newer version of a global package, see:
131- -- https://github.com/fpco/stack/issues/78
132+ -- M.unions is left-biased.
132133 rest <-
133134 getPackageVersions
134135 menv
135136 pkgDbs
136137 (flip elem pkgDbs)
137- (M. unionsWith max .
138+ (M. unions .
138139 map (M. fromList . rights))
139- return
140- (M. unionsWith
141- max
142- [globals, rest])
140+ return (M. unions [rest,globals])
143141 where
144142 filtering gdb mbp allGlobals =
145143 foldM
You can’t perform that action at this time.
0 commit comments