diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-12-16 10:39:12 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-12-16 16:41:49 -0800 |
commit | 7221ad70daa363d77f60d96c3f6e1baa1d9bec81 (patch) | |
tree | cd1f165a3ec0de36c00bab0d5a42bc9d20fc0e84 | |
parent | 6c9258def53008f050e91e6d3e08c4c297392c00 (diff) | |
download | haskell-7221ad70daa363d77f60d96c3f6e1baa1d9bec81.tar.gz |
GHC doesn't have a way to ask for user-package-db, so Cabal reimplemented it.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: docs only
Reviewers: austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1644
-rw-r--r-- | compiler/main/DynFlags.hs | 2 | ||||
-rw-r--r-- | compiler/main/Packages.hs | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 5b16bd69b0..e443926d0f 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -973,6 +973,8 @@ versionedAppDir :: DynFlags -> IO FilePath versionedAppDir dflags = do appdir <- getAppUserDataDirectory (programName dflags) return $ appdir </> (TARGET_ARCH ++ '-':TARGET_OS ++ '-':projectVersion dflags) + -- NB: This functionality is reimplemented in Cabal, so if you + -- change it, be sure to update Cabal. -- | The target code type of the compilation (if any). -- diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs index 8d0f2a67aa..a26b275bb3 100644 --- a/compiler/main/Packages.hs +++ b/compiler/main/Packages.hs @@ -378,6 +378,9 @@ getPackageConfRefs dflags = do resolvePackageConfig :: DynFlags -> PkgConfRef -> IO (Maybe FilePath) resolvePackageConfig dflags GlobalPkgConf = return $ Just (systemPackageConfig dflags) +-- NB: This logic is reimplemented in Cabal, so if you change it, +-- make sure you update Cabal. (Or, better yet, dump it in the +-- compiler info so Cabal can use the info.) resolvePackageConfig dflags UserPkgConf = handleIO (\_ -> return Nothing) $ do dir <- versionedAppDir dflags let pkgconf = dir </> "package.conf.d" |