Getting ghc/Main.hs to import modules

Anton Xue antonxue1572 at
Wed Jan 2 04:31:54 UTC 2019

Hey all,

I want to make modifications to a custom version of ghc/Main.hs that
depends on packages not natively shipped with GHC 8.2.2.

In short, I want to be able to write "import Network" ( in ghc/Main.hs and then
build GHC from source. However, I am running into some problems, and here
is what I have attempted based on the Building/Modifying page (

1. I downloaded a copy of the network package and placed it in
2. I added an entry to the packages file for library/network, and used
dashes for all the other entries.
3. perl boot
4. I modified and placed libraries/network as the first
PACKAGES_STAGE1 append right before ghc-prim
5. make -j5

The build then fails complaining that:

ghc/Main.hs:77:8: error:
    Could not find module ‘Network’
    Use -v to see a list of the files searched for.
77 | import Network

A similar problem also appears when I replace "import Network" with "import
System.Console.Haskeline", which is strange considering that haskeline was
shipped with GHC 8.2.2. However, other imports such as "import
System.CPUTime", which was defined in base, do not raise this error.
Otherwise GHC builds fine with no errors.

I am wondering what I should do to solve this issue.

Thank you,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list