Skip to content

Hadrian: Hard to distinguish between boot ghc package and ghc stage1

Problem

I want to build a package using the Stage0 compiler which depends on GHC. After it has been built I want to use the package as a plugin whilst compiling other things with the stage0 compiler.

The package depends on the ghc library, what this means is that it needs the ghc.conf file but this triggers a build of stage1 rather than copying the ghc.conf file as required.

The problem here is that there are two correct answers for what ghc should mean as a Stage0 package.

  1. The current situation, ghc refers to the result of building Stage1 with the Stage0 compiler.
  2. The ghc lib which is bundled with the Stage0 compiler.

In my situation I need ghc.conf to copy the already installed package so that can be used to build the plugin.

Solutions

I thought a bit about how to define both versions of the ghc library and managing the needs so that the correct one is needed in each situation but I couldn't think of a good way. Basically Hadrian is totally unaware of the unit identifiers and just needs a dependency based on the package name. This means that it will need ghc.conf even though there are two plausible answers and there isn't a way I could see to tell the difference.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information