[GHC] #9955: ghc-stage1 compiles with bootstrapping ghc package, not the built one
GHC
ghc-devs at haskell.org
Sun Jan 4 02:24:44 UTC 2015
#9955: ghc-stage1 compiles with bootstrapping ghc package, not the built one
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner:
Type: bug | Status: new
Priority: high | Milestone: 7.10.1
Component: Build System | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect result | Unknown/Multiple
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by ezyang):
* priority: highest => high
Comment:
Falsified previous hypothesis. In fact, building GHC HEAD 7.10 works just
fine; it's just the other way around that is a problem. Here's what's
going on:
When there are multiple wired in packages, we seem to ignore the hide-all-
packages directive, and instead simply take all instances of the wired in
package and *select the newest version*. Thus, when we compile GHC HEAD
with GHC 7.10, the ghc package from GHC HEAD has a newer version than the
system ghc package from 7.10, and we use that when compiling. However,
when we build 7.10 with GHC HEAD, we always select the system GHC HEAD
library, which works about as well as you'd expect.
What is going on with the `--show-iface`? The key is that package
dependency description is done by a lookup in the package database. The
package key for 'ghc' is always ghc, no matter what the version is (since
it's wired in), but I notably have NOT told ghc about the inplace package
database in my show-iface command. So we lookup the package keyed 'ghc' in
the default database, which is 7.10's, voila.
This behavior sort of makes sense. In particular, it does make sense for
GHC to try to output something besides a package key when referring to
packages in debug output, because in general you don't necessarily care
about the key in question, and the output is a lot more readable if you
just get package name-version. The downside is it's easy to mess up wired
in packages.
It's possible #9652 is caused by the same underlying mechanism.
My proposed fix for the wired in problem is to properly teach GHC to
respect `-hide-all-packages -package wired-in-0.1.2`: we really SHOULD
pick 0.1.2, even if there is a newer version. Of course, if we don't
mention the wired in package, it probably makes sense to default back to
the newest version.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9955#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list