diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-05-19 16:04:57 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-13 02:13:03 -0400 |
commit | fca2d25ff76d442d0825847643ed7448492e0e55 (patch) | |
tree | 3138fb3fb6d56f66ec39e7dcefb6ec2d6fe180df /compiler/GHC.hs | |
parent | 8408d521a67e2af4012d886d6a7e2af02ce42add (diff) | |
download | haskell-fca2d25ff76d442d0825847643ed7448492e0e55.tar.gz |
DynFlags: add UnitConfig datatype
Avoid directly querying flags from DynFlags to build the UnitState.
Instead go via UnitConfig so that we could reuse this to make another
UnitState for plugins.
Diffstat (limited to 'compiler/GHC.hs')
-rw-r--r-- | compiler/GHC.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs index 1aebb96c0f..9f9f2ad758 100644 --- a/compiler/GHC.hs +++ b/compiler/GHC.hs @@ -1677,9 +1677,11 @@ interpretPackageEnv dflags = do where -- Loading environments (by name or by location) + platformArchOs = platformMini (targetPlatform dflags) + namedEnvPath :: String -> MaybeT IO FilePath namedEnvPath name = do - appdir <- versionedAppDir dflags + appdir <- versionedAppDir (programName dflags) platformArchOs return $ appdir </> "environments" </> name probeEnvName :: String -> MaybeT IO FilePath @@ -1716,7 +1718,7 @@ interpretPackageEnv dflags = do -- e.g. .ghc.environment.x86_64-linux-7.6.3 localEnvFileName :: FilePath - localEnvFileName = ".ghc.environment" <.> versionedFilePath dflags + localEnvFileName = ".ghc.environment" <.> versionedFilePath platformArchOs -- Search for an env file, starting in the current dir and looking upwards. -- Fail if we get to the users home dir or the filesystem root. That is, |