Skip to content

Commit

Permalink
GHC 7.0-specific things
Browse files Browse the repository at this point in the history
  • Loading branch information
knothed committed Jun 8, 2021
1 parent 0b395c0 commit a73c187
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/test/happy-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ library

exposed-modules: Test, SDist
build-depends: base < 5,
process >= 1.2.3.0,
directory >= 1.2.3.0,
filepath >= 1.4.2.0,
process,
directory,
filepath,
transformers >= 0.5.6.2

default-language: Haskell98
Expand Down
4 changes: 3 additions & 1 deletion packages/test/src/SDist.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module SDist(sdist_test) where

import Shell
import System.FilePath
import System.Directory (setCurrentDirectory)
import System.Process
import System.IO.Error
import System.Exit
Expand Down Expand Up @@ -86,7 +87,8 @@ testWithBootstrapping dir executable = do
-- This is less elegant than performing `cabal sdist package` for each package on its own, but is required because `cabal sdist happy` doesn't work on its own - `cabal sdist all` does.
cabalSdistAll :: [String] -> String -> TypedShell [String]
cabalSdistAll packageNames baseDir = do
output <- liftIO $ readCreateProcess ((shell "cabal sdist all") { cwd = Just baseDir }) "" `catchIOError` const (return "")
liftIO $ setCurrentDirectory baseDir
output <- liftIO $ readProcess "cabal" ["sdist", "all"] "" `catchIOError` const (return "")
let fullNames = catMaybes . catMaybes $ map extractFullName $ lines output
let matched = catMaybes $ map (bestMatch fullNames) packageNames
if length packageNames == length matched then return matched else empty
Expand Down

0 comments on commit a73c187

Please sign in to comment.