Skip to content
Snippets Groups Projects
Commit 5b05c27b authored by Matthew Pickering's avatar Matthew Pickering
Browse files

Disable self recomp in release flavour

The interface files that we distribute should not contain any
information which is used by the recompilation checking logic since
source file will never be compiled again.

I am not 100% sure this won't cause unexpected issues, there many be
downstream consumers which are incorrectly using the information from
interfaces, but this commit can be reverted if we detect issues.
parent a510b861
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH
<td>-O2</td>
</tr>
<tr>
<th>release (same as perf with -haddock)</td>
<th>release (same as perf with -haddock and +no_self_recomp)</td>
<td></td>
<td>-O<br>-H64m</td>
<td>-O<br>-H64m</td>
......@@ -329,6 +329,10 @@ The supported transformers are listed below:
<td><code>dump_stg</code></td>
<td>Dump STG of all modules compiled by a stage1 compiler to a file</td>
</tr>
<tr>
<td><code>no_self_recomp</code></td>
<td>Disable including self-recompilation information in interface files via <code>-fno-write-if-self-recomp</code>. If you are building a distribution you can enable this flag to produce more deterministic interface files.</td>
</tr>
</table>
### Static
......
......@@ -16,6 +16,7 @@ module Flavour
, disableProfiledLibs
, enableLinting
, enableHaddock
, disableSelfRecompInfo
, enableHiCore
, useNativeBignum
, enableTextWithSIMDUTF
......@@ -67,6 +68,7 @@ flavourTransformers = M.fromList
, "debug_stage1_ghc" =: debugGhc Stage1
, "lint" =: enableLinting
, "haddock" =: enableHaddock
, "no_self_recomp" =: disableSelfRecompInfo
, "hi_core" =: enableHiCore
, "late_ccs" =: enableLateCCS
, "boot_nonmoving_gc" =: enableBootNonmovingGc
......@@ -208,6 +210,17 @@ enableHaddock =
[ arg "-haddock"
]
-- | Disable self recompilation information in interface files
disableSelfRecompInfo :: Flavour -> Flavour
disableSelfRecompInfo =
addArgs $ stage1 ? mconcat
[ builder (Ghc CompileHs) ? selfRecomp
]
where
selfRecomp = mconcat
[ arg "-fno-write-if-self-recomp"
]
-- | Build stage2 dependencies with options to emit Core into
-- interface files which is sufficient to restart code generation.
enableHiCore :: Flavour -> Flavour
......
......@@ -4,4 +4,8 @@ import Settings.Flavours.Performance
import Flavour
releaseFlavour :: Flavour
releaseFlavour = enableHaddock performanceFlavour { name = "release" }
releaseFlavour =
-- 1. These interface files will be distributed and the source files never recompiled.
disableSelfRecompInfo
-- 2. Include documentation in the interface for tools such as haddock and HLS to use
$ enableHaddock performanceFlavour { name = "release" }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment