diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2018-12-07 23:25:20 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-12-07 23:25:30 -0500 |
commit | 45e98f64e82f6ff16dc3e437c3031b9d315f1313 (patch) | |
tree | 16e45c4a587b8108623b900522b79621912815bb /docs | |
parent | 04caa935ac22bd2bd1a254f26df9dca4ee6abdd1 (diff) | |
download | haskell-45e98f64e82f6ff16dc3e437c3031b9d315f1313.tar.gz |
Add -fno-safe-haskell flag
This flag can be set to turn off the Safe Haskell checks.
Whether a module is marked Safe/Unsafe/Trustworthy is ignored when
this flag to set.
Reviewers: bgamari, tdammers
Reviewed By: tdammers
Subscribers: rwbarton, carter
GHC Trac Issues: #15920
Differential Revision: https://phabricator.haskell.org/D5360
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/safe_haskell.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/users_guide/safe_haskell.rst b/docs/users_guide/safe_haskell.rst index adf70d2a90..6772d6abf6 100644 --- a/docs/users_guide/safe_haskell.rst +++ b/docs/users_guide/safe_haskell.rst @@ -206,6 +206,11 @@ run the plugin, it calls ``RIO.runRIO Danger.runMe`` within the ``IO`` monad. The application is safe in the knowledge that the only ``IO`` to ensue will be to files whose paths were approved by the ``pathOK`` test. +The Safe Haskell checks can be disabled for a module by passing the +:ghc-flag:`-fno-safe-haskell` flag. This is useful in particular when compiling +with source plugins as running a plugin marks the module as unsafe and can then +cause downstream modules to fail the safety checks. + .. _safe-language: Safe Language @@ -710,6 +715,18 @@ In summary, Safe Haskell consists of the following three language flags: - *Imported Modules* — Under control of module author which ones must be trusted. +A flag to disable Safe Haskell checks: + +.. ghc-flag:: -fno-safe-haskell + :shortdesc: Disable :ref:`Safe Haskell <safe-haskell>` + :type: dynamic + + This flag can be enabled to override any declared safety property of the + module (Safe, Unsafe, Trustworthy) so compilation proceeds as if none of + these flags were specified. This is particularly useful when compiling + using plugins, which usually results in the compiled modules being marked + as unsafe. + And one general flag: .. ghc-flag:: -fpackage-trust |