diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-08-22 01:29:28 +0100 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-08-22 14:26:06 +0100 |
commit | 22520cd7071e624cb3cbde6fdd65e872855dd6ff (patch) | |
tree | 19f67f87f173c84020188f9cc98e77070be62a2c | |
parent | bf1b117b6ab87a915bf24bcc85e216e5d51cb012 (diff) | |
download | haskell-22520cd7071e624cb3cbde6fdd65e872855dd6ff.tar.gz |
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: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: hvr, austin
Subscribers: simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D170
27 files changed, 59 insertions, 47 deletions
diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index 78c8059046..702c0493b7 100644 --- a/compiler/main/Packages.lhs +++ b/compiler/main/Packages.lhs @@ -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 diff --git a/testsuite/tests/ghci/scripts/ghci025.stdout b/testsuite/tests/ghci/scripts/ghci025.stdout index 9cc88b8a07..0d794be549 100644 --- a/testsuite/tests/ghci/scripts/ghci025.stdout +++ b/testsuite/tests/ghci/scripts/ghci025.stdout @@ -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 diff --git a/testsuite/tests/indexed-types/should_compile/T3017.stderr b/testsuite/tests/indexed-types/should_compile/T3017.stderr index a6c744a177..11e71c7250 100644 --- a/testsuite/tests/indexed-types/should_compile/T3017.stderr +++ b/testsuite/tests/indexed-types/should_compile/T3017.stderr @@ -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] diff --git a/testsuite/tests/indexed-types/should_fail/T9160.stderr b/testsuite/tests/indexed-types/should_fail/T9160.stderr index 7a476d4f42..b4a503e99f 100644 --- a/testsuite/tests/indexed-types/should_fail/T9160.stderr +++ b/testsuite/tests/indexed-types/should_fail/T9160.stderr @@ -1,8 +1,8 @@ -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 diff --git a/testsuite/tests/package/package06e.stderr b/testsuite/tests/package/package06e.stderr index 2d4945549e..05894ee119 100644 --- a/testsuite/tests/package/package06e.stderr +++ b/testsuite/tests/package/package06e.stderr @@ -1,10 +1,10 @@ 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. diff --git a/testsuite/tests/package/package07e.stderr b/testsuite/tests/package/package07e.stderr index 6a72a2e89c..40eaa063e2 100644 --- a/testsuite/tests/package/package07e.stderr +++ b/testsuite/tests/package/package07e.stderr @@ -1,20 +1,21 @@ 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. diff --git a/testsuite/tests/package/package08e.stderr b/testsuite/tests/package/package08e.stderr index a7e8433f7a..7b5c2a848e 100644 --- a/testsuite/tests/package/package08e.stderr +++ b/testsuite/tests/package/package08e.stderr @@ -1,20 +1,21 @@ 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. diff --git a/testsuite/tests/roles/should_compile/Roles1.stderr b/testsuite/tests/roles/should_compile/Roles1.stderr index 96d5603bbf..b59b5d3e1f 100644 --- a/testsuite/tests/roles/should_compile/Roles1.stderr +++ b/testsuite/tests/roles/should_compile/Roles1.stderr @@ -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 ==================== diff --git a/testsuite/tests/roles/should_compile/Roles14.stderr b/testsuite/tests/roles/should_compile/Roles14.stderr index e0f26a14d3..e7a7b65ff1 100644 --- a/testsuite/tests/roles/should_compile/Roles14.stderr +++ b/testsuite/tests/roles/should_compile/Roles14.stderr @@ -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 ==================== diff --git a/testsuite/tests/roles/should_compile/Roles2.stderr b/testsuite/tests/roles/should_compile/Roles2.stderr index 2c7ab6c66f..053c957d1e 100644 --- a/testsuite/tests/roles/should_compile/Roles2.stderr +++ b/testsuite/tests/roles/should_compile/Roles2.stderr @@ -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 ==================== diff --git a/testsuite/tests/roles/should_compile/Roles3.stderr b/testsuite/tests/roles/should_compile/Roles3.stderr index 270afca9cd..23925867b1 100644 --- a/testsuite/tests/roles/should_compile/Roles3.stderr +++ b/testsuite/tests/roles/should_compile/Roles3.stderr @@ -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 ==================== diff --git a/testsuite/tests/roles/should_compile/Roles4.stderr b/testsuite/tests/roles/should_compile/Roles4.stderr index f2b590fadd..93a27f3ded 100644 --- a/testsuite/tests/roles/should_compile/Roles4.stderr +++ b/testsuite/tests/roles/should_compile/Roles4.stderr @@ -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 ==================== diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr index b53df162a8..5c144c204d 100644 --- a/testsuite/tests/roles/should_compile/T8958.stderr +++ b/testsuite/tests/roles/should_compile/T8958.stderr @@ -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] [] diff --git a/testsuite/tests/safeHaskell/check/Check01.stderr b/testsuite/tests/safeHaskell/check/Check01.stderr index 70722f32b8..e13e7d9d76 100644 --- a/testsuite/tests/safeHaskell/check/Check01.stderr +++ b/testsuite/tests/safeHaskell/check/Check01.stderr @@ -1,4 +1,4 @@ [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! diff --git a/testsuite/tests/safeHaskell/check/Check06.stderr b/testsuite/tests/safeHaskell/check/Check06.stderr index 07a49374d0..0e9433ae1e 100644 --- a/testsuite/tests/safeHaskell/check/Check06.stderr +++ b/testsuite/tests/safeHaskell/check/Check06.stderr @@ -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! diff --git a/testsuite/tests/safeHaskell/check/Check08.stderr b/testsuite/tests/safeHaskell/check/Check08.stderr index 7a27852b55..89ec3ad613 100644 --- a/testsuite/tests/safeHaskell/check/Check08.stderr +++ b/testsuite/tests/safeHaskell/check/Check08.stderr @@ -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! diff --git a/testsuite/tests/safeHaskell/check/Check09.stderr b/testsuite/tests/safeHaskell/check/Check09.stderr index d79fe5b0bd..349b234031 100644 --- a/testsuite/tests/safeHaskell/check/Check09.stderr +++ b/testsuite/tests/safeHaskell/check/Check09.stderr @@ -1,8 +1,8 @@ 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. diff --git a/testsuite/tests/safeHaskell/check/pkg01/ImpSafe01.stderr b/testsuite/tests/safeHaskell/check/pkg01/ImpSafe01.stderr index 9bf0315382..e6bc4b3ce4 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/ImpSafe01.stderr +++ b/testsuite/tests/safeHaskell/check/pkg01/ImpSafe01.stderr @@ -1,4 +1,4 @@ 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. diff --git a/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr b/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr index 43306a9eb7..0e2e66cf9f 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr +++ b/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr @@ -1,6 +1,6 @@ <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! diff --git a/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr b/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr index 43306a9eb7..0e2e66cf9f 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr +++ b/testsuite/tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr @@ -1,6 +1,6 @@ <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! diff --git a/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout b/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout index a37dfa55a3..c64f9d831a 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout +++ b/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout @@ -4,27 +4,27 @@ pdb.safePkg01/local.db: trusted: False M_SafePkg -package dependencies: base* ghc-prim integer-gmp +package dependencies: base-4.7.1.0* ghc-prim-0.3.1.0 trusted: safe require own pkg trusted: False M_SafePkg2 -package dependencies: base ghc-prim integer-gmp +package dependencies: base-4.7.1.0 ghc-prim-0.3.1.0 trusted: trustworthy require own pkg trusted: False M_SafePkg3 -package dependencies: base* ghc-prim integer-gmp +package dependencies: base-4.7.1.0* ghc-prim-0.3.1.0 trusted: safe require own pkg trusted: True M_SafePkg4 -package dependencies: base* ghc-prim integer-gmp +package dependencies: base-4.7.1.0* ghc-prim-0.3.1.0 trusted: safe require own pkg trusted: True M_SafePkg5 -package dependencies: base* ghc-prim integer-gmp +package dependencies: base-4.7.1.0* ghc-prim-0.3.1.0 trusted: safe require own pkg trusted: True diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags17.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags17.stderr index 9aab02d5d8..e6ffa06f69 100644 --- a/testsuite/tests/safeHaskell/flags/SafeFlags17.stderr +++ b/testsuite/tests/safeHaskell/flags/SafeFlags17.stderr @@ -1,4 +1,4 @@ SafeFlags17.hs:4:8: 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. diff --git a/testsuite/tests/simplCore/should_compile/T5550.stderr b/testsuite/tests/simplCore/should_compile/T5550.stderr index 9ebd8cc054..0521604855 100644 --- a/testsuite/tests/simplCore/should_compile/T5550.stderr +++ b/testsuite/tests/simplCore/should_compile/T5550.stderr @@ -1,3 +1,3 @@ -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. diff --git a/testsuite/tests/th/TH_Roles2.stderr b/testsuite/tests/th/TH_Roles2.stderr index ab61060000..439ff6f71a 100644 --- a/testsuite/tests/th/TH_Roles2.stderr +++ b/testsuite/tests/th/TH_Roles2.stderr @@ -4,8 +4,8 @@ TYPE CONSTRUCTORS data T (a :: k) COERCION AXIOMS Dependent modules: [] -Dependent packages: [base, ghc-prim, integer-gmp, pretty-1.1.1.1, - template-haskell] +Dependent packages: [base-4.7.1.0, ghc-prim-0.3.1.0, + integer-gmp-0.5.1.0, pretty-1.1.1.1, template-haskell-2.10.0.0] ==================== Typechecker ==================== diff --git a/testsuite/tests/typecheck/should_compile/tc231.stderr b/testsuite/tests/typecheck/should_compile/tc231.stderr index 4421e8aba3..a1ef1b2351 100644 --- a/testsuite/tests/typecheck/should_compile/tc231.stderr +++ b/testsuite/tests/typecheck/should_compile/tc231.stderr @@ -15,4 +15,5 @@ COERCION AXIOMS axiom ShouldCompile.NTCo:Zork :: Zork s a b = forall chain. Q s a chain -> ST s () 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] diff --git a/testsuite/tests/typecheck/should_fail/T5095.stderr b/testsuite/tests/typecheck/should_fail/T5095.stderr index a572c07788..f7c29d41d7 100644 --- a/testsuite/tests/typecheck/should_fail/T5095.stderr +++ b/testsuite/tests/typecheck/should_fail/T5095.stderr @@ -56,7 +56,8 @@ T5095.hs:9:11: instance Eq Ordering -- Defined in ‘GHC.Classes’ instance Eq GHC.Types.Word -- Defined in ‘GHC.Classes’ instance Eq a => Eq [a] -- Defined in ‘GHC.Classes’ - instance Eq Integer -- Defined in ‘integer-gmp:GHC.Integer.Type’ + instance Eq Integer + -- Defined in ‘integer-gmp-0.5.1.0:GHC.Integer.Type’ (The choice depends on the instantiation of ‘a’ To pick the first instance above, use IncoherentInstances when compiling the other instance declarations) diff --git a/testsuite/tests/typecheck/should_fail/tcfail182.stderr b/testsuite/tests/typecheck/should_fail/tcfail182.stderr index c242ccf54a..7b9811234d 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail182.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail182.stderr @@ -2,7 +2,8 @@ tcfail182.hs:9:3: Couldn't match expected type ‘Prelude.Maybe a’ with actual type ‘Maybe t0’ - NB: ‘Prelude.Maybe’ is defined in ‘Data.Maybe’ in package ‘base’ + NB: ‘Prelude.Maybe’ + is defined in ‘Data.Maybe’ in package ‘base-4.7.1.0’ ‘Maybe’ is defined at tcfail182.hs:6:1-18 Relevant bindings include f :: Prelude.Maybe a -> Int (bound at tcfail182.hs:9:1) |