Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Kaznacheev
GHC
Commits
fac831fd
Commit
fac831fd
authored
11 years ago
by
parcs
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Respect the ordering of -package directives"
This commit was accidentally pushed. This reverts commit
574ccfa2
.
parent
574ccfa2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/main/Packages.lhs
+7
-8
7 additions, 8 deletions
compiler/main/Packages.lhs
with
7 additions
and
8 deletions
compiler/main/Packages.lhs
+
7
−
8
View file @
fac831fd
...
@@ -59,7 +59,6 @@ import System.FilePath as FilePath
...
@@ -59,7 +59,6 @@ import System.FilePath as FilePath
import qualified System.FilePath.Posix as FilePath.Posix
import qualified System.FilePath.Posix as FilePath.Posix
import Control.Monad
import Control.Monad
import Data.Char (isSpace)
import Data.Char (isSpace)
import Data.Foldable (foldrM)
import Data.List as List
import Data.List as List
import Data.Map (Map)
import Data.Map (Map)
import qualified Data.Map as Map
import qualified Data.Map as Map
...
@@ -981,7 +980,7 @@ getPreloadPackagesAnd dflags pkgids =
...
@@ -981,7 +980,7 @@ getPreloadPackagesAnd dflags pkgids =
preload = preloadPackages state
preload = preloadPackages state
pairs = zip pkgids (repeat Nothing)
pairs = zip pkgids (repeat Nothing)
in do
in do
all_pkgs <- throwErr dflags (fold
r
M (add_package pkg_map ipid_map) preload pairs)
all_pkgs <- throwErr dflags (foldM (add_package pkg_map ipid_map) preload pairs)
return (map (getPackageDetails state) all_pkgs)
return (map (getPackageDetails state) all_pkgs)
-- Takes a list of packages, and returns the list with dependencies included,
-- Takes a list of packages, and returns the list with dependencies included,
...
@@ -1004,15 +1003,15 @@ closeDepsErr :: PackageConfigMap
...
@@ -1004,15 +1003,15 @@ closeDepsErr :: PackageConfigMap
-> Map InstalledPackageId PackageId
-> Map InstalledPackageId PackageId
-> [(PackageId,Maybe PackageId)]
-> [(PackageId,Maybe PackageId)]
-> MaybeErr MsgDoc [PackageId]
-> MaybeErr MsgDoc [PackageId]
closeDepsErr pkg_map ipid_map ps = fold
r
M (add_package pkg_map ipid_map) [] ps
closeDepsErr pkg_map ipid_map ps = foldM (add_package pkg_map ipid_map) [] ps
-- internal helper
-- internal helper
add_package :: PackageConfigMap
add_package :: PackageConfigMap
-> Map InstalledPackageId PackageId
-> Map InstalledPackageId PackageId
-> (PackageId,Maybe PackageId)
-> [PackageId]
-> [PackageId]
-> (PackageId,Maybe PackageId)
-> MaybeErr MsgDoc [PackageId]
-> MaybeErr MsgDoc [PackageId]
add_package pkg_db ipid_map (p, mb_parent)
ps
add_package pkg_db ipid_map
ps
(p, mb_parent)
| p `elem` ps = return ps -- Check if we've already added this package
| p `elem` ps = return ps -- Check if we've already added this package
| otherwise =
| otherwise =
case lookupPackage pkg_db p of
case lookupPackage pkg_db p of
...
@@ -1020,12 +1019,12 @@ add_package pkg_db ipid_map (p, mb_parent) ps
...
@@ -1020,12 +1019,12 @@ add_package pkg_db ipid_map (p, mb_parent) ps
missingDependencyMsg mb_parent)
missingDependencyMsg mb_parent)
Just pkg -> do
Just pkg -> do
-- Add the package's dependents also
-- Add the package's dependents also
ps' <- fold
r
M add_package_ipid ps (depends pkg)
ps' <- foldM add_package_ipid ps (depends pkg)
return (p : ps')
return (p : ps')
where
where
add_package_ipid ipid@(InstalledPackageId str)
ps
add_package_ipid
ps
ipid@(InstalledPackageId str)
| Just pid <- Map.lookup ipid ipid_map
| Just pid <- Map.lookup ipid ipid_map
= add_package pkg_db ipid_map (pid, Just p)
ps
= add_package pkg_db ipid_map
ps
(pid, Just p)
| otherwise
| otherwise
= Failed (missingPackageMsg str <> missingDependencyMsg mb_parent)
= Failed (missingPackageMsg str <> missingDependencyMsg mb_parent)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment