shake-ats 1.9.0.0 → 1.9.0.1
raw patch · 3 files changed
+16/−14 lines, 3 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Development.Shake.ATS: [_postfix] :: CCompiler -> Maybe String
+ Development.Shake.ATS: [_prefix] :: CCompiler -> Maybe String
Files
shake-ats.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: shake-ats-version: 1.9.0.0+version: 1.9.0.1 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale
src/Development/Shake/ATS.hs view
@@ -33,7 +33,7 @@ import Control.Monad.IO.Class import Data.Bool (bool) import Data.Either (fromRight)-import Data.Foldable (fold)+import Data.Foldable import Data.Maybe (fromMaybe) import Data.Semigroup (Semigroup (..)) import qualified Data.Text.Lazy as TL@@ -45,7 +45,6 @@ import Development.Shake.FilePath import Development.Shake.Version import Language.ATS--- import Lens.Micro import System.Directory (copyFile, createDirectoryIfMissing, doesFileExist) import System.Environment (getEnv) import System.Exit (ExitCode (ExitSuccess))@@ -125,7 +124,7 @@ patsEnv :: ATSToolConfig -> FilePath -> [CmdOption] patsEnv cfg path = EchoStderr False : zipWith AddEnv- ["PATSHOME", "PATH", "PATSHOMELOCS", "LIBGMP"]+ ["PATSHOME", "PATH", "PATSHOMELOCS"] [_patsHome cfg, _patsHome cfg </> "bin:" ++ path, _patsHomeLocs cfg ] atsToC :: FilePath -> FilePath@@ -156,11 +155,11 @@ atsBin :: ATSTarget -> Rules () atsBin ATSTarget{..} = do - mapM_ satsGen _linkTargets+ traverse_ satsGen _linkTargets - mapM_ hsAts _genTargets+ traverse_ hsAts _genTargets - mapM_ (cabalForeign (_cc _toolConfig)) _hsLibs+ traverse_ (cabalForeign (_cc _toolConfig)) _hsLibs let cTargets = atsToC <$> _src @@ -175,7 +174,10 @@ cconfig' <- cconfig _toolConfig _libs _gc (makeCFlags _cFlags mempty (pure undefined) _gc) let atsGen = (hatsFile <$> _linkTargets) <> (_atsTarget <$> _genTargets)+ -- FIXME the generated C should not depend on the C compiler but the+ -- build artifacts should atsExtras = _otherDeps <> (TL.unpack . objectFile <$> _hsLibs)+ zipWithM_ (cgen _toolConfig atsExtras atsGen) _src cTargets doLib _tgtType (zipWithM_ (objectFileR (_cc _toolConfig) cconfig') cTargets (h' cTargets))
src/Development/Shake/ATS/Rules.hs view
@@ -7,6 +7,7 @@ ) where import Control.Monad+import Data.Foldable import Data.Semigroup (Semigroup (..)) import qualified Data.Text.Lazy as TL import Development.Shake hiding (doesDirectoryExist)@@ -35,7 +36,7 @@ link %> \out -> liftIO $ do contents <- readFile dats let proc = generateLinks contents- writeFile out (either undefined id proc)+ writeFile out (either undefined id proc) -- FIXME better error -- | Get subdirectories recursively. getSubdirs :: FilePath -> IO [FilePath]@@ -45,12 +46,12 @@ [] -> pure [] xs -> do ds' <- filterM doesDirectoryExist ((p </>) <$> xs)- ss <- mapM getSubdirs ds'- pure $ ds' <> join ss+ ss <- traverse getSubdirs ds'+ pure $ ds' <> fold ss -- | These rules take a @.cabal@ file and the @.o@ file to be produced from -- them, building the @.o@ file.-cabalForeign :: CCompiler -> ForeignCabal -> Rules ()+cabalForeign :: CCompiler -> ForeignCabal -> Rules () -- TODO HsCompiler? cabalForeign (GHC _ suff) (ForeignCabal cbp' cf' obf') = do let cf = TL.unpack cf'@@ -65,10 +66,9 @@ ghcV' <- quietly ghcVersion let ghcV = maybe ghcV' (drop 1) suff - need (cf : fmap ((obfDir <> "/") <>) trDeps)+ need (cf : fmap ((obfDir <> [pathSeparator]) <>) trDeps) command_ [Cwd obfDir] "cabal" ["new-build", "all", "-w", "ghc-" ++ ghcV] - -- TODO move this to the @shake-ext@ package? let subdir = takeDirectory cbp correctDir = (== "build") endsBuild = correctDir . last . splitPath@@ -80,7 +80,7 @@ let hdr = dropExtension obj ++ "_stub.h" liftIO $ copyFile hdr (takeDirectory out </> takeFileName hdr)-cabalForeign _ _ = mempty+cabalForeign _ _ = mempty -- FXIME error here? -- | Build a @.lats@ file using @atslex@. atsLex :: FilePath -- ^ Filepath of @.lats@ file