Commit c8ac9dac authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Force gen-extra-source-files to use pre-installed library.



Without a package qualified import, runhaskell will attempt to
load all of Cabal from source, because the files happen to
be named in the same way as the import requests.  That leads
to very slow runtimes.

Fixes #4007.
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 9d25d064
#!/usr/bin/env runhaskell
{-# LANGUAGE PackageImports #-}
-- NB: Force an installed Cabal package to be used, NOT
-- some local files which have these names (as would be
-- the case if we were in the Cabal source directory.)
import "Cabal" Distribution.PackageDescription
import "Cabal" Distribution.PackageDescription.Parse (ParseResult (..), parsePackageDescription)
import "Cabal" Distribution.Verbosity (silent)
import qualified "Cabal" Distribution.ModuleName as ModuleName
import Data.List (isPrefixOf, isSuffixOf, sort)
import Distribution.PackageDescription
import Distribution.PackageDescription.Parse (ParseResult (..), parsePackageDescription)
import Distribution.Verbosity (silent)
import System.Environment (getArgs, getProgName)
import System.FilePath (takeExtension, takeFileName)
import System.Process (readProcess)
import qualified Distribution.ModuleName as ModuleName
import qualified System.IO as IO
main' :: FilePath -> IO ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment