packages feed

ghc-stdin 0.2.0.0 → 0.2.1.0

raw patch · 5 files changed

+28/−22 lines, 5 filesdep −safedep ~basedep ~ghcPVP ok

version bump matches the API change (PVP)

Dependencies removed: safe

Dependency ranges changed: base, ghc

API changes (from Hackage documentation)

Files

Changelog.md view
@@ -1,3 +1,8 @@+### 0.2.1.0++- Drop support for *ghc* older than *9.0.1*.+- Drop dependency on package *safe*.+ ### 0.2.0.0  - Using function *shell* to properly pass the plugin's options.
GhcStdin.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  GhcStdin--- Copyright   :  (c) Alexey Radkov 2022+-- Copyright   :  (c) Alexey Radkov 2022-2025 -- License     :  BSD-style -- -- Maintainer  :  alexey.radkov@gmail.com@@ -16,18 +16,13 @@ module GhcStdin (frontendPlugin) where  import           GHC.Paths-#if MIN_VERSION_ghc(9,0,2) import           GHC.Plugins-#else-import           GhcPlugins-#endif import           Control.Monad import qualified Data.ByteString as B import           System.IO import           System.IO.Temp import           System.Process import           System.Exit-import           Safe  -- | Frontend plugin for GHC to compile source code from the standard input. --@@ -55,8 +50,8 @@ -- putting them in a new shared library. -- -- @--- __$__ export NGX_MODULE_PATH=\/var\/lib\/nginx\/x86_64-linux-ghc-9.2.3--- __$__ echo \'module NgxHealthcheck where import NgxExport.Healthcheck ()\' | ghc __/--frontend GhcStdin/__ /-ffrontend-opt=\"-Wall -O2 -dynamic -shared -fPIC -lHSrts_thr-ghc$(ghc --numeric-version) -L$NGX_MODULE_PATH -lngx_healthcheck_plugin -o ngx_healthcheck.so\"/ +-- __$__ export NGX_MODULE_PATH=\/var\/lib\/nginx\/x86_64-linux-ghc-$(ghc --numeric-version)+-- __$__ echo \'module NgxHealthcheck where import NgxExport.Healthcheck ()\' | ghc __/--frontend GhcStdin/__ /-ffrontend-opt=\"-Wall -O2 -dynamic -shared -fPIC -flink-rts -threaded -L$NGX_MODULE_PATH -lngx_healthcheck_plugin -o ngx_healthcheck.so\"/  -- [1 of 1] Compiling NgxHealthcheck   ( ghc-stdin-74de48274545714b\/ghc-stdin266454-0.hs, ghc-stdin-74de48274545714b\/ghc-stdin266454-0.o ) -- Linking ngx_healthcheck.so ... -- @@@ -78,7 +73,7 @@             contents <- B.getContents             B.hPutStr hsrc contents >> hFlush hsrc             (_, _, _, h) <- createProcess $-                shell $ q ghc ++ spc (q src) ++ spc (headDef "" flags)+                shell $ q ghc ++ spc (q src) ++ spc (unwords flags)             r <- waitForProcess h             unless (r == ExitSuccess) $ exitWith r     where q s = let q' = '\'' in q' : s ++ pure q'
LICENSE view
@@ -1,4 +1,4 @@-Copyright 2022 Alexey Radkov+Copyright 2022-2025 Alexey Radkov  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are
README.md view
@@ -28,8 +28,8 @@ putting them in a new shared library.  ```ShellSession-$ export NGX_MODULE_PATH=/var/lib/nginx/x86_64-linux-ghc-9.2.3-$ echo 'module NgxHealthcheck where import NgxExport.Healthcheck ()' | ghc --frontend GhcStdin -ffrontend-opt="-Wall -O2 -dynamic -shared -fPIC -lHSrts_thr-ghc$(ghc --numeric-version) -L$NGX_MODULE_PATH -lngx_healthcheck_plugin -o ngx_healthcheck.so" +$ export NGX_MODULE_PATH=/var/lib/nginx/x86_64-linux-ghc-$(ghc --numeric-version)+$ echo 'module NgxHealthcheck where import NgxExport.Healthcheck ()' | ghc --frontend GhcStdin -ffrontend-opt="-Wall -O2 -dynamic -shared -fPIC -flink-rts -threaded -L$NGX_MODULE_PATH -lngx_healthcheck_plugin -o ngx_healthcheck.so"  [1 of 1] Compiling NgxHealthcheck   ( ghc-stdin-74de48274545714b/ghc-stdin266454-0.hs, ghc-stdin-74de48274545714b/ghc-stdin266454-0.o ) Linking ngx_healthcheck.so ... ```@@ -41,4 +41,13 @@ file inside it with the contents read from the standard input. Then it spawns another GHC process to compile this file with the options passed in *-ffrontend-opt*.++#### Installation of the plugin++To use this frontend plugin with GHC, the built module must be registered as a+known GHC package. The simplest way to do it is running++```ShellSession+$ cabal install --lib+``` 
ghc-stdin.cabal view
@@ -1,16 +1,16 @@ name:                  ghc-stdin-version:               0.2.0.0+version:               0.2.1.0 synopsis:              Compile source code from the standard input description:           A frontend plugin for GHC to compile source code from                        the standard input. homepage:              http://github.com/lyokha/ghc-stdin license:               BSD3 license-file:          LICENSE-extra-source-files:    Changelog.md, README.md+extra-doc-files:       Changelog.md, README.md author:                Alexey Radkov <alexey.radkov@gmail.com> maintainer:            Alexey Radkov <alexey.radkov@gmail.com> stability:             experimental-copyright:             2022 Alexey Radkov+copyright:             2022-2025 Alexey Radkov category:              Development bug-reports:           https://github.com/lyokha/ghc-stdin/issues build-type:            Simple@@ -18,21 +18,18 @@  source-repository head   type:                git-  location:            https://github.com/lyokha/ghc-stdin+  location:            https://github.com/lyokha/ghc-stdin.git  library   default-language:    Haskell2010-  build-depends:       base >= 4.11.0.0 && < 5,-                       ghc >= 8.4.1,+  build-depends:       base >= 4.15.0.0 && < 5,+                       ghc >= 9.0.2,                        ghc-paths,                        bytestring,                        temporary,-                       process,-                       safe+                       process    exposed-modules:     GhcStdin--  default-extensions:  CPP    ghc-options:        -Wall