ghc-stdin 0.1.0.0 → 0.1.1.0
raw patch · 3 files changed
+17/−11 lines, 3 filesdep +bytestringPVP ok
version bump matches the API change (PVP)
Dependencies added: bytestring
API changes (from Hackage documentation)
Files
- Changelog.md +4/−0
- GhcStdin.hs +11/−10
- ghc-stdin.cabal +2/−1
Changelog.md view
@@ -1,3 +1,7 @@+### 0.1.1.0++- Using bytestrings when reading from stdin and writing to the temporary file.+ ### 0.1.0.0 - Initial version.
GhcStdin.hs view
@@ -15,17 +15,18 @@ module GhcStdin (frontendPlugin) where -import GHC.Paths+import GHC.Paths #if MIN_VERSION_ghc(9,0,2)-import GHC.Plugins+import GHC.Plugins #else-import GhcPlugins+import GhcPlugins #endif-import Control.Monad-import System.IO-import System.IO.Temp-import System.Process-import System.Exit+import Control.Monad+import qualified Data.ByteString as B+import System.IO+import System.IO.Temp+import System.Process+import System.Exit -- | Frontend plugin for GHC to compile source code from the standard input. --@@ -73,8 +74,8 @@ compileCodeFromStdin flags _ = liftIO $ withTempDirectory "." "ghc-stdin" $ \dir -> withTempFile dir "ghc-stdin.hs" $ \src hsrc -> do- contents <- getContents- hPutStr hsrc contents >> hFlush hsrc+ contents <- B.getContents+ B.hPutStr hsrc contents >> hFlush hsrc (_, _, _, h) <- createProcess $ proc ghc $ src : wordsOfHead flags r <- waitForProcess h unless (r == ExitSuccess) $ exitWith r
ghc-stdin.cabal view
@@ -1,5 +1,5 @@ name: ghc-stdin-version: 0.1.0.0+version: 0.1.1.0 license: BSD3 license-file: LICENSE extra-source-files: Changelog.md, README.md@@ -22,6 +22,7 @@ build-depends: base >= 4.11.0.0 && < 5, ghc >= 8.4.1, ghc-paths,+ bytestring, temporary, process