summaryrefslogtreecommitdiff
path: root/utils/ghc-pkg/Main.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-07-07 13:16:47 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-25 00:45:08 -0400
commit6333d7391068d8029eed3e8eff019b9e2c104c7b (patch)
treeed9c42bf6df586a976db83ff448b3efd16ef9764 /utils/ghc-pkg/Main.hs
parent342a01af624840ba94f22256079ff4f3cee09ca2 (diff)
downloadhaskell-6333d7391068d8029eed3e8eff019b9e2c104c7b.tar.gz
Put PlatformConstants into Platform
Diffstat (limited to 'utils/ghc-pkg/Main.hs')
-rw-r--r--utils/ghc-pkg/Main.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 37fd5ba566..91637f5fab 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -643,6 +643,7 @@ 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
False -> do
@@ -656,7 +657,11 @@ 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
- case getTargetPlatform settingsFile mySettings of
+ 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
Left e -> die e
let subdir = uniqueSubdir targetPlatformMini