@@ -229,7 +229,10 @@ self: super: {
229229 # this is not ideal!
230230 # get binary compilers for bootstrapping. We'll put the eventual proper
231231 # compilers into the same place where nix expects them.
232− compiler = import ../compiler/old-ghc-nix { pkgs = self; };
232+ # We mark these compilers as boot compilers to make sure they are only used
233+ # where a boot compiler is expected.
234+ compiler = builtins.mapAttrs (_: v: v // { isHaskellNixBootCompiler = true; })
235+ (import ../compiler/old-ghc-nix { pkgs = self; });
233236
234237 packages = {
235238 # cabal has it's own bootstrap script which we'll use.
@@ -246,7 +249,8 @@ self: super: {
246249 # disable hpack support during bootstrap
247250 hpack = null;
248251 nix-tools = nix-tools.override {
249− inherit ghc;
252+ # Only a boot compiler is suitable here
253+ ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
250254 inherit (bootstrap.packages) hpack;
251255 };
252256
@@ -256,7 +260,8 @@ self: super: {
256260 # need to use the boot strap compiler as we need them
257261 # to build ghcs from source.
258262 alex-project = hackage-project {
259− inherit ghc;
263+ # Only a boot compiler is suitable here
264+ ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
260265 inherit (bootstrap.packages) cabal-install nix-tools hpack;
261266 name = "alex"; version = "3.2.4";
262267 index-state = "2019-10-20T00:00:00Z";
@@ -264,7 +269,8 @@ self: super: {
264269 };
265270 alex = bootstrap.packages.alex-project.alex.components.exes.alex;
266271 happy-project = hackage-project {
267− inherit ghc;
272+ # Only a boot compiler is suitable here
273+ ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
268274 inherit (bootstrap.packages) cabal-install nix-tools hpack;
269275 name = "happy"; version = "1.19.11";
270276 index-state = "2019-10-20T00:00:00Z";
@@ -272,7 +278,8 @@ self: super: {
272278 };
273279 happy = bootstrap.packages.happy-project.happy.components.exes.happy;
274280 hscolour-project = hackage-project {
275− inherit ghc;
281+ # Only a boot compiler is suitable here
282+ ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
276283 inherit (bootstrap.packages) cabal-install nix-tools hpack;
277284 name = "hscolour"; version = "1.24.4";
278285 index-state = "2019-10-20T00:00:00Z";