Commit 22520cd7 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Do not zero out version number when processing wired-in packages.



Summary:
Previously, GHC would look for instances of wired-in packages in the
in-memory package database and null out the version number.  This was
necessary when the sourcePackageId was used to determine the linker
symbols; however, we now use a package key, so only that needs to be
updated.

Long-term, we can remove this hack by ensuring that Cabal actually records
the proper package key in the database.  This will also fix an unrelated
hack elsewhere.

Keeping version numbers means that wired in packages get rendered differently
when output by GHC.  This is the source of all the test-case output changes.
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: hvr, austin

Subscribers: simonmar, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D170
parent bf1b117b
......@@ -698,8 +698,7 @@ findWiredInPackages dflags pkgs = do
where upd_pkg p
| installedPackageId p `elem` wired_in_ids
= let pid = (sourcePackageId p) { pkgVersion = Version [] [] }
in p { sourcePackageId = pid
, packageKey = OldPackageKey pid }
in p { packageKey = OldPackageKey pid }
| otherwise
= p
......
......@@ -54,8 +54,9 @@ class Eq a where
Prelude.length :: [a] -> GHC.Types.Int
-- imported via T
data T.Integer
= integer-gmp:GHC.Integer.Type.S# GHC.Prim.Int#
| integer-gmp:GHC.Integer.Type.J# GHC.Prim.Int# GHC.Prim.ByteArray#
= integer-gmp-0.5.1.0:GHC.Integer.Type.S# GHC.Prim.Int#
| integer-gmp-0.5.1.0:GHC.Integer.Type.J# GHC.Prim.Int#
GHC.Prim.ByteArray#
T.length :: Data.ByteString.Internal.ByteString -> GHC.Types.Int
:browse! T
-- defined locally
......
......@@ -16,4 +16,5 @@ INSTANCES
FAMILY INSTANCES
type Elem (ListColl a)
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
Dependent packages: [base-4.7.1.0, ghc-prim-0.3.1.0,
integer-gmp-0.5.1.0]
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ghc-prim-0.3.1.0 ... linking ... done.
Loading package integer-gmp-0.5.1.0 ... linking ... done.
Loading package base-4.7.1.0 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package template-haskell-2.10.0.0 ... linking ... done.
T9160.hs:18:8:
Type indexes must match class instance head
......
package06e.hs:2:1:
Failed to load interface for ‘HsTypes’
It is a member of the hidden package ‘ghc’.
It is a member of the hidden package ‘ghc-7.9.20140821’.
Use -v to see a list of the files searched for.
package06e.hs:3:1:
Failed to load interface for ‘UniqFM’
It is a member of the hidden package ‘ghc’.
It is a member of the hidden package ‘ghc-7.9.20140821’.
Use -v to see a list of the files searched for.
package07e.hs:2:1:
Failed to load interface for ‘MyHsTypes’
Perhaps you meant HsTypes (needs flag -package-key ghc)
Perhaps you meant
HsTypes (needs flag -package-key ghc-7.9.20140821)
Use -v to see a list of the files searched for.
package07e.hs:3:1:
Failed to load interface for ‘HsTypes’
It is a member of the hidden package ‘ghc’.
It is a member of the hidden package ‘ghc-7.9.20140821’.
Use -v to see a list of the files searched for.
package07e.hs:4:1:
Failed to load interface for ‘HsUtils’
It is a member of the hidden package ‘ghc’.
It is a member of the hidden package ‘ghc-7.9.20140821’.
Use -v to see a list of the files searched for.
package07e.hs:5:1:
Failed to load interface for ‘UniqFM’
It is a member of the hidden package ‘ghc’.
It is a member of the hidden package ‘ghc-7.9.20140821’.
Use -v to see a list of the files searched for.
package08e.hs:2:1:
Failed to load interface for ‘MyHsTypes’
Perhaps you meant HsTypes (needs flag -package-key ghc)
Perhaps you meant
HsTypes (needs flag -package-key ghc-7.9.20140821)
Use -v to see a list of the files searched for.
package08e.hs:3:1:
Failed to load interface for ‘HsTypes’
It is a member of the hidden package ‘ghc’.
It is a member of the hidden package ‘ghc-7.9.20140821’.
Use -v to see a list of the files searched for.
package08e.hs:4:1:
Failed to load interface for ‘HsUtils’
It is a member of the hidden package ‘ghc’.
It is a member of the hidden package ‘ghc-7.9.20140821’.
Use -v to see a list of the files searched for.
package08e.hs:5:1:
Failed to load interface for ‘UniqFM’
It is a member of the hidden package ‘ghc’.
It is a member of the hidden package ‘ghc-7.9.20140821’.
Use -v to see a list of the files searched for.
......@@ -17,7 +17,8 @@ TYPE CONSTRUCTORS
data T7 (a :: k) b = K7 b
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
Dependent packages: [base-4.7.1.0, ghc-prim-0.3.1.0,
integer-gmp-0.5.1.0]
==================== Typechecker ====================
......@@ -6,7 +6,8 @@ TYPE CONSTRUCTORS
COERCION AXIOMS
axiom Roles12.NTCo:C2 :: C2 a = a -> a
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
Dependent packages: [base-4.7.1.0, ghc-prim-0.3.1.0,
integer-gmp-0.5.1.0]
==================== Typechecker ====================
......@@ -5,7 +5,8 @@ TYPE CONSTRUCTORS
data T2 a = K2 (FunPtr a)
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
Dependent packages: [base-4.7.1.0, ghc-prim-0.3.1.0,
integer-gmp-0.5.1.0]
==================== Typechecker ====================
......@@ -18,7 +18,8 @@ COERCION AXIOMS
axiom Roles3.NTCo:C3 :: C3 a b = a -> F3 b -> F3 b
axiom Roles3.NTCo:C4 :: C4 a b = a -> F4 b -> F4 b
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
Dependent packages: [base-4.7.1.0, ghc-prim-0.3.1.0,
integer-gmp-0.5.1.0]
==================== Typechecker ====================
......@@ -9,7 +9,8 @@ COERCION AXIOMS
axiom Roles4.NTCo:C1 :: C1 a = a -> a
axiom Roles4.NTCo:C3 :: C3 a = a -> Syn1 a
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
Dependent packages: [base-4.7.1.0, ghc-prim-0.3.1.0,
integer-gmp-0.5.1.0]
==================== Typechecker ====================
......@@ -16,7 +16,8 @@ INSTANCES
instance [incoherent] Representational a
-- Defined at T8958.hs:10:10
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
Dependent packages: [base-4.7.1.0, ghc-prim-0.3.1.0,
integer-gmp-0.5.1.0]
==================== Typechecker ====================
AbsBinds [a] []
......
[3 of 3] Compiling Check01 ( Check01.hs, Check01.o )
<no location info>:
The package (base) is required to be trusted but it isn't!
The package (base-4.7.1.0) is required to be trusted but it isn't!
......@@ -2,4 +2,4 @@
[2 of 2] Compiling Check06 ( Check06.hs, Check06.o )
<no location info>:
The package (base) is required to be trusted but it isn't!
The package (base-4.7.1.0) is required to be trusted but it isn't!
......@@ -3,4 +3,4 @@
[3 of 3] Compiling Check08 ( Check08.hs, Check08.o )
<no location info>:
The package (base) is required to be trusted but it isn't!
The package (base-4.7.1.0) is required to be trusted but it isn't!
Check09.hs:4:1:
Prelude: Can't be safely imported!
The package (base) the module resides in isn't trusted.
The package (base-4.7.1.0) the module resides in isn't trusted.
Check09.hs:5:1:
Data.ByteString.Char8: Can't be safely imported!
The package (bytestring-0.10.1.0) the module resides in isn't trusted.
The package (bytestring-0.10.4.0) the module resides in isn't trusted.
ImpSafe01.hs:9:1:
Data.Word: Can't be safely imported!
The package (base) the module resides in isn't trusted.
The package (base-4.7.1.0) the module resides in isn't trusted.
<no location info>:
The package (base) is required to be trusted but it isn't!
The package (base-4.7.1.0) is required to be trusted but it isn't!
<no location info>:
The package (bytestring-0.10.4.0) is required to be trusted but it isn't!
<no location info>:
The package (base) is required to be trusted but it isn't!
The package (base-4.7.1.0) is required to be trusted but it isn't!
<no location info>:
The package (bytestring-0.10.4.0) is required to be trusted but it isn't!
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment