summaryrefslogtreecommitdiff
path: root/utils/ghc-pkg/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'utils/ghc-pkg/Main.hs')
-rw-r--r--utils/ghc-pkg/Main.hs21
1 files changed, 7 insertions, 14 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 91637f5fab..3c7a65ddf6 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -34,10 +34,8 @@ import qualified GHC.Unit.Database as GhcPkg
import GHC.Unit.Database
import GHC.HandleEncoding
import GHC.BaseDir (getBaseDir)
-import GHC.Settings.Platform (getTargetPlatform)
-import GHC.Settings.Utils (maybeReadFuzzy)
-import GHC.Platform (platformMini)
-import GHC.Platform.Host (cHostPlatformMini)
+import GHC.Settings.Utils (getTargetArchOS, maybeReadFuzzy)
+import GHC.Platform.Host (hostPlatformArchOS)
import GHC.UniqueSubdir (uniqueSubdir)
import GHC.Version ( cProjectVersion )
import qualified Distribution.Simple.PackageIndex as PackageIndex
@@ -643,13 +641,12 @@ getPkgDatabases verbosity mode use_user use_cache expand_vars my_flags = do
Right appdir -> do
-- See Note [Settings File] about this file, and why we need GHC to share it with us.
let settingsFile = top_dir </> "settings"
- let constantsFile = top_dir </> "platformConstants"
exists_settings_file <- doesFileExist settingsFile
- targetPlatformMini <- case exists_settings_file of
+ targetArchOS <- case exists_settings_file of
False -> do
warn $ "WARNING: settings file doesn't exist " ++ show settingsFile
warn "cannot know target platform so guessing target == host (native compiler)."
- pure cHostPlatformMini
+ pure hostPlatformArchOS
True -> do
settingsStr <- readFile settingsFile
mySettings <- case maybeReadFuzzy settingsStr of
@@ -657,14 +654,10 @@ getPkgDatabases verbosity mode use_user use_cache expand_vars my_flags = do
-- It's excusable to not have a settings file (for now at
-- least) but completely inexcusable to have a malformed one.
Nothing -> die $ "Can't parse settings file " ++ show settingsFile
- constantsStr <- readFile constantsFile
- constants <- case maybeReadFuzzy constantsStr of
- Just s -> pure s
- Nothing -> die $ "Can't parse platform constants file " ++ show constantsFile
- case getTargetPlatform settingsFile mySettings constants of
- Right platform -> pure $ platformMini platform
+ case getTargetArchOS settingsFile mySettings of
+ Right archOS -> pure archOS
Left e -> die e
- let subdir = uniqueSubdir targetPlatformMini
+ let subdir = uniqueSubdir targetArchOS
dir = appdir </> subdir
r <- lookForPackageDBIn dir
case r of