[Git][ghc/ghc][wip/spj-reinstallable-base2] 13 commits: accept bkpfail17 test output
Rodrigo Mesquita pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC Commits: bb98d22d by Rodrigo Mesquita at 2026-06-12T17:43:45+01:00 accept bkpfail17 test output - - - - - d30c25a4 by Rodrigo Mesquita at 2026-06-12T17:45:38+01:00 -package base for GhciPackageRename and T12485 - - - - - 32b157a6 by Rodrigo Mesquita at 2026-06-15T11:28:16+01:00 GHC.Essentials should be hidden in haddock this fixes haddockHtml test which was picking up names from GHC.Essentials instead of picking them up from the re-exporting modules. not-home could also have worked, but we want to hide it anway - - - - - 1818c30f by Rodrigo Mesquita at 2026-06-15T12:16:58+01:00 drop traceIf which was not very useful by default and which tripped up a test which grepped for occurrences of Integer in search of a bug. I tried to tighten the grep but didn't work, and the trace seemed to be off in that the interface hadn't been loaded at that point - - - - - 86d5a5da by Rodrigo Mesquita at 2026-06-15T14:15:10+01:00 runRW# is also known-key - - - - - d3b59b49 by Rodrigo Mesquita at 2026-06-15T14:29:40+01:00 failIfM show callstack only on debug to keep previous behavior - - - - - 6d6b6deb by Rodrigo Mesquita at 2026-06-15T14:49:30+01:00 output has 1 less unfolding bc it no longer has trModule binding - - - - - 428ecc8a by Rodrigo Mesquita at 2026-06-15T15:00:26+01:00 no callStackDoc fixes test even with validate - - - - - abe9686a by Rodrigo Mesquita at 2026-06-15T17:05:17+01:00 Fix unused imports warning for unused wildcard imports - - - - - 165e18f8 by Rodrigo Mesquita at 2026-06-15T17:28:28+01:00 Less work in rule2 bc we no longer produce unless there are exported datatypes - - - - - bc3bebf3 by Rodrigo Mesquita at 2026-06-15T18:01:21+01:00 Fix T3007 by making it not use any known-name and not depend on GHC.Essentials - - - - - a705c89e by Rodrigo Mesquita at 2026-06-15T18:01:59+01:00 Fix T3103 by importing known-names from ghc-internal - - - - - a715d7d3 by Rodrigo Mesquita at 2026-06-15T18:03:55+01:00 Missing SPEC known-key name re-fixes T14003 - - - - - 16 changed files: - compiler/GHC/Builtin/KnownKeys.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Tc/Utils/Monad.hs - libraries/base/src/GHC/Essentials.hs - testsuite/tests/backpack/should_fail/bkpfail17.stderr - testsuite/tests/cabal/T12485/Makefile - testsuite/tests/deSugar/should_compile/T13208.stdout - testsuite/tests/driver/T3007/A/Internal.hs - testsuite/tests/driver/T3007/Makefile - testsuite/tests/ghci/scripts/all.T - testsuite/tests/rename/should_compile/T3103/Foreign/Ptr.hs - testsuite/tests/rename/should_compile/T3103/GHC/Base.lhs - testsuite/tests/rename/should_compile/T3103/GHC/Word.hs - testsuite/tests/rename/should_compile/T3103/test.T - testsuite/tests/simplCore/should_compile/rule2.stderr Changes: ===================================== compiler/GHC/Builtin/KnownKeys.hs ===================================== @@ -258,6 +258,9 @@ knownKeyTable , (mkTcOcc "JSVal", jsvalTyConKey) #endif + -- SpecConstr's SPEC type + , (mkTcOcc "SPEC", specTyConKey) + -- Type rep , (mkTcOcc "TyCon", trTyConTyConKey) @@ -269,6 +272,7 @@ knownKeyTable , (mkVarOcc "cstringLength#", cstringLengthIdKey) , (mkVarOcc "eqString", eqStringIdKey) , (mkVarOcc "inline", inlineIdKey) + , (mkVarOcc "runRW#", runRWKey) , (mkVarOcc "seq#", seqHashKey) , (mkVarOcc "divInt#", divIntIdKey) , (mkVarOcc "modInt#", modIntIdKey) ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -839,8 +839,6 @@ loadInterface doc_str mod from -- Crucial assertion that checks if you are trying to load a HPT module into the EPS. -- If you start loading HPT modules into the EPS then you get strange errors about -- overlapping instances. - ; traceIf (hang (text "Loaded new interface" <+> ppr mod) - 2 (ppr (mi_exports iface))) ; massertPpr ((isOneShot (ghcMode (hsc_dflags hsc_env))) || moduleUnitId mod `notElem` hsc_all_home_unit_ids hsc_env ===================================== compiler/GHC/Rename/Names.hs ===================================== @@ -2204,7 +2204,7 @@ warnUnusedImport rdr_env (L loc decl, used, unused, unused_wcs) -- Do not warn for 'import M()' -- See (UI1) in Note [Unused imports] | Just (Exactly, _) <- ideclImportList decl - , null unused + , null unused && null unused_wcs = return () -- Note [Do not warn about Prelude hiding] @@ -2398,8 +2398,8 @@ check this by looking at the names that it brings into scope scope; if there are no ununused names, don't report. (UI1) We don't want to complain about `import M()`, because that is often used to bring - M's /instances/ into scope. That is neatly dealt with by the "no unused names" - criterion. + M's /instances/ into scope. That is neatly dealt with by the "no unused + names" (nor unused wildcard imports) criterion. (UI2) We don't report a decl as unused if it has an `as Rebindable` qualifier. See (KN1) in Note [Overview of known entities] in GHC.Builtin ===================================== compiler/GHC/Tc/Utils/Monad.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-orphans #-} @@ -2464,7 +2464,7 @@ failIfM msg = do env <- getLclEnv let full_msg = (if_loc env <> colon) $$ nest 2 msg logger <- getLogger - liftIO $ fatalErrorMsg logger (full_msg $$ callStackDoc) + liftIO $ fatalErrorMsg logger full_msg failM -------------------- ===================================== libraries/base/src/GHC/Essentials.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE MagicHash, Trustworthy, RankNTypes, CPP #-} +{-# OPTIONS_HADDOCK hide #-} -- | -- @@ -80,6 +81,9 @@ module GHC.Essentials , Void , NonEmpty + -- SpecConstr + , SPEC(..) + -- FFI , Ptr, FunPtr , ConstPtr @@ -164,7 +168,7 @@ module GHC.Essentials -- Names that have BuiltinRules , CS.unpackFoldrCString#, CS.unpackFoldrCStringUtf8#, CS.unpackAppendCString# , CS.unpackAppendCStringUtf8#, CS.cstringLength# - , eqString, inline + , eqString, inline, runRW# , UnsafeEquality( UnsafeRefl ), unsafeEqualityProof, unsafeCoerce# ===================================== testsuite/tests/backpack/should_fail/bkpfail17.stderr ===================================== @@ -2,10 +2,10 @@ [1 of 1] Compiling ShouldFail[sig] [2 of 2] Processing q Instantiating q - [1 of 1] Including p[ShouldFail=base-4.20.0.0:Prelude] - Instantiating p[ShouldFail=base-4.20.0.0:Prelude] + [1 of 1] Including p[ShouldFail=base-4.23.0.0:Prelude] + Instantiating p[ShouldFail=base-4.23.0.0:Prelude] [1 of 1] Compiling ShouldFail[sig] -<no location info>: error: [GHC-15843] +bkpfail17.bkp:5:9: error: [GHC-15843] • Type constructor ‘Either’ has conflicting definitions in the module and its hsig file. Main module: type Either :: * -> * -> * ===================================== testsuite/tests/cabal/T12485/Makefile ===================================== @@ -2,6 +2,8 @@ TOP=../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk +# -package base (GHC.Essentials) is needed to make available +# the module from which GHC looks up known-key names T12485 : @rm -rf a.db b.db '$(GHC_PKG)' init a.db @@ -9,6 +11,6 @@ T12485 : '$(GHC_PKG)' init b.db '$(GHC_PKG)' -f a.db/ -f b.db/ register b.pkg # register b.pkg in b.db # -package-db in dependency order - '$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -fforce-recomp -hide-all-packages -no-user-package-db -package-db a.db -package-db b.db -package-id a-1-XXX -package-id b-1-XXX Main.hs + '$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -fforce-recomp -hide-all-packages -package 'base (GHC.Essentials)' -no-user-package-db -package-db a.db -package-db b.db -package-id a-1-XXX -package-id b-1-XXX Main.hs # -package-db in reverse dependency order - '$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -fforce-recomp -hide-all-packages -no-user-package-db -package-db b.db -package-db a.db -package-id a-1-XXX -package-id b-1-XXX Main.hs + '$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -fforce-recomp -hide-all-packages -package 'base (GHC.Essentials)' -no-user-package-db -package-db b.db -package-db a.db -package-id a-1-XXX -package-id b-1-XXX Main.hs ===================================== testsuite/tests/deSugar/should_compile/T13208.stdout ===================================== @@ -2,5 +2,3 @@ Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}] f = \ (@p) _ [Occ=Dead] -> GHC.Internal.Types.True - Unf=Unf{Src=<vanilla>, TopLvl=True, - Value=True, ConLike=True, WorkFree=True, Expandable=True, ===================================== testsuite/tests/driver/T3007/A/Internal.hs ===================================== @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -dno-typeable-binds #-} -- don't generate $trModule bindings, which require some known-keys module Internal ( A (A) ===================================== testsuite/tests/driver/T3007/Makefile ===================================== @@ -9,15 +9,16 @@ clean: rm -rf package.conf # --no-user-package-db to avoid warning about missing settings file +# -frebindable-known-names to disable the dependency on GHC.Essentials; the package itself uses no known-keys. T3007: $(MAKE) -s --no-print-directory clean '$(GHC_PKG)' init package.conf cd A && '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Setup - cd A && ./Setup configure -v0 --with-compiler='$(TEST_HC)' --with-hc-pkg='$(GHC_PKG)' --ghc-pkg-option=--global-package-db=../package.conf --ghc-pkg-option=--no-user-package-db --ghc-option=-package-db../package.conf + cd A && ./Setup configure -v0 --with-compiler='$(TEST_HC)' --with-hc-pkg='$(GHC_PKG)' --ghc-pkg-option=--global-package-db=../package.conf --ghc-pkg-option=--no-user-package-db --ghc-option=-package-db../package.conf --ghc-option=-frebindable-known-names cd A && ./Setup build -v0 cd A && ./Setup register --inplace -v0 cd B && '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Setup - cd B && ./Setup configure -v0 --with-compiler='$(TEST_HC)' --with-hc-pkg='$(GHC_PKG)' --ghc-pkg-option=--global-package-db=../package.conf --ghc-pkg-option=--no-user-package-db --ghc-option=-package-db../package.conf + cd B && ./Setup configure -v0 --with-compiler='$(TEST_HC)' --with-hc-pkg='$(GHC_PKG)' --ghc-pkg-option=--global-package-db=../package.conf --ghc-pkg-option=--no-user-package-db --ghc-option=-package-db../package.conf --ghc-option=-frebindable-known-names cd B && ./Setup build -v0 ===================================== testsuite/tests/ghci/scripts/all.T ===================================== @@ -387,8 +387,9 @@ test('T24459', normal, ghci_script, ['T24459.script']) test('T24632', normal, ghci_script, ['T24632.script']) # Test package renaming in GHCi session +# (GHC.Essentials from base is needed for known-names) test('GhciPackageRename', - [extra_hc_opts("-hide-all-packages -package 'containers (Data.Map as Prelude)'")], + [extra_hc_opts("-hide-all-packages -package 'base (GHC.Essentials)' -package 'containers (Data.Map as Prelude)'")], ghci_script, ['GhciPackageRename.script']) test('T26233', normal, ghci_script, ['T26233.script']) ===================================== testsuite/tests/rename/should_compile/T3103/Foreign/Ptr.hs ===================================== @@ -5,6 +5,7 @@ module Foreign.Ptr () where import GHC.Show (Show(..)) import GHC.Word (Word) import GHC.Base (Num) +import qualified GHC.Internal.Base as Rebindable newtype WordPtr = WordPtr Word deriving Num ===================================== testsuite/tests/rename/should_compile/T3103/GHC/Base.lhs ===================================== @@ -10,6 +10,7 @@ module GHC.Base import GHC.Classes import GHC.Prim +import qualified GHC.Internal.Base as Rebindable class Num a where signum :: a -> a ===================================== testsuite/tests/rename/should_compile/T3103/GHC/Word.hs ===================================== @@ -7,6 +7,8 @@ module GHC.Word ( import GHC.Base import GHC.Types import GHC.Num () +import qualified GHC.Internal.Num as Rebindable +import qualified GHC.Internal.Base as Rebindable import {-# SOURCE #-} GHC.Unicode () ===================================== testsuite/tests/rename/should_compile/T3103/test.T ===================================== @@ -2,4 +2,4 @@ test('T3103', [extra_files(['Foreign/', 'GHC/'])], multimod_compile, ['Foreign.Ptr', - '-v0 -hide-all-packages -package ghc-prim -package ghc-bignum -this-unit-id base']) + '-v0 -hide-all-packages -package ghc-internal -package ghc-prim -package ghc-bignum -this-unit-id base -frebindable-known-names']) ===================================== testsuite/tests/simplCore/should_compile/rule2.stderr ===================================== @@ -10,14 +10,13 @@ ==================== Grand total simplifier statistics ==================== -Total ticks: 11 +Total ticks: 10 1 PreInlineUnconditionally 1 f 2 UnfoldingDone 1 GHC.Internal.Base.id 1 Roman.bar 1 RuleFired 1 foo/bar -1 LetFloatFromLet 1 6 BetaReduction 1 f 1 a View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6c4f54f938f1d405de0079980bffda8... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6c4f54f938f1d405de0079980bffda8... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Rodrigo Mesquita (@alt-romes)