UNREG: fix PackageKey emission into .hc files
authorSergei Trofimovich <slyfox@gentoo.org>
Tue, 19 Aug 2014 02:45:11 +0000 (21:45 -0500)
committerAustin Seipp <austin@well-typed.com>
Tue, 19 Aug 2014 04:26:19 +0000 (23:26 -0500)
commit9a708d38c4491dfdf7f97c03e3ff6d482cbdd66e
treee3a9371598032b29a6ba75c1b09f5f09ceac41fa
parentbbd031134a571c1020945b2548e3fc4795b5047a
UNREG: fix PackageKey emission into .hc files

Summary:
Fixes ./configure --unable-unregisterised build failure:
    HC [stage 1] (one of the first calls)
    ...
    <command line>: unknown package: transformers-0.4.1.0

The reason of bug is how UNREG build stores package information
in .hc files:
    compiler/main/CodeOutput.lhs generates first line as
        /* GHC_PACKAGES pkg-name-ver1 pkg-name-ver2 ...
    while DriverPipeline.hs (getHCFilePackages) expects
        /* GHC_PACKAGES pkg-key1 pkg-key2 ...

Fix it by emitting ghc's PackageKey in CodeOutput

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: build-tested on ./configure --enable-unregistersied

Reviewers: simonmar, ezyang, austin

Reviewed By: ezyang, austin

Subscribers: simonmar, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D164
compiler/main/CodeOutput.lhs