fay 0.24.0.3 → 0.24.0.4
raw patch · 4 files changed
+16/−3 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- fay.cabal +1/−1
- src/Fay/Compiler/Packages.hs +5/−1
- src/Fay/Compiler/Typecheck.hs +5/−1
CHANGELOG.md view
@@ -2,9 +2,14 @@ See full history at: <https://github.com/faylang/fay/commits> +#### 0.24.0.4 (2019-12-03)++* Fixes stack nix integration broken.+ #### 0.24.0.3 (2019-04-29) * Dependency updates including GHC-8.6 support.+* Added stack compatibility. #### 0.24.0.2
fay.cabal view
@@ -1,5 +1,5 @@ name: fay-version: 0.24.0.3+version: 0.24.0.4 synopsis: A compiler for Fay, a Haskell subset that compiles to JavaScript. description: Fay is a proper subset of Haskell which is type-checked with GHC, and compiled to JavaScript. It is lazy, pure, has a Fay monad,
src/Fay/Compiler/Packages.hs view
@@ -12,6 +12,7 @@ import GHC.Paths import System.Directory import System.FilePath+import System.Environment -- | Given a configuration, resolve any packages specified to their -- data file directories for importing the *.hs sources.@@ -55,8 +56,9 @@ describePackage :: Maybe FilePath -> String -> IO String describePackage db name = do exists <- doesFileExist ghc_pkg+ stackInNixShell <- fmap isJust (lookupEnv "STACK_IN_NIX_SHELL") let command = if exists- then if (isInfixOf ".stack" ghc_pkg)+ then if (isInfixOf ".stack" ghc_pkg || stackInNixShell) then "stack" else ghc_pkg else "ghc-pkg"@@ -65,7 +67,9 @@ _ -> [] args = extraArgs ++ ["describe",name] ++ ["--expand-env-vars", "-v2"] ++ ["--package-db=" ++ db' | Just db' <- [db]]+ when stackInNixShell (unsetEnv "STACK_IN_NIX_SHELL") result <- readAllFromProcess command args ""+ when stackInNixShell (setEnv "STACK_IN_NIX_SHELL" "1") case result of Left (err,out) -> error $ "ghc-pkg describe error:\n" ++ err ++ "\n" ++ out Right (_err,out) -> return out
src/Fay/Compiler/Typecheck.hs view
@@ -12,6 +12,7 @@ import qualified GHC.Paths as GHCPaths import System.Directory+import System.Environment -- | Call out to GHC to type-check the file. typecheck :: Config -> FilePath -> IO (Either CompileError String)@@ -40,8 +41,9 @@ , "-i" ++ intercalate ":" includeDirs , fp ] ++ ghcPackageDbArgs ++ wallF ++ map ("-package " ++) packages exists <- doesFileExist GHCPaths.ghc+ stackInNixShell <- fmap isJust (lookupEnv "STACK_IN_NIX_SHELL") let ghcPath = if exists- then if (isInfixOf ".stack" GHCPaths.ghc)+ then if (isInfixOf ".stack" GHCPaths.ghc || stackInNixShell) then "stack" else GHCPaths.ghc else "ghc"@@ -50,7 +52,9 @@ _ -> [] when (configShowGhcCalls cfg) $ putStrLn . unwords $ ghcPath : (extraFlags ++ flags)+ when stackInNixShell (unsetEnv "STACK_IN_NIX_SHELL") res <- readAllFromProcess ghcPath (extraFlags ++ flags) ""+ when stackInNixShell (setEnv "STACK_IN_NIX_SHELL" "1") either (return . Left . GHCError . fst) (return . Right . fst) res where wallF | configWall cfg = ["-Wall"]