Simon Hengel pushed to branch wip/sol/pp-set-ghc-version at Glasgow Haskell Compiler / GHC Commits: 7e347ecd by Simon Hengel at 2026-06-20T14:20:54+00:00 Edit phases.rst - - - - - 1 changed file: - docs/users_guide/phases.rst Changes: ===================================== docs/users_guide/phases.rst ===================================== @@ -603,7 +603,7 @@ Options affecting a Haskell pre-processor appropriate and useful. The ``-F`` option lets you run a pre-processor as part of the overall GHC compilation pipeline, which has the advantage over running a Haskell pre-processor separately in - that it works in interpreted mode and you can continue to take reap + that it works in interpreted mode and you can continue to reap the benefits of GHC's recompilation checker. The pre-processor is run just before the Haskell compiler proper @@ -622,6 +622,10 @@ Options affecting a Haskell pre-processor :ghc-flag:`-optF ⟨option⟩` option. These are fed to ⟨cmd⟩ on the command line after the three standard input and output arguments. + GHC sets the environment variable `GHC_VERSION` to the current GHC version when invoking + a pre-processor. The pre-processor can use this to emit + backwards compatible code. + An example of a pre-processor is to convert your source files to the input encoding that GHC expects, i.e. create a script ``convert.sh`` containing the lines: View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7e347ecdded68d93ab121cb10eef5b73... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7e347ecdded68d93ab121cb10eef5b73... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Hengel (@sol)