[Git][ghc/ghc][wip/fix-cross-ghc-info-unit-id] compiler: ensure cross ghc --info output target unid ids
by Cheng Shao (@TerrorJack) 11 Oct '26
by Cheng Shao (@TerrorJack) 11 Oct '26
11 Oct '26
Cheng Shao pushed to branch wip/fix-cross-ghc-info-unit-id at Glasgow Haskell Compiler / GHC
Commits:
fa8f57da by Cheng Shao at 2026-10-11T10:01:31+00:00
compiler: ensure cross ghc --info output target unid ids
Previously, for cross ghcs, the base/ghc/ghc-internal unit ids in
--info output do not match the target unit ids reported by ghc-pkg,
breaking cross ghc release builds with hash-unit-ids when being used
with cabal 3.18. This patch fixes it by making --info output target
unit ids. Fixes #27919.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
10 changed files:
- .gitlab/hello.hs
- + changelog.d/fix-cross-ghc-info-unit-id
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- distrib/configure.ac.in
- hadrian/bindist/Makefile
- hadrian/bindist/config.mk.in
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/Generate.hs
Changes:
=====================================
.gitlab/hello.hs
=====================================
@@ -27,7 +27,11 @@ fakeSettings =
sTargetPlatform =
genericPlatform,
sPlatformMisc = PlatformMisc {},
- sUnitSettings = UnitSettings { unitSettings_baseUnitId = stringToUnitId "base" }
+ sUnitSettings = UnitSettings
+ { unitSettings_baseUnitId = stringToUnitId "base"
+ , unitSettings_ghcUnitId = stringToUnitId "ghc"
+ , unitSettings_ghcInternalUnitId = stringToUnitId "ghc-internal"
+ }
}
fakeDynFlags :: DynFlags
=====================================
changelog.d/fix-cross-ghc-info-unit-id
=====================================
@@ -0,0 +1,4 @@
+section: compiler
+synopsis: Fix a bug where unit ids in cross ghc --info output doesn't match ghc-pkg output, breaking cross ghc releases with cabal 3.18.
+mrs: !16790
+issues: #27919
=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -546,7 +546,8 @@ opt_i dflags= toolSettings_opt_i $ toolSettings dflags
setBaseUnitId :: String -> DynP ()
-setBaseUnitId s = upd $ \d -> d { unitSettings = UnitSettings (stringToUnitId s) }
+setBaseUnitId s = upd $ \d -> d
+ { unitSettings = (unitSettings d) { unitSettings_baseUnitId = stringToUnitId s } }
-----------------------------------------------------------------------------
@@ -3663,8 +3664,6 @@ compilerInfo dflags
("Project Patch Level", cProjectPatchLevel),
("Project Patch Level1", cProjectPatchLevel1),
("Project Patch Level2", cProjectPatchLevel2),
- ("Project Unit Id", cProjectUnitId),
- ("ghc-internal Unit Id", cGhcInternalUnitId), -- See Note [Special unit-ids]
("Booter version", cBooterVersion),
("Stage", cStage),
("Build platform", cBuildPlatformString),
=====================================
compiler/GHC/Settings.hs
=====================================
@@ -94,7 +94,11 @@ data Settings = Settings
, sRawTarget :: Target
}
-data UnitSettings = UnitSettings { unitSettings_baseUnitId :: !UnitId }
+data UnitSettings = UnitSettings
+ { unitSettings_baseUnitId :: !UnitId
+ , unitSettings_ghcUnitId :: !UnitId
+ , unitSettings_ghcInternalUnitId :: !UnitId
+ }
-- | Settings for other executables GHC calls.
--
=====================================
compiler/GHC/Settings/IO.hs
=====================================
@@ -142,6 +142,8 @@ initSettings top_dir = do
ghcWithInterpreter <- getBooleanSetting "Use interpreter"
baseUnitId <- getSetting_raw "base unit-id"
+ ghcUnitId <- getSetting_raw "Project Unit Id"
+ ghcInternalUnitId <- getSetting_raw "ghc-internal Unit Id"
-- LibDir is optional. If not set, derive it from topDir. This allows
-- bindists to work without explicitly setting LibDir, but gives us the
@@ -174,6 +176,8 @@ initSettings top_dir = do
, sUnitSettings = UnitSettings
{
unitSettings_baseUnitId = stringToUnitId baseUnitId
+ , unitSettings_ghcUnitId = stringToUnitId ghcUnitId
+ , unitSettings_ghcInternalUnitId = stringToUnitId ghcInternalUnitId
}
, sToolSettings = ToolSettings
=====================================
distrib/configure.ac.in
=====================================
@@ -406,6 +406,12 @@ fi
AC_SUBST(BaseUnitId)
+dnl The units supplied with the target libraries, as reported by ghc --info.
+GhcUnitId=@GhcUnitId@
+GhcInternalUnitId=@GhcInternalUnitId@
+AC_SUBST(GhcUnitId)
+AC_SUBST(GhcInternalUnitId)
+
# We get caught by
# http://savannah.gnu.org/bugs/index.php?1516
# $(eval ...) inside conditionals causes errors
=====================================
hadrian/bindist/Makefile
=====================================
@@ -90,6 +90,8 @@ lib/settings : config.mk
@echo ',("RTS ways", "$(GhcRTSWays)")' >> $@
@echo ',("Relative Global Package DB", "package.conf.d")' >> $@
@echo ',("base unit-id", "$(BaseUnitId)")' >> $@
+ @echo ',("Project Unit Id", "$(GhcUnitId)")' >> $@
+ @echo ',("ghc-internal Unit Id", "$(GhcInternalUnitId)")' >> $@
@echo "]" >> $@
lib/targets/default.target : config.mk default.target
=====================================
hadrian/bindist/config.mk.in
=====================================
@@ -134,6 +134,8 @@ CrossCompilePrefix = @CrossCompilePrefix@
GhcUnregisterised = @Unregisterised@
EnableDistroToolchain = @EnableDistroToolchain@
BaseUnitId = @BaseUnitId@
+GhcUnitId = @GhcUnitId@
+GhcInternalUnitId = @GhcInternalUnitId@
# The THREADED_RTS requires `BaseReg` to be in a register and the
# `GhcUnregisterised` mode doesn't allow that.
=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -232,7 +232,7 @@ buildBinDistDir root conf@BindistConfig{..} = do
let bindistSettings = bindistFilesDir -/- "lib" -/- "settings"
bindistContext = vanillaContext library_stage compiler
bindistSettingsContent <- interpretInContext bindistContext $
- generateSettings bindistSettings False "package.conf.d"
+ generateSettings library_stage bindistSettings False "package.conf.d"
writeFileAtomic bindistSettings bindistSettingsContent
copyDirectory rtsIncludeDir bindistFilesDir
=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -7,6 +7,7 @@ module Rules.Generate (
import Development.Shake.FilePath
import qualified Data.Set as Set
import Base
+import BindistConfig
import qualified Context
import Expression
import Hadrian.Oracles.TextFile (lookupStageBuildConfig)
@@ -275,7 +276,7 @@ generateRules = do
then root -/- stageString stage' -/- "lib"
else prefix
relPkgDb = makeRelativeNoSysLink libTopDir pkgDb
- go (generateSettings out True relPkgDb) out
+ go (generateSettings libStage out True relPkgDb) out
(prefix -/- "targets" -/- "default.target") %> \out -> go (show <$> expr (targetStage (succStage stage))) out
where
@@ -451,7 +452,9 @@ bindistRules = do
, interpolateVar "Unregisterised" $ yesNo <$> getTarget tgtUnregisterised
, interpolateVar "UseLibdw" $ fmap yesNo $ interp $ staged (fmap (isJust . tgtRTSWithLibdw) . targetStage)
, interpolateVar "UseLibffiForAdjustors" $ yesNo <$> getTarget tgtUseLibffiForAdjustors
- , interpolateVar "BaseUnitId" $ pkgUnitId Stage1 base
+ , interpolateVar "BaseUnitId" $ bindistUnitId base
+ , interpolateVar "GhcUnitId" $ bindistUnitId compiler
+ , interpolateVar "GhcInternalUnitId" $ bindistUnitId ghcInternal
, interpolateVar "GhcWithSMP" $ yesNo <$> targetSupportsSMP Stage2
, interpolateVar "TargetPlatformFull" (setting TargetPlatformFull)
, interpolateVar "BuildPlatformFull" (setting BuildPlatformFull)
@@ -460,6 +463,9 @@ bindistRules = do
where
interp = interpretInContext (semiEmptyTarget Stage2)
getTarget = interp . queryTarget Stage2
+ bindistUnitId pkg = do
+ stage <- library_stage <$> implicitBindistConfig
+ pkgUnitId stage pkg
-- | Given a 'String' replace characters '.' and '-' by underscores ('_') so that
-- the resulting 'String' is a valid C preprocessor identifier.
@@ -485,18 +491,18 @@ ghcWrapper stage = do
-- "package.conf.d"). Callers supply the correct relative path. For bindists
-- the layout is known statically; for in-tree builds callers compute it. For
-- bindists, we omit @LibDir@ so it defaults to @topDir@ at runtime.
-generateSettings :: FilePath -> Bool -> FilePath -> Expr String
-generateSettings settingsFile includeLibDir rel_pkg_db = do
+--
+-- @libraryStage@: the stage containing the target package database.
+generateSettings :: Stage -> FilePath -> Bool -> FilePath -> Expr String
+generateSettings libraryStage settingsFile includeLibDir rel_pkg_db = do
ctx <- getContext
stage <- getStage
- -- The unit-id of the base package which is always linked against (#25382)
- base_unit_id <- expr $ do
- case stage of
- Stage0 {} -> error "Unable to generate settings for stage0"
- Stage1 -> pkgUnitId Stage1 base
- Stage2 -> pkgUnitId Stage1 base
- Stage3 -> pkgUnitId Stage2 base
+ -- These are the units supplied in the target package database, which can
+ -- differ from the host units linked into a cross compiler.
+ base_unit_id <- expr $ pkgUnitId libraryStage base
+ ghc_unit_id <- expr $ pkgUnitId libraryStage compiler
+ ghc_internal_unit_id <- expr $ pkgUnitId libraryStage ghcInternal
-- For cross compilers, LibDir points to the succeeding stage's lib dir
-- (which contains the target architecture's libraries). For non-cross,
@@ -519,6 +525,8 @@ generateSettings settingsFile includeLibDir rel_pkg_db = do
, ("RTS ways", unwords . map show . Set.toList <$> getRtsWays)
, ("Relative Global Package DB", pure rel_pkg_db)
, ("base unit-id", pure base_unit_id)
+ , ("Project Unit Id", pure ghc_unit_id)
+ , ("ghc-internal Unit Id", pure ghc_internal_unit_id)
]
++ ([("LibDir", pure rel_lib_topDir) | includeLibDir])
let showTuple (k, v) = "(" ++ show k ++ ", " ++ show v ++ ")"
@@ -555,7 +563,6 @@ generateConfigHs = do
-- unit-id in both situations.
cProjectUnitId <- expr . (`pkgUnitId` compiler) =<< getStage
- cGhcInternalUnitId <- expr . (`pkgUnitId` ghcInternal) =<< getStage
return $ unlines
[ "module GHC.Settings.Config"
, " ( module GHC.Version"
@@ -565,7 +572,6 @@ generateConfigHs = do
, " , cBooterVersion"
, " , cStage"
, " , cProjectUnitId"
- , " , cGhcInternalUnitId"
, " ) where"
, ""
, "import GHC.Prelude.Basic"
@@ -589,9 +595,6 @@ generateConfigHs = do
, ""
, "cProjectUnitId :: String"
, "cProjectUnitId = " ++ show cProjectUnitId
- , ""
- , "cGhcInternalUnitId :: String"
- , "cGhcInternalUnitId = " ++ show cGhcInternalUnitId
]
where
stageString (Stage0 InTreeLibs) = "1"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fa8f57da0ec92df26aca3a86860237e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fa8f57da0ec92df26aca3a86860237e…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
11 Oct '26
Cheng Shao pushed to branch wip/wasm-jsffi-fastcall at Glasgow Haskell Compiler / GHC
Commits:
987ec79c by Cheng Shao at 2026-10-11T09:06:39+00:00
WIP
- - - - -
a4dfedb2 by Cheng Shao at 2026-10-11T09:08:32+00:00
WIP
- - - - -
32 changed files:
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- docs/users_guide/wasm.rst
- libraries/ghc-experimental/src/GHC/Wasm/Prim.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Exports.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Imports.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Types.hs
- libraries/ghci/GHCi/ObjLink.hs
- libraries/ghci/GHCi/Server.hs
- + testsuite/tests/jsffi/FastcallCrossAux.hs
- + testsuite/tests/jsffi/FastcallCrossCore.hs
- testsuite/tests/jsffi/all.T
- testsuite/tests/jsffi/bytearrayarg.hs
- + testsuite/tests/jsffi/fastcall.hs
- + testsuite/tests/jsffi/fastcall.mjs
- + testsuite/tests/jsffi/fastcall.stdout
- + testsuite/tests/jsffi/fastcall_core.hs
- + testsuite/tests/jsffi/fastcall_core.stderr
- + testsuite/tests/jsffi/fastcall_cross.hs
- + testsuite/tests/jsffi/fastcall_cross.mjs
- + testsuite/tests/jsffi/fastcall_cross.stdout
- + testsuite/tests/jsffi/fastcall_cross_core.stderr
- + testsuite/tests/jsffi/fastcall_cross_ghci.hs
- + testsuite/tests/jsffi/fastcall_cross_ghci.stdin
- + testsuite/tests/jsffi/fastcall_cross_ghci.stdout
- + testsuite/tests/jsffi/fastcall_ghci.hs
- + testsuite/tests/jsffi/fastcall_ghci.stdin
- + testsuite/tests/jsffi/fastcall_ghci.stdout
- testsuite/tests/jsffi/http.hs
- testsuite/tests/jsffi/textconv.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ad3797c3e1385c144947cfefbe803f…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ad3797c3e1385c144947cfefbe803f…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/fix-cross-ghc-info-unit-id] compiler: ensure cross ghc --info output target unid ids
by Cheng Shao (@TerrorJack) 11 Oct '26
by Cheng Shao (@TerrorJack) 11 Oct '26
11 Oct '26
Cheng Shao pushed to branch wip/fix-cross-ghc-info-unit-id at Glasgow Haskell Compiler / GHC
Commits:
b4eea0be by Cheng Shao at 2026-10-11T08:38:58+00:00
compiler: ensure cross ghc --info output target unid ids
Previously, for cross ghcs, the base/ghc/ghc-internal unit ids in
--info output do not match the target unit ids reported by ghc-pkg,
breaking cross ghc release builds with hash-unit-ids when being used
with cabal 3.18. This patch fixes it by making --info output target
unid ids. Fixes #27919.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
10 changed files:
- .gitlab/hello.hs
- + changelog.d/fix-cross-ghc-info-unit-id
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- distrib/configure.ac.in
- hadrian/bindist/Makefile
- hadrian/bindist/config.mk.in
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/Generate.hs
Changes:
=====================================
.gitlab/hello.hs
=====================================
@@ -27,7 +27,11 @@ fakeSettings =
sTargetPlatform =
genericPlatform,
sPlatformMisc = PlatformMisc {},
- sUnitSettings = UnitSettings { unitSettings_baseUnitId = stringToUnitId "base" }
+ sUnitSettings = UnitSettings
+ { unitSettings_baseUnitId = stringToUnitId "base"
+ , unitSettings_ghcUnitId = stringToUnitId "ghc"
+ , unitSettings_ghcInternalUnitId = stringToUnitId "ghc-internal"
+ }
}
fakeDynFlags :: DynFlags
=====================================
changelog.d/fix-cross-ghc-info-unit-id
=====================================
@@ -0,0 +1,4 @@
+section: compiler
+synopsis: Fix a bug where unit ids in cross ghc --info output doesn't match ghc-pkg output, breaking cross ghc releases with cabal 3.18.
+mrs: !16790
+issues: #27919
=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -546,7 +546,8 @@ opt_i dflags= toolSettings_opt_i $ toolSettings dflags
setBaseUnitId :: String -> DynP ()
-setBaseUnitId s = upd $ \d -> d { unitSettings = UnitSettings (stringToUnitId s) }
+setBaseUnitId s = upd $ \d -> d
+ { unitSettings = (unitSettings d) { unitSettings_baseUnitId = stringToUnitId s } }
-----------------------------------------------------------------------------
@@ -3663,8 +3664,6 @@ compilerInfo dflags
("Project Patch Level", cProjectPatchLevel),
("Project Patch Level1", cProjectPatchLevel1),
("Project Patch Level2", cProjectPatchLevel2),
- ("Project Unit Id", cProjectUnitId),
- ("ghc-internal Unit Id", cGhcInternalUnitId), -- See Note [Special unit-ids]
("Booter version", cBooterVersion),
("Stage", cStage),
("Build platform", cBuildPlatformString),
=====================================
compiler/GHC/Settings.hs
=====================================
@@ -94,7 +94,11 @@ data Settings = Settings
, sRawTarget :: Target
}
-data UnitSettings = UnitSettings { unitSettings_baseUnitId :: !UnitId }
+data UnitSettings = UnitSettings
+ { unitSettings_baseUnitId :: !UnitId
+ , unitSettings_ghcUnitId :: !UnitId
+ , unitSettings_ghcInternalUnitId :: !UnitId
+ }
-- | Settings for other executables GHC calls.
--
=====================================
compiler/GHC/Settings/IO.hs
=====================================
@@ -142,6 +142,8 @@ initSettings top_dir = do
ghcWithInterpreter <- getBooleanSetting "Use interpreter"
baseUnitId <- getSetting_raw "base unit-id"
+ ghcUnitId <- getSetting_raw "Project Unit Id"
+ ghcInternalUnitId <- getSetting_raw "ghc-internal Unit Id"
-- LibDir is optional. If not set, derive it from topDir. This allows
-- bindists to work without explicitly setting LibDir, but gives us the
@@ -174,6 +176,8 @@ initSettings top_dir = do
, sUnitSettings = UnitSettings
{
unitSettings_baseUnitId = stringToUnitId baseUnitId
+ , unitSettings_ghcUnitId = stringToUnitId ghcUnitId
+ , unitSettings_ghcInternalUnitId = stringToUnitId ghcInternalUnitId
}
, sToolSettings = ToolSettings
=====================================
distrib/configure.ac.in
=====================================
@@ -406,6 +406,12 @@ fi
AC_SUBST(BaseUnitId)
+dnl The units supplied with the target libraries, as reported by ghc --info.
+GhcUnitId=@GhcUnitId@
+GhcInternalUnitId=@GhcInternalUnitId@
+AC_SUBST(GhcUnitId)
+AC_SUBST(GhcInternalUnitId)
+
# We get caught by
# http://savannah.gnu.org/bugs/index.php?1516
# $(eval ...) inside conditionals causes errors
=====================================
hadrian/bindist/Makefile
=====================================
@@ -90,6 +90,8 @@ lib/settings : config.mk
@echo ',("RTS ways", "$(GhcRTSWays)")' >> $@
@echo ',("Relative Global Package DB", "package.conf.d")' >> $@
@echo ',("base unit-id", "$(BaseUnitId)")' >> $@
+ @echo ',("Project Unit Id", "$(GhcUnitId)")' >> $@
+ @echo ',("ghc-internal Unit Id", "$(GhcInternalUnitId)")' >> $@
@echo "]" >> $@
lib/targets/default.target : config.mk default.target
=====================================
hadrian/bindist/config.mk.in
=====================================
@@ -134,6 +134,8 @@ CrossCompilePrefix = @CrossCompilePrefix@
GhcUnregisterised = @Unregisterised@
EnableDistroToolchain = @EnableDistroToolchain@
BaseUnitId = @BaseUnitId@
+GhcUnitId = @GhcUnitId@
+GhcInternalUnitId = @GhcInternalUnitId@
# The THREADED_RTS requires `BaseReg` to be in a register and the
# `GhcUnregisterised` mode doesn't allow that.
=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -232,7 +232,7 @@ buildBinDistDir root conf@BindistConfig{..} = do
let bindistSettings = bindistFilesDir -/- "lib" -/- "settings"
bindistContext = vanillaContext library_stage compiler
bindistSettingsContent <- interpretInContext bindistContext $
- generateSettings bindistSettings False "package.conf.d"
+ generateSettings library_stage bindistSettings False "package.conf.d"
writeFileAtomic bindistSettings bindistSettingsContent
copyDirectory rtsIncludeDir bindistFilesDir
=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -7,6 +7,7 @@ module Rules.Generate (
import Development.Shake.FilePath
import qualified Data.Set as Set
import Base
+import BindistConfig
import qualified Context
import Expression
import Hadrian.Oracles.TextFile (lookupStageBuildConfig)
@@ -275,7 +276,7 @@ generateRules = do
then root -/- stageString stage' -/- "lib"
else prefix
relPkgDb = makeRelativeNoSysLink libTopDir pkgDb
- go (generateSettings out True relPkgDb) out
+ go (generateSettings libStage out True relPkgDb) out
(prefix -/- "targets" -/- "default.target") %> \out -> go (show <$> expr (targetStage (succStage stage))) out
where
@@ -451,7 +452,9 @@ bindistRules = do
, interpolateVar "Unregisterised" $ yesNo <$> getTarget tgtUnregisterised
, interpolateVar "UseLibdw" $ fmap yesNo $ interp $ staged (fmap (isJust . tgtRTSWithLibdw) . targetStage)
, interpolateVar "UseLibffiForAdjustors" $ yesNo <$> getTarget tgtUseLibffiForAdjustors
- , interpolateVar "BaseUnitId" $ pkgUnitId Stage1 base
+ , interpolateVar "BaseUnitId" $ bindistUnitId base
+ , interpolateVar "GhcUnitId" $ bindistUnitId compiler
+ , interpolateVar "GhcInternalUnitId" $ bindistUnitId ghcInternal
, interpolateVar "GhcWithSMP" $ yesNo <$> targetSupportsSMP Stage2
, interpolateVar "TargetPlatformFull" (setting TargetPlatformFull)
, interpolateVar "BuildPlatformFull" (setting BuildPlatformFull)
@@ -460,6 +463,9 @@ bindistRules = do
where
interp = interpretInContext (semiEmptyTarget Stage2)
getTarget = interp . queryTarget Stage2
+ bindistUnitId pkg = do
+ stage <- library_stage <$> implicitBindistConfig
+ pkgUnitId stage pkg
-- | Given a 'String' replace characters '.' and '-' by underscores ('_') so that
-- the resulting 'String' is a valid C preprocessor identifier.
@@ -485,18 +491,18 @@ ghcWrapper stage = do
-- "package.conf.d"). Callers supply the correct relative path. For bindists
-- the layout is known statically; for in-tree builds callers compute it. For
-- bindists, we omit @LibDir@ so it defaults to @topDir@ at runtime.
-generateSettings :: FilePath -> Bool -> FilePath -> Expr String
-generateSettings settingsFile includeLibDir rel_pkg_db = do
+--
+-- @libraryStage@: the stage containing the target package database.
+generateSettings :: Stage -> FilePath -> Bool -> FilePath -> Expr String
+generateSettings libraryStage settingsFile includeLibDir rel_pkg_db = do
ctx <- getContext
stage <- getStage
- -- The unit-id of the base package which is always linked against (#25382)
- base_unit_id <- expr $ do
- case stage of
- Stage0 {} -> error "Unable to generate settings for stage0"
- Stage1 -> pkgUnitId Stage1 base
- Stage2 -> pkgUnitId Stage1 base
- Stage3 -> pkgUnitId Stage2 base
+ -- These are the units supplied in the target package database, which can
+ -- differ from the host units linked into a cross compiler.
+ base_unit_id <- expr $ pkgUnitId libraryStage base
+ ghc_unit_id <- expr $ pkgUnitId libraryStage compiler
+ ghc_internal_unit_id <- expr $ pkgUnitId libraryStage ghcInternal
-- For cross compilers, LibDir points to the succeeding stage's lib dir
-- (which contains the target architecture's libraries). For non-cross,
@@ -519,6 +525,8 @@ generateSettings settingsFile includeLibDir rel_pkg_db = do
, ("RTS ways", unwords . map show . Set.toList <$> getRtsWays)
, ("Relative Global Package DB", pure rel_pkg_db)
, ("base unit-id", pure base_unit_id)
+ , ("Project Unit Id", pure ghc_unit_id)
+ , ("ghc-internal Unit Id", pure ghc_internal_unit_id)
]
++ ([("LibDir", pure rel_lib_topDir) | includeLibDir])
let showTuple (k, v) = "(" ++ show k ++ ", " ++ show v ++ ")"
@@ -555,7 +563,6 @@ generateConfigHs = do
-- unit-id in both situations.
cProjectUnitId <- expr . (`pkgUnitId` compiler) =<< getStage
- cGhcInternalUnitId <- expr . (`pkgUnitId` ghcInternal) =<< getStage
return $ unlines
[ "module GHC.Settings.Config"
, " ( module GHC.Version"
@@ -565,7 +572,6 @@ generateConfigHs = do
, " , cBooterVersion"
, " , cStage"
, " , cProjectUnitId"
- , " , cGhcInternalUnitId"
, " ) where"
, ""
, "import GHC.Prelude.Basic"
@@ -589,9 +595,6 @@ generateConfigHs = do
, ""
, "cProjectUnitId :: String"
, "cProjectUnitId = " ++ show cProjectUnitId
- , ""
- , "cGhcInternalUnitId :: String"
- , "cGhcInternalUnitId = " ++ show cGhcInternalUnitId
]
where
stageString (Stage0 InTreeLibs) = "1"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b4eea0bef71863aab3244879a92822e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b4eea0bef71863aab3244879a92822e…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/rafl/hpc-instances] 2 commits: Clarify why we're not excluding all generated code (yet!)
by Florian Ragwitz (@rafl) 11 Oct '26
by Florian Ragwitz (@rafl) 11 Oct '26
11 Oct '26
Florian Ragwitz pushed to branch wip/rafl/hpc-instances at Glasgow Haskell Compiler / GHC
Commits:
45174db5 by Florian Ragwitz at 2026-10-11T00:21:37-07:00
Clarify why we're not excluding all generated code (yet!)
- - - - -
0c06dab6 by Florian Ragwitz at 2026-10-11T00:25:19-07:00
Minor documentation tweaks
- - - - -
3 changed files:
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Types/Id/Info.hs
- libraries/containers
Changes:
=====================================
compiler/GHC/HsToCore/Ticks.hs
=====================================
@@ -312,6 +312,8 @@ addTickLHsBind (L pos (funBind@(FunBind { fun_id = L _ id, fun_matches = matches
exported = idName id `elemNameSet` exported_names
-- See Note [Instance Method Coverage].
+ -- We only exclude generated instance methods for now, not generated code in
+ -- general, whose coverage semantics may need to be considered separately.
let generatedInstMeth = tickishType env == HpcTicks
&& id `elemVarEnv` instMeths env
&& isGenerated (mg_origin (mg_ext matches))
=====================================
compiler/GHC/Types/Id/Info.hs
=====================================
@@ -222,9 +222,10 @@ data IdDetails
-- - the [CbvMark] is always empty (and ignored) until after Tidy
-- for ids from the current module
-- - If non-empty, at least is isMarkedCbbv; see (CBV2)
- | InstMethId Name
- -- ^ An instance method. The 'Name' identifies the dictionary of the
- -- instance it belongs to.
+ | InstMethId
+ -- ^ An instance method.
+ Name
+ -- ^ 'Name' of the dictionary function the instance it belongs to.
data RecSelInfo
= RSI { rsi_def :: [ConLike] -- Record selector defined for these
=====================================
libraries/containers
=====================================
@@ -1 +1 @@
-Subproject commit 953428ad079d5708df696442f9bdeaccd1acfc6c
+Subproject commit 801b06e5d4392b028e519d5ca116a2881d559721
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ebc8c2bba1ab0a30892e8b6f1609a8…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ebc8c2bba1ab0a30892e8b6f1609a8…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/rafl/hpc-instances] 18 commits: ci: move hadrian/ghci into the lint category so it can be picked up by more runners
by Florian Ragwitz (@rafl) 11 Oct '26
by Florian Ragwitz (@rafl) 11 Oct '26
11 Oct '26
Florian Ragwitz pushed to branch wip/rafl/hpc-instances at Glasgow Haskell Compiler / GHC
Commits:
15ece296 by mangoiv at 2026-10-08T15:14:56-04:00
ci: move hadrian/ghci into the lint category so it can be picked up by more runners
Fixes #27817
- - - - -
c0823135 by mangoiv at 2026-10-08T15:14:56-04:00
ci: make lint-adjacent jobs into platform independent
- move lint jobs into lint-anyarch tag
- unify lint jobs under the same platform independent container
- - - - -
f76464cf by Zubin Duggal at 2026-10-08T15:15:39-04:00
DmdAnal: Make AbsDmd neutral in maxDmd
fixes #27845
- - - - -
ffa56ae4 by sheaf at 2026-10-09T17:15:59+02:00
Preserve sign of zero when parsing -0.0#
This commit leverages the recently added GHC.Types.Literal.Floating
module in order to preserve the sign of negative zero from
source-written floating-point literals.
Fixes #27545
- - - - -
d538cac9 by Facundo Domínguez at 2026-10-09T20:26:38-04:00
Propagate annotations to simple interfaces
This allows annotations to be visible to plugins when run by
haddock. The LiquidHaskell plugin needs the annotations, in particular.
Fixes #26761
- - - - -
32c4f4ab by meooow25 at 2026-10-09T20:27:28-04:00
Bump containers submodule to 0.8.1
And fix affected tests.
* T4086a: containers depends on template-haskell-lift now instead of
template-haskell.
* T22611: Updated to be less dependent on containers internals.
- - - - -
c786065e by sheaf at 2026-10-09T20:28:20-04:00
Use an explicit pattern match in toIfaceIdDetails
The old wildcard pattern let this code bit rot: it did not properly account
for recently added 'IdDetails' such as 'RepPolyId', which resulted in
spurious 'pprTrace' messages that could even pollute HLS sessions.
Fixes #23785
- - - - -
e7cacf59 by sheaf at 2026-10-09T20:29:09-04:00
Take into account ifKind in freeNamesIfDecl
Commit 3c2f4bb4 added the 'ifKind' field to various constructors
of 'IfaceDecl', which preserves the original kind (before type synonym
expansion) for better error messages.
However, that commit forgot to update 'freeNamesIfDecl' correspondingly.
This could result in a "urk! lookup local fingerpring" crash when e.g.
a type's kind uses a type synonym defined later, as we failed to add a
dependency on the type synonym during dependency analysis.
Fixes #27916
- - - - -
ca5317f5 by Florian Ragwitz at 2026-10-11T00:08:21-07:00
hpc: Test desired HPC behaviour for class instances
- - - - -
3e4d7161 by Florian Ragwitz at 2026-10-11T00:08:21-07:00
Extend TcGblEnv with a mapping from instance method Ids to DFunIds
We want to use this in HPC to provide better support for instance methods.
This is working towards #17155.
- - - - -
0f3d8cb8 by Florian Ragwitz at 2026-10-11T00:08:22-07:00
hpc: Do not create top-level boxes for generated instance methods
Users care about which of their written methods are or aren't covered, not
whether all of the inherited methods are covered as well. Those should be
covered where they are implemented.
We achieve that by stopping to generate top-level boxes which will often appear
as uncovered with no clear indication as to why, and no way to fix other than
excercising code the user has not written.
Fixes #17155, #15932.
- - - - -
fbbdbd13 by Florian Ragwitz at 2026-10-11T00:08:22-07:00
hpc: Provide coverage information for class instances
After fixing #17155, we no longer create top-level boxes for the source spans
of instance heads (previously that was the source span used for
inherited/generated instance methods).
With those boxes gone, we can introduce a new top-level box for each class
instance with that instance head source span, and provide more meaningful
coverage semantics for it.
We make the use of any of the instance's methods (user-written or generated)
tick this box, providing the programmer with useful information about whether
or not the instance was exercised at run-time, and whether the instance might
be unnecessary.
- - - - -
aa5e387c by Florian Ragwitz at 2026-10-11T00:08:22-07:00
hpc: Don't allocate boxes for methodless classes
With the plumbing we currently have, these could never be covered, which is not
helpful to hpc users. This could be improved upon further.
- - - - -
0d77a60b by Florian Ragwitz at 2026-10-11T00:08:22-07:00
Add a changelog entry for new HPC features
- - - - -
fb2d59a3 by Florian Ragwitz at 2026-10-11T00:10:18-07:00
Remove tcg_inst_meths in favour of a new IdDetails constructor
Thanks for this great suggestion, Sam! <3
- - - - -
2ec6543b by Florian Ragwitz at 2026-10-11T00:10:27-07:00
Revert back to just using getOccString for DFunIds
- - - - -
0bcada46 by Florian Ragwitz at 2026-10-11T00:10:27-07:00
Limit instance and instance method coverage to HPC only
It's not useful for SourceNotes, which is the other tickishType included in
TickForCoverage.
- - - - -
ebc8c2bb by Florian Ragwitz at 2026-10-11T00:10:27-07:00
Limit record selector ticking to HPC
- - - - -
50 changed files:
- .gitlab-ci.yml
- + changelog.d/26761
- + changelog.d/27845
- + changelog.d/T23785
- + changelog.d/T27545
- + changelog.d/T27916
- + changelog.d/hpc-classinsts
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- libraries/containers
- + testsuite/tests/dmdanal/should_run/T27845.hs
- + testsuite/tests/dmdanal/should_run/T27845.stdout
- + testsuite/tests/dmdanal/should_run/T27845_Lib.hs
- + testsuite/tests/dmdanal/should_run/T27845b.hs
- + testsuite/tests/dmdanal/should_run/T27845b.stdout
- + testsuite/tests/dmdanal/should_run/T27845b_Lib.hs
- testsuite/tests/dmdanal/should_run/all.T
- + testsuite/tests/hpc/instmeths/instmeths.hs
- + testsuite/tests/hpc/instmeths/instmeths.stdout
- + testsuite/tests/hpc/instmeths/test.T
- + testsuite/tests/numeric/should_run/T27545.hs
- + testsuite/tests/numeric/should_run/T27545.stdout
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/package/T4806a.stderr
- testsuite/tests/package/all.T
- + testsuite/tests/plugins/T26761.hs
- + testsuite/tests/plugins/T26761.stderr
- + testsuite/tests/plugins/T26761Plugin.hs
- + testsuite/tests/plugins/T26761a.hs
- testsuite/tests/plugins/all.T
- testsuite/tests/simplCore/should_compile/T22375.stderr
- testsuite/tests/simplCore/should_compile/T22375DataFamily.stderr
- testsuite/tests/simplCore/should_compile/T22611.hs
- testsuite/tests/simplCore/should_compile/T22611.stderr
- + testsuite/tests/simplCore/should_compile/T22611a.hs
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/typecheck/should_compile/T27916.hs
- testsuite/tests/typecheck/should_compile/all.T
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a9c4f52b35b88ae900ac31fdec3f1c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a9c4f52b35b88ae900ac31fdec3f1c…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/supersven/hadrian-cross-stage3] 8 commits: ci: Build Stage3 and Stage2 bindists for cross targets in one job (#26924)
by Sven Tennie (@supersven) 11 Oct '26
by Sven Tennie (@supersven) 11 Oct '26
11 Oct '26
Sven Tennie pushed to branch wip/supersven/hadrian-cross-stage3 at Glasgow Haskell Compiler / GHC
Commits:
10c23983 by Sven Tennie at 2026-10-11T06:54:09+00:00
ci: Build Stage3 and Stage2 bindists for cross targets in one job (#26924)
Building the stage3 target bindist already produces most of the stage2
cross-compiler bindist as a byproduct, so building them in separate jobs
duplicates the build efforts for no benefit. Instead of a separate
CROSS_STAGE=3 job, the stage3 job now also builds and publishes the
stage2 bindist.
The stage3 tarball is named and versioned as if it were built natively
on the target (target triple prefix, non-cross opsys), so its artifact
name stays what downstream consumers already expect and no changes are
needed on their side.
For now, this is only enabled for the RISC-V job. Others can easily
follow.
- - - - -
ceaa3ddb by Sven Tennie at 2026-10-11T06:54:09+00:00
ci: model cross targets as structured TargetPlatform triples
Storing the cross target as a raw triple forced ad-hoc parsing at every
use, and broke the single responsibility rule. Modelling it as a
structured `TargetPlatform`` instead, avoids parsing and provides a
clear separation of concerns.
- - - - -
d0570c3e by Sven Tennie at 2026-10-11T06:54:09+00:00
ci: use a scalar cross-stage switch, FINAL_CROSS_STAGE=2|3
For cross-compilers, Stage2 bindists are (almost) a by-product of Stage3
bindists. Thus, we either build Stage2 or Stage2 + Stage3 bindists. The
commit at hand reflects this fact in types.
- - - - -
2c7a99fc by Sven Tennie at 2026-10-11T06:54:27+00:00
ci: extract the cross smoke tests into a separate smoke_test command
This reduces if-nesting and complexity of the main `test_hadrian`
command. The decision how to test is now made by the caller. This is a
fair choice, because most test cases can run under emulation - they are
just very slow then.
- - - - -
cf4361ca by Sven Tennie at 2026-10-11T06:54:28+00:00
ci: inline the FINAL_CROSS_STAGE renderer
`finalCrossStageEnvVal` was small and only used in one place.
- - - - -
f4e45edd by Sven Tennie at 2026-10-11T06:54:28+00:00
hadrian: clarify cross-stage settings and project.mk comments
Reword the settings-rule comment to name the two stage roles
(compilerStage vs libraryStage) and explain what 'the final
architecture' in terms of project.mk generation means.
- - - - -
119a2f36 by Sven Tennie at 2026-10-11T06:54:34+00:00
Fix intepreter settings for native target bindists
Stage3 cross-compiled bindists wrongly assumed they cannot run the
interpreter natively. Fix this by adjusting compile flags and choosing
the correct libs/target/default.target files per compiler stage.
- - - - -
28789d48 by Sven Tennie at 2026-10-11T09:02:38+02:00
Generate default.target only from the successor stage for stage0
This mirrors the behaviour for the settings' rules. Reflects that Stage0
compilers depend on the Stage1 lib/ dir.
- - - - -
6 changed files:
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Packages.hs
Changes:
=====================================
.gitlab/ci.sh
=====================================
@@ -62,9 +62,10 @@ Common Modes:
Environment variables affecting the build:
CROSS_TARGET Triple of cross-compilation target.
- CROSS_STAGE The stage of the cross-compiler to build either
- * 2: Build a normal cross-compiler bindist
- * 3: Build a target executable bindist (with the stage2 cross-compiler)
+ FINAL_CROSS_STAGE The final stage of the cross-compiler to build either
+ * 2: Build a cross-compiler bindist
+ * 3: Also build the target executable bindist
+ (builds stages 2 and 3; implies the bindist of 2)
VERBOSE Set to non-empty for verbose build output
RUNTEST_ARGS Arguments passed to runtest.py
TEST_WAYS Testsuite ways to run
@@ -573,10 +574,17 @@ function build_hadrian() {
export XZ_OPT="${XZ_OPT:-} -T$cores"
fi
- case "${CROSS_STAGE:-2}" in
+ case "${FINAL_CROSS_STAGE:-2}" in
2) BINDIST_TARGET="binary-dist";;
- 3) BINDIST_TARGET="binary-dist-stage3";;
- *) fail "Unknown CROSS_STAGE, must be 2 or 3";;
+ # Stage2 bindists are (almost) a byproduct of Stage3 bindists. So, we
+ # bundle both of them when the Stage3 bindist is built.
+ 3)
+ BINDIST_TARGET="binary-dist binary-dist-stage3"
+ if [[ -z "${BIN_DIST_NAME_STAGE3:-}" ]]; then
+ fail "FINAL_CROSS_STAGE=3 requires BIN_DIST_NAME_STAGE3 to be set"
+ fi
+ ;;
+ *) fail "Unknown FINAL_CROSS_STAGE, must be 2 or 3";;
esac
if [[ -n "${REINSTALL_GHC:-}" ]]; then
@@ -590,6 +598,9 @@ function build_hadrian() {
*)
run_hadrian test:all_deps $BINDIST_TARGET
mv _build/bindist/ghc*.tar.xz "$BIN_DIST_NAME.tar.xz"
+ if [[ "${FINAL_CROSS_STAGE:-2}" == "3" ]]; then
+ mv _build/bindist-stage3/ghc*.tar.xz "$BIN_DIST_NAME_STAGE3.tar.xz"
+ fi
;;
esac
fi
@@ -648,6 +659,74 @@ function install_bindist() {
end_section install-bindist
}
+# Smoke-test the cross-compiled Stage2 and Stage2 bindists using the emulator.
+# For cross jobs with a working emulator this runs instead of `test_hadrian`
+# as a separate validation step after the build.
+function smoke_test() {
+ check_msys2_deps _build/stage1/bin/ghc --version
+ check_release_build
+
+ if [[ "${CROSS_EMULATOR:-}" == "NOT_SET" ]]; then
+ info "Cannot test cross-compiled build without CROSS_EMULATOR being set."
+ return
+ fi
+
+ local instdir="$TOP/_build/install"
+ local test_compiler="$instdir/bin/${cross_prefix}ghc$exe"
+ install_bindist _build/bindist/ghc-*/ "$instdir"
+ echo 'main = putStrLn "hello world"' > expected
+ run "$test_compiler" -package ghc "$TOP/.gitlab/hello.hs" -o hello
+
+ if [[ "${CROSS_TARGET:-no_cross_target}" =~ "mingw" ]]; then
+ ${CROSS_EMULATOR:-} ./hello.exe > actual
+ else
+ ${CROSS_EMULATOR:-} ./hello > actual
+ fi
+
+ # We have to use `-w` to make the test more stable across supported
+ # platforms, i.e. Windows:
+ # $ cmp expected actual
+ # differ: byte 30, line 1
+ # $ diff expected actual
+ # 1c1
+ # < main = putStrLn "hello world"
+ # ---
+ # > main = putStrLn "hello world"
+ run diff -w expected actual
+
+ if [[ "${FINAL_CROSS_STAGE:-2}" == "3" ]]; then
+ local stage3_dir
+ stage3_dir="$(echo _build/bindist-stage3/ghc-*/)"
+ local stage3_ghc="$stage3_dir/bin/ghc$exe"
+
+ info "Smoke-testing stage3 compiler..."
+ run ${CROSS_EMULATOR} "$stage3_ghc" --info > stage3-info
+ cat stage3-info
+
+ # The stage3 compiler is a native target compiler: it must not consider
+ # itself a cross-compiler, and GHCi support must be compiled in when the
+ # target supports it.
+ grep -q '"cross compiling","NO"' stage3-info \
+ || fail "stage3 compiler reports itself as cross-compiling"
+
+ if grep -q '"Use interpreter","YES"' stage3-info; then
+ echo 'ghci works' > ghci-expected
+ ${CROSS_EMULATOR:-} "$stage3_ghc" -e 'putStrLn "ghci works"' > ghci-actual
+ run diff -w ghci-expected ghci-actual
+ fi
+
+ run ${CROSS_EMULATOR} "$stage3_ghc" -package ghc "$TOP/.gitlab/hello.hs" -o hello-stage3
+
+ if [[ "${CROSS_TARGET:-no_cross_target}" =~ "mingw" ]]; then
+ ${CROSS_EMULATOR:-} ./hello-stage3.exe > actual-stage3
+ else
+ ${CROSS_EMULATOR:-} ./hello-stage3 > actual-stage3
+ fi
+
+ run diff -w expected actual-stage3
+ fi
+}
+
function test_hadrian() {
check_msys2_deps _build/stage1/bin/ghc --version
check_release_build
@@ -672,35 +751,7 @@ function test_hadrian() {
fi
fi
-
- if [[ "${CROSS_EMULATOR:-}" == "NOT_SET" ]]; then
- info "Cannot test cross-compiled build without CROSS_EMULATOR being set."
- return
- # If we have set CROSS_EMULATOR, then can't test using normal testsuite.
- elif [ -n "${CROSS_EMULATOR:-}" ] && [[ "${CROSS_TARGET:-}" != *"wasm"* ]]; then
- local instdir="$TOP/_build/install"
- local test_compiler="$instdir/bin/${cross_prefix}ghc$exe"
- install_bindist _build/bindist/ghc-*/ "$instdir"
- echo 'main = putStrLn "hello world"' > expected
- run "$test_compiler" -package ghc "$TOP/.gitlab/hello.hs" -o hello
-
- if [[ "${CROSS_TARGET:-no_cross_target}" =~ "mingw" ]]; then
- ${CROSS_EMULATOR:-} ./hello.exe > actual
- else
- ${CROSS_EMULATOR:-} ./hello > actual
- fi
-
- # We have to use `-w` to make the test more stable across supported
- # platforms, i.e. Windows:
- # $ cmp expected actual
- # differ: byte 30, line 1
- # $ diff expected actual
- # 1c1
- # < main = putStrLn "hello world"
- # ---
- # > main = putStrLn "hello world"
- run diff -w expected actual
- elif [[ -n "${REINSTALL_GHC:-}" ]]; then
+ if [[ -n "${REINSTALL_GHC:-}" ]]; then
run_hadrian \
test \
--test-root-dirs=testsuite/tests/stage1 \
@@ -1131,6 +1182,7 @@ case ${1:-help} in
time_it "test" test_hadrian || res=$?
push_perf_notes
exit $res ;;
+ smoke_test) time_it "smoke-test" smoke_test ;;
run_hadrian) shift; run_hadrian "$@" ;;
perf_test) run_perf_test ;;
abi_test) abi_test ;;
=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -110,26 +110,49 @@ data Opsys
= Linux LinuxDistro
| Darwin
| FreeBSD14
- | Windows deriving (Eq)
+ | Windows deriving (Eq, Show)
data LinuxDistro
= Debian13
| Debian12
- | Debian12Wine
- | Debian13Riscv
| Debian11
- | Debian11Js
| Fedora43
- | Ubuntu2404LoongArch64
| Ubuntu2404
| Ubuntu2204
| Alpine312
| Alpine323
- | AlpineWasm
| Rocky8
- deriving (Eq)
-
-data Arch = Amd64 | AArch64 | I386
+ deriving (Eq, Show)
+
+data Arch = Amd64 | AArch64 | I386 | RiscV64 | LoongArch | Wasm32 | JavaScript
+ deriving (Show)
+
+-- | Describes what the docker image is for: the development flavour of the
+-- build environment, orthogonal to the image's own architecture ('Arch').
+-- E.g. @FlavorRiscV@ denotes the image that carries the RISC-V cross
+-- toolchain.
+data ImageFlavor
+ = FlavorVanilla
+ | FlavorRiscV
+ | FlavorLoongArch
+ | FlavorWine
+ | FlavorEmscripten
+ | FlavorWasm
+ deriving (Eq, Show)
+
+-- | OS element of a configure target triple: this is the OS of the *target*
+-- platform, not the build environment (that is 'Opsys'/'LinuxDistro').
+data TargetOs
+ = TargetOsLinuxGnu
+ | TargetOsGhcjs
+ | TargetOsMingw32
+ | TargetOsWasi
+ deriving (Eq, Show)
+
+data TargetPlatform = TargetPlatform
+ { tpArch :: Arch -- ^ target architecture, e.g. 'RiscV64'
+ , tpOs :: TargetOs -- ^ target OS, e.g. 'TargetOsLinuxGnu'
+ }
data BignumBackend = Native | Gmp deriving Eq
@@ -158,8 +181,8 @@ data BuildConfig
, withAssertions :: Bool
, withNuma :: Bool
, withZstd :: Bool
- , crossTarget :: Maybe String
- , crossStage :: Maybe Int
+ , crossTarget :: Maybe TargetPlatform
+ , crossStages :: Maybe CrossStages
, crossEmulator :: CrossEmulator
, configureWrapper :: Maybe String
, fullyStatic :: Bool
@@ -180,7 +203,7 @@ configureArgsStr bc = unwords $
["--enable-unregisterised"| unregisterised bc ]
++ ["--disable-tables-next-to-code" | not (tablesNextToCode bc) ]
++ ["--with-intree-gmp" | Just _ <- [crossTarget bc] ]
- ++ ["--with-system-libffi" | crossTarget bc == Just "wasm32-wasi" ]
+ ++ ["--with-system-libffi" | (tpOs <$> crossTarget bc) == Just TargetOsWasi ]
++ ["--enable-ipe-data-compression" | withZstd bc ]
++ ["--enable-strict-ghc-toolchain-check"]
@@ -229,7 +252,7 @@ vanilla = BuildConfig
, withNuma = False
, withZstd = False
, crossTarget = Nothing
- , crossStage = Nothing
+ , crossStages = Nothing
, crossEmulator = NoEmulator
, configureWrapper = Nothing
, fullyStatic = False
@@ -275,17 +298,54 @@ static = vanilla { fullyStatic = True }
staticNativeInt :: BuildConfig
staticNativeInt = static { bignumBackend = Native }
-crossConfig :: String -- ^ target triple
+-- | The cross stages a build produces binary distributions for
+data CrossStages
+ = -- | Builds a cross-compiler (build == host, host /= target):
+ -- its bindist runs on the build host.
+ Stage2
+ | -- | Implies `Stage2` and additionally builds a cross-compiled compiler
+ -- (build /= host, host == target).
+ Stage2And3
+ deriving stock (Eq, Ord)
+
+crossConfig :: TargetPlatform -- ^ target platform
-> CrossEmulator -- ^ emulator for testing
-> Maybe String -- ^ Configure wrapper
+ -> CrossStages -- ^ final cross stages to build bindists for
-> BuildConfig
-crossConfig triple emulator configure_wrapper =
- vanilla { crossTarget = Just triple
- , crossStage = Just 2
+crossConfig targetPlatform emulator configure_wrapper crossStage =
+ vanilla { crossTarget = Just targetPlatform
+ , crossStages = Just crossStage
, crossEmulator = emulator
, configureWrapper = configure_wrapper
}
+-- | The docker image flavour of a build, derived from its cross target
+-- (the image must carry the target's toolchain) or 'FlavorVanilla' for
+-- plain builds.
+buildFlavor :: BuildConfig -> ImageFlavor
+buildFlavor bc = maybe FlavorVanilla flavorOf (crossTarget bc)
+ where
+ flavorOf :: TargetPlatform -> ImageFlavor
+ flavorOf TargetPlatform{ tpArch = arch, tpOs = os } = case (arch, os) of
+ (AArch64, TargetOsLinuxGnu) -> FlavorVanilla
+ (AArch64, TargetOsMingw32) -> FlavorWine
+ (RiscV64, TargetOsLinuxGnu) -> FlavorRiscV
+ (LoongArch, TargetOsLinuxGnu) -> FlavorLoongArch
+ (Wasm32, TargetOsWasi) -> FlavorWasm
+ (JavaScript, TargetOsGhcjs) -> FlavorEmscripten
+ _ -> error $
+ "flavorOf: no image flavour for target " ++ show arch ++ "/" ++ show os
+
+-- | The configure target triple the build system consumes, e.g.
+-- @"riscv64-linux-gnu"@.
+renderTriple :: TargetPlatform -> String
+renderTriple TargetPlatform{ tpArch = arch, tpOs = os } = case os of
+ TargetOsLinuxGnu -> archName arch ++ "-linux-gnu"
+ TargetOsGhcjs -> archName arch ++ "-unknown-ghcjs"
+ TargetOsMingw32 -> archName arch ++ "-unknown-mingw32"
+ TargetOsWasi -> archName arch ++ "-wasi"
+
llvm :: BuildConfig
llvm = vanilla { llvmBootstrap = True, testsuiteWays = ["llvm", "optllvm"] }
@@ -307,16 +367,16 @@ usePerfProfilingTestsuite bc = bc { testsuiteUsePerf = True }
-- | These tags have to match what we call the runners on gitlab
runnerTag :: Arch -> Opsys -> String
-runnerTag arch (Linux _) =
- case arch of
- Amd64 -> "x86_64-linux"
- AArch64 -> "aarch64-linux"
- I386 -> "x86_64-linux"
-runnerTag AArch64 Darwin = "aarch64-darwin"
-runnerTag Amd64 Darwin = "x86_64-darwin-m1"
-runnerTag Amd64 Windows = "new-x86_64-windows"
-runnerTag Amd64 FreeBSD14 = "x86_64-freebsd14"
-runnerTag _ _ = error "Invalid arch/opsys"
+runnerTag arch opsys = case (arch, opsys) of
+ (Amd64, Linux{}) -> "x86_64-linux"
+ (AArch64, Linux{}) -> "aarch64-linux"
+ (I386, Linux{}) -> "x86_64-linux"
+ (AArch64, Darwin) -> "aarch64-darwin"
+ (Amd64, Darwin) -> "x86_64-darwin-m1"
+ (Amd64, Windows) -> "new-x86_64-windows"
+ (Amd64, FreeBSD14) -> "x86_64-freebsd14"
+ _ -> error $ "runnerTag: no runner for "
+ ++ show arch ++ "/" ++ show opsys
tags :: Arch -> Opsys -> BuildConfig -> [String]
tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use
@@ -324,52 +384,92 @@ tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use
runnerPerfTag :: Arch -> Opsys -> String
runnerPerfTag arch sys = runnerTag arch sys ++ "-perf"
--- These names are used to find the docker image so they have to match what is
--- in the docker registry.
+-- | These names are used to find the docker image so they have to match what
+-- is in the docker registry.
distroName :: LinuxDistro -> String
distroName Debian13 = "deb13"
distroName Debian12 = "deb12"
distroName Debian11 = "deb11"
-distroName Debian11Js = "deb11-emsdk-closure"
-distroName Debian13Riscv = "deb13-riscv"
-distroName Debian12Wine = "deb12-wine"
distroName Fedora43 = "fedora43"
-distroName Ubuntu2404LoongArch64 = "ubuntu24_04-loongarch"
distroName Ubuntu2204 = "ubuntu22_04"
distroName Ubuntu2404 = "ubuntu24_04"
distroName Alpine312 = "alpine3_12"
distroName Alpine323 = "alpine3_23"
-distroName AlpineWasm = "alpine3_23-wasm"
distroName Rocky8 = "rocky8"
-opsysName :: Opsys -> String
-opsysName (Linux distro) = "linux-" ++ distroName distro
-opsysName Darwin = "darwin"
-opsysName FreeBSD14 = "freebsd14"
-opsysName Windows = "windows"
+-- | The distro tag used in docker image names, extended with the toolchain
+-- suffix of the image flavour (e.g. 'Debian13'' + 'FlavorRiscV' ->
+-- @"deb13-riscv"@).
+distroImageTag :: LinuxDistro -> ImageFlavor -> String
+distroImageTag distro flavor = distroName distro ++ flavorSuffix flavor
+ where
+ flavorSuffix :: ImageFlavor -> String
+ flavorSuffix FlavorVanilla = ""
+ flavorSuffix FlavorRiscV = "-riscv"
+ flavorSuffix FlavorLoongArch = "-loongarch"
+ flavorSuffix FlavorWine = "-wine"
+ flavorSuffix FlavorEmscripten = "-emsdk-closure"
+ flavorSuffix FlavorWasm = "-wasm"
+
+-- | OS name as it appears for job identity and docker image tags, qualified
+-- by the working image flavour if any (e.g. @"linux-deb13-riscv"@).
+opsysNameWithFlavor :: Opsys -> ImageFlavor -> String
+opsysNameWithFlavor (Linux distro) flavor = "linux-" ++ distroImageTag distro flavor
+opsysNameWithFlavor opsys _ = opsysName opsys
+ where
+ opsysName :: Opsys -> String
+ opsysName (Linux distro) = "linux-" ++ distroName distro
+ opsysName Darwin = "darwin"
+ opsysName FreeBSD14 = "freebsd14"
+ opsysName Windows = "windows"
archName :: Arch -> String
-archName Amd64 = "x86_64"
-archName AArch64 = "aarch64"
-archName I386 = "i386"
+archName Amd64 = "x86_64"
+archName AArch64 = "aarch64"
+archName I386 = "i386"
+archName RiscV64 = "riscv64"
+archName LoongArch = "loongarch64"
+archName Wasm32 = "wasm32"
+archName JavaScript = "javascript"
binDistName :: Arch -> Opsys -> BuildConfig -> String
-binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc
+binDistName arch opsys bc = "ghc-" ++ testEnvWith (archName arch) opsys bc
+
+-- | Name of the stage3 (target-platform) bindist.
+--
+-- Because that bindist lives on its target, it is named as if built natively
+-- on the target: target architecture, the OS of the job, and no
+-- cross/toolchain flavour markers.
+stage3BinDistName :: Opsys -> BuildConfig -> Maybe String
+stage3BinDistName opsys bc
+ | buildsTargetBindist
+ , Just TargetPlatform{ tpArch = arch } <- crossTarget bc
+ = Just $ binDistName arch opsys (bc { crossTarget = Nothing })
+ | otherwise
+ = Nothing
+ where
+ -- Whether any bindist produced by this build configuration runs on its
+ -- target platform rather than on the build host.
+ buildsTargetBindist :: Bool
+ buildsTargetBindist = crossStages bc == Just Stage2And3
-- | Test env should create a string which changes whenever the 'BuildConfig' changes.
-- Either the change is reflected by modifying the flavourString or directly (as is
-- the case for settings which affect environment variables)
testEnv :: Arch -> Opsys -> BuildConfig -> String
-testEnv arch opsys bc =
+testEnv arch = testEnvWith (archName arch)
+
+testEnvWith :: String -> Opsys -> BuildConfig -> String
+testEnvWith archN opsys bc =
intercalate "-" $ concat
- [ [ archName arch
- , opsysName opsys ]
+ [ [ archN
+ , opsysNameWithFlavor opsys (buildFlavor bc) ]
, ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp]
, ["unreg" | unregisterised bc ]
, ["numa" | withNuma bc ]
, ["zstd" | withZstd bc ]
, ["no_tntc" | not (tablesNextToCode bc) ]
- , ["cross_"++triple | Just triple <- pure $ crossTarget bc ]
+ , ["cross_"++renderTriple ct | Just ct <- pure $ crossTarget bc ]
, [flavourString (mkJobFlavour bc)]
]
@@ -392,18 +492,18 @@ flavourString (Flavour base trans) = base_string base ++ concatMap (("+" ++) . f
flavour_string TextWithSIMDUTF = "text_simdutf"
-- The path to the docker image (just for linux builders)
-dockerImage :: Arch -> Opsys -> Maybe String
-dockerImage arch (Linux distro) =
+dockerImage :: Arch -> Opsys -> BuildConfig -> Maybe String
+dockerImage arch (Linux distro) bc =
Just image
where
image = mconcat
[ "registry.gitlab.haskell.org/ghc/ci-images/"
, archName arch
, "-linux-"
- , distroName distro
+ , distroImageTag distro (buildFlavor bc)
, ":$DOCKER_REV"
]
-dockerImage _ _ = Nothing
+dockerImage _ _ _ = Nothing
-----------------------------------------------------------------------------
-- Platform-specific variables
@@ -444,8 +544,8 @@ brokenTest :: TestName -- ^ test name
-> Variables
brokenTest test _why = "BROKEN_TESTS" =: test
-opsysVariables :: Arch -> Opsys -> Variables
-opsysVariables _ FreeBSD14 = mconcat
+opsysVariables :: Arch -> Opsys -> ImageFlavor -> Variables
+opsysVariables _ FreeBSD14 _ = mconcat
[ -- N.B. we use iconv from ports as I see linker errors when we attempt
-- to use the "native" iconv embedded in libc as suggested by the
-- porting guide [1].
@@ -459,8 +559,8 @@ opsysVariables _ FreeBSD14 = mconcat
, "FETCH_GHC_VERSION" =: "9.10.3"
, "CABAL_INSTALL_VERSION" =: "3.14.2.0"
]
-opsysVariables arch (Linux distro) = distroVariables arch distro
-opsysVariables AArch64 (Darwin {}) = mconcat
+opsysVariables arch (Linux distro) flavor = distroVariables arch distro flavor
+opsysVariables AArch64 (Darwin {}) _ = mconcat
[ "NIX_SYSTEM" =: "aarch64-darwin"
, "MACOSX_DEPLOYMENT_TARGET" =: "11.0"
, "LANG" =: "en_US.UTF-8"
@@ -468,7 +568,7 @@ opsysVariables AArch64 (Darwin {}) = mconcat
-- Fonts can't be installed on darwin
, "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs"
]
-opsysVariables Amd64 (Darwin {}) = mconcat
+opsysVariables Amd64 (Darwin {}) _ = mconcat
[ "NIX_SYSTEM" =: "x86_64-darwin"
, "MACOSX_DEPLOYMENT_TARGET" =: "11.0"
-- Only Sierra and onwards supports clock_gettime. See #12858
@@ -481,16 +581,15 @@ opsysVariables Amd64 (Darwin {}) = mconcat
, "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi"
-- Fonts can't be installed on darwin
, "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs"
-
]
-opsysVariables _ (Windows {}) = mconcat
+opsysVariables _ (Windows {}) _ = mconcat
[ "MSYSTEM" =: "CLANG64"
, "LANG" =: "en_US.UTF-8"
, "CABAL_INSTALL_VERSION" =: "3.14.2.0"
, "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs"
, "FETCH_GHC_VERSION" =: "9.10.3"
]
-opsysVariables _ _ = mempty
+opsysVariables _ _ _ = mempty
alpineVariables :: Arch -> Variables
alpineVariables arch = mconcat $
@@ -509,10 +608,13 @@ alpineVariables arch = mconcat $
]
-distroVariables :: Arch -> LinuxDistro -> Variables
-distroVariables arch Alpine312 = alpineVariables arch
-distroVariables arch Alpine323 = alpineVariables arch
-distroVariables _ _ = mempty
+distroVariables :: Arch -> LinuxDistro -> ImageFlavor -> Variables
+distroVariables arch Alpine312 _ = alpineVariables arch
+-- The wasm image runs its own (libc-free) toolchain, so the alpine broken
+-- tests do not apply to it.
+distroVariables _ Alpine323 FlavorWasm = mempty
+distroVariables arch Alpine323 _ = alpineVariables arch
+distroVariables _ _ _ = mempty
-----------------------------------------------------------------------------
-- Cache settings, what to cache and when can we share the cache
@@ -524,8 +626,8 @@ data Cache
}
-- The cache doesn't depend on the BuildConfig because we only cache the cabal store.
-mkCacheKey :: Arch -> Opsys -> String
-mkCacheKey arch opsys = archName arch <> "-" <> opsysName opsys <> "-$CACHE_REV"
+mkCacheKey :: Arch -> Opsys -> ImageFlavor -> String
+mkCacheKey arch opsys flavor = archName arch <> "-" <> opsysNameWithFlavor opsys flavor <> "-$CACHE_REV"
instance ToJSON Cache where
toJSON Cache {..} = object
@@ -807,7 +909,7 @@ data Job
, jobArtifacts :: Artifacts
, jobCache :: Cache
, jobRules :: OnOffRules
- , jobPlatform :: (Arch, Opsys)
+ , jobPlatform :: (Arch, Opsys, ImageFlavor)
}
instance Show Job where
@@ -837,7 +939,7 @@ instance ToJSON Job where
job :: Arch -> Opsys -> BuildConfig -> NamedJob Job
job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
where
- jobPlatform = (arch, opsys)
+ jobPlatform = (arch, opsys, buildFlavor buildConfig)
jobRules = emptyRules jobName
@@ -845,14 +947,14 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
jobTags = tags arch opsys buildConfig
- jobDockerImage = dockerImage arch opsys
+ jobDockerImage = dockerImage arch opsys buildConfig
jobScript
| Windows <- opsys
= [ "bash .gitlab/ci.sh setup"
, "bash .gitlab/ci.sh configure"
, "bash .gitlab/ci.sh build_hadrian"
- , "bash .gitlab/ci.sh test_hadrian"
+ , "bash " ++ testStep
]
| otherwise
= [ "find libraries -name config.sub -exec cp config.sub {} \\;" | Darwin == opsys ] ++
@@ -860,9 +962,16 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
[ ".gitlab/ci.sh setup"
, ".gitlab/ci.sh configure"
, ".gitlab/ci.sh build_hadrian"
- , ".gitlab/ci.sh test_hadrian"
+ , testStep
]
+ -- Cross jobs with a working emulator smoke-test the bindist under the
+ -- emulator as a separate step after the build; everything else runs the
+ -- testsuite.
+ testStep
+ | Emulator _ <- crossEmulator buildConfig = ".gitlab/ci.sh smoke_test"
+ | otherwise = ".gitlab/ci.sh test_hadrian"
+
jobAfterScript
| Windows <- opsys =
[ "bash .gitlab/ci.sh save_cache"
@@ -880,16 +989,20 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
jobDependencies = []
jobVariables = mconcat
- [ opsysVariables arch opsys
+ [ opsysVariables arch opsys (buildFlavor buildConfig)
, "TEST_ENV" =: testEnv arch opsys buildConfig
, "BIN_DIST_NAME" =: binDistName arch opsys buildConfig
+ , maybe mempty ("BIN_DIST_NAME_STAGE3" =:) (stage3BinDistName opsys buildConfig)
, "BUILD_FLAVOUR" =: flavourString jobFlavour
, "BIGNUM_BACKEND" =: bignumString (bignumBackend buildConfig)
, "CONFIGURE_ARGS" =: configureArgsStr buildConfig
, "INSTALL_CONFIGURE_ARGS" =: "--enable-strict-ghc-toolchain-check"
, maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig)
- , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig)
- , maybe mempty (("CROSS_STAGE" =:) . show) (crossStage buildConfig)
+ , maybe mempty (("CROSS_TARGET" =:) . renderTriple) (crossTarget buildConfig)
+ , case crossStages buildConfig of
+ Nothing -> mempty
+ Just Stage2 -> "FINAL_CROSS_STAGE" =: "2"
+ Just Stage2And3 -> "FINAL_CROSS_STAGE" =: "3"
, case crossEmulator buildConfig of
NoEmulator
-- we need an emulator but it isn't set. Won't run the testsuite
@@ -922,6 +1035,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
trim :: String -> String
trim = dropWhileEnd isSpace . dropWhile isSpace
+ stage3Artifacts = maybe [] (\n -> [n ++ ".tar.xz"]) (stage3BinDistName opsys buildConfig)
+
-- Keep in sync with the exclude list in `function clean()` in
-- `.gitlab/ci.sh`!
jobArtifacts = Artifacts
@@ -930,6 +1045,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
, artifactPaths = [binDistName arch opsys buildConfig ++ ".tar.xz"
,"junit.xml"
,"unexpected-test-output.tar.gz"]
+ ++ stage3Artifacts
, artifactsWhen = ArtifactsAlways
}
@@ -940,7 +1056,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
Cache { cachePaths = [], cacheKey = "no-caching" }
| otherwise = Cache
{ cachePaths = [ "cabal-cache", "toolchain" ]
- , cacheKey = mkCacheKey arch opsys
+ , cacheKey = mkCacheKey arch opsys (buildFlavor buildConfig)
}
@@ -1163,7 +1279,6 @@ debian_x86 =
, disableValidate (standardBuilds Amd64 (Linux Debian12))
, disableValidate (standardBuilds Amd64 (Linux Debian13))
-
-- Validate only builds
, fastCI (validateBuilds Amd64 (Linux validate_debian) debug)
, validateBuilds Amd64 (Linux validate_debian) nativeInt
@@ -1288,16 +1403,17 @@ alpine_aarch64 = [
cross_jobs :: [JobGroup Job]
cross_jobs = [
-- x86 -> aarch64
- validateBuilds Amd64 (Linux Debian13) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing)
+ validateBuilds Amd64 (Linux Debian13) (crossConfig (TargetPlatform AArch64 TargetOsLinuxGnu) (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing Stage2)
- -- x86_64 -> riscv
- , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian13Riscv) (crossConfig "riscv64-linux-gnu" (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing))
+ -- Stage2: x86_64 (build/host) -> riscv64 (target)
+ -- Stage3: x86_64 (build) -> riscv64 (host/target)
+ , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian13) (crossConfig (TargetPlatform RiscV64 TargetOsLinuxGnu) (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing Stage2And3))
-- x86_64 -> loongarch64
- , addValidateRule LoongArch64 (validateBuilds Amd64 (Linux Ubuntu2404LoongArch64) (crossConfig "loongarch64-linux-gnu" (Emulator "qemu-loongarch64 -L /usr/loongarch64-linux-gnu") Nothing))
+ , addValidateRule LoongArch64 (validateBuilds Amd64 (Linux Ubuntu2404) (crossConfig (TargetPlatform LoongArch TargetOsLinuxGnu) (Emulator "qemu-loongarch64 -L /usr/loongarch64-linux-gnu") Nothing Stage2))
-- Javascript
- , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig)
+ , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11) javascriptConfig)
-- Wasm
, make_wasm_jobs wasm_build_config
@@ -1309,13 +1425,13 @@ cross_jobs = [
-- Linux Aarch64 (Wine + FEX + MSYS64) => Windows Aarch64
, makeWinArmJobs
$ addValidateRule WinArm64
- (validateBuilds AArch64 (Linux Debian12Wine) winAarch64Config)
+ (validateBuilds AArch64 (Linux Debian12) winAarch64Config)
, makeWinArmJobs
$ addValidateRule WinArm64LLVM
- (validateBuilds AArch64 (Linux Debian12Wine) (winAarch64Config {llvmBootstrap = True}))
+ (validateBuilds AArch64 (Linux Debian12) (winAarch64Config {llvmBootstrap = True}))
]
where
- javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (NoEmulatorNeeded TimeoutIncrease) (Just "emconfigure"))
+ javascriptConfig = (crossConfig (TargetPlatform JavaScript TargetOsGhcjs) (NoEmulatorNeeded TimeoutIncrease) (Just "emconfigure") Stage2)
{ bignumBackend = Native }
makeWinArmJobs = modifyJobs
@@ -1354,7 +1470,7 @@ cross_jobs = [
llvm_prefix = "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-"
cflags = "-fuse-ld=" ++ llvm_prefix ++ "ld --rtlib=compiler-rt"
- winAarch64Config = (crossConfig "aarch64-unknown-mingw32" (Emulator "/opt/wine-arm64ec-msys2-deb12/bin/wine") Nothing)
+ winAarch64Config = (crossConfig (TargetPlatform AArch64 TargetOsMingw32) (Emulator "/opt/wine-arm64ec-msys2-deb12/bin/wine") Nothing Stage2)
{ bignumBackend = Native }
make_wasm_jobs cfg =
@@ -1364,10 +1480,10 @@ cross_jobs = [
. setVariable "HADRIAN_ARGS" "--docs=no-sphinx-pdfs --docs=no-sphinx-man"
. delVariable "INSTALL_CONFIGURE_ARGS"
)
- $ addValidateRule WasmBackend $ validateBuilds Amd64 (Linux AlpineWasm) cfg
+ $ addValidateRule WasmBackend $ validateBuilds Amd64 (Linux Alpine323) cfg
wasm_build_config =
- (crossConfig "wasm32-wasi" (NoEmulatorNeeded NoTimeoutIncrease) Nothing)
+ (crossConfig (TargetPlatform Wasm32 TargetOsWasi) (NoEmulatorNeeded NoTimeoutIncrease) Nothing Stage2)
{ hostFullyStatic = True
, buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet
, textWithSIMDUTF = True
@@ -1392,8 +1508,8 @@ job_groups =
-- Platform mapping for GHCup metadata
---------------------------------------------------------------------
-mkPlatform :: Arch -> Opsys -> String
-mkPlatform arch opsys = archName arch <> "-" <> opsysName opsys
+mkPlatform :: (Arch, Opsys, ImageFlavor) -> String
+mkPlatform (arch, opsys, flavor) = archName arch <> "-" <> opsysNameWithFlavor opsys flavor
-- | This map tells us for a specific arch/opsys combo what the job name for
-- nightly/release pipelines is. This is used by the ghcup metadata generation so that
@@ -1438,7 +1554,7 @@ platform_mapping = Map.map go combined_result
process sel =
Map.fromListWith combine
- [ (uncurry mkPlatform (jobPlatform (jobInfo j)), j)
+ [ (mkPlatform (jobPlatform (jobInfo j)), j)
| (sel -> Just j) <- job_groups
]
=====================================
.gitlab/jobs.yaml
=====================================
@@ -303,7 +303,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -319,9 +319,9 @@
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CONF_CC_OPTS_STAGE2": "-fuse-ld=/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld --rtlib=compiler-rt",
"CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "aarch64-unknown-mingw32",
"CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
+ "FINAL_CROSS_STAGE": "2",
"HADRIAN_ARGS": "--docs=none",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
@@ -387,7 +387,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -403,9 +403,9 @@
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CONF_CC_OPTS_STAGE2": "-fuse-ld=/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld --rtlib=compiler-rt",
"CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "aarch64-unknown-mingw32",
"CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
+ "FINAL_CROSS_STAGE": "2",
"HADRIAN_ARGS": "--docs=none",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
@@ -1111,7 +1111,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -1127,9 +1127,9 @@
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CONF_CC_OPTS_STAGE2": "-fuse-ld=/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld --rtlib=compiler-rt",
"CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "aarch64-unknown-mingw32",
"CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
+ "FINAL_CROSS_STAGE": "2",
"HADRIAN_ARGS": "--docs=none",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
@@ -1196,7 +1196,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -1212,9 +1212,9 @@
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CONF_CC_OPTS_STAGE2": "-fuse-ld=/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld --rtlib=compiler-rt",
"CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "aarch64-unknown-mingw32",
"CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
+ "FINAL_CROSS_STAGE": "2",
"HADRIAN_ARGS": "--docs=none",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
@@ -2010,8 +2010,8 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "wasm32-wasi",
+ "FINAL_CROSS_STAGE": "2",
"FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
"HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
"RUNTEST_ARGS": "",
@@ -2077,8 +2077,8 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-int_native-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "wasm32-wasi",
+ "FINAL_CROSS_STAGE": "2",
"FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
"HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
"RUNTEST_ARGS": "",
@@ -2144,8 +2144,8 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-unreg-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
"CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "wasm32-wasi",
+ "FINAL_CROSS_STAGE": "2",
"FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
"HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
"RUNTEST_ARGS": "",
@@ -2212,8 +2212,8 @@
"BUILD_FLAVOUR": "validate",
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CONFIGURE_WRAPPER": "emconfigure",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "javascript-unknown-ghcjs",
+ "FINAL_CROSS_STAGE": "2",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "-e config.timeout=900",
"TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate",
@@ -2459,7 +2459,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -2471,8 +2471,8 @@
"BUILD_FLAVOUR": "validate",
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "aarch64-linux-gnu",
+ "FINAL_CROSS_STAGE": "2",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "-e config.timeout=900",
"TEST_ENV": "x86_64-linux-deb13-cross_aarch64-linux-gnu-validate",
@@ -2750,7 +2750,8 @@
"paths": [
"ghc-x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate.tar.xz",
"junit.xml",
- "unexpected-test-output.tar.gz"
+ "unexpected-test-output.tar.gz",
+ "ghc-riscv64-linux-deb13-validate.tar.xz"
],
"reports": {
"junit": "junit.xml"
@@ -2783,7 +2784,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -2792,11 +2793,12 @@
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate",
+ "BIN_DIST_NAME_STAGE3": "ghc-riscv64-linux-deb13-validate",
"BUILD_FLAVOUR": "validate",
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CROSS_EMULATOR": "qemu-riscv64 -L /usr/riscv64-linux-gnu",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "riscv64-linux-gnu",
+ "FINAL_CROSS_STAGE": "3",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "-e config.timeout=900",
"TEST_ENV": "x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate",
@@ -3687,7 +3689,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -3699,8 +3701,8 @@
"BUILD_FLAVOUR": "validate",
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CROSS_EMULATOR": "qemu-loongarch64 -L /usr/loongarch64-linux-gnu",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "loongarch64-linux-gnu",
+ "FINAL_CROSS_STAGE": "2",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "-e config.timeout=900",
"TEST_ENV": "x86_64-linux-ubuntu24_04-loongarch-cross_loongarch64-linux-gnu-validate",
@@ -5995,8 +5997,8 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "wasm32-wasi",
+ "FINAL_CROSS_STAGE": "2",
"FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
"HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
"RUNTEST_ARGS": "",
@@ -6062,8 +6064,8 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-int_native-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "wasm32-wasi",
+ "FINAL_CROSS_STAGE": "2",
"FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
"HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
"RUNTEST_ARGS": "",
@@ -6129,8 +6131,8 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-unreg-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
"CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "wasm32-wasi",
+ "FINAL_CROSS_STAGE": "2",
"FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
"HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
"RUNTEST_ARGS": "",
@@ -6196,8 +6198,8 @@
"BUILD_FLAVOUR": "validate",
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CONFIGURE_WRAPPER": "emconfigure",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "javascript-unknown-ghcjs",
+ "FINAL_CROSS_STAGE": "2",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "-e config.timeout=900",
"TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate",
@@ -6439,7 +6441,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -6451,8 +6453,8 @@
"BUILD_FLAVOUR": "validate",
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "aarch64-linux-gnu",
+ "FINAL_CROSS_STAGE": "2",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "-e config.timeout=900",
"TEST_ENV": "x86_64-linux-deb13-cross_aarch64-linux-gnu-validate",
@@ -6726,7 +6728,8 @@
"paths": [
"ghc-x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate.tar.xz",
"junit.xml",
- "unexpected-test-output.tar.gz"
+ "unexpected-test-output.tar.gz",
+ "ghc-riscv64-linux-deb13-validate.tar.xz"
],
"reports": {
"junit": "junit.xml"
@@ -6759,7 +6762,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -6768,11 +6771,12 @@
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate",
+ "BIN_DIST_NAME_STAGE3": "ghc-riscv64-linux-deb13-validate",
"BUILD_FLAVOUR": "validate",
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CROSS_EMULATOR": "qemu-riscv64 -L /usr/riscv64-linux-gnu",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "riscv64-linux-gnu",
+ "FINAL_CROSS_STAGE": "3",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "-e config.timeout=900",
"TEST_ENV": "x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate",
@@ -7650,7 +7654,7 @@
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
- ".gitlab/ci.sh test_hadrian"
+ ".gitlab/ci.sh smoke_test"
],
"stage": "full-build",
"tags": [
@@ -7662,8 +7666,8 @@
"BUILD_FLAVOUR": "validate",
"CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
"CROSS_EMULATOR": "qemu-loongarch64 -L /usr/loongarch64-linux-gnu",
- "CROSS_STAGE": "2",
"CROSS_TARGET": "loongarch64-linux-gnu",
+ "FINAL_CROSS_STAGE": "2",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"RUNTEST_ARGS": "-e config.timeout=900",
"TEST_ENV": "x86_64-linux-ubuntu24_04-loongarch-cross_loongarch64-linux-gnu-validate",
=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -70,6 +70,13 @@ These are the steps to build a bindist:
to
<build root>/<bindist-dir>/ghc-<X>.<Y>.<Z>-<arch>-<os>/lib
+- for cross-compilers, overwrite the implicitly copied (previous step)
+ <build root>/<library-stage-dir>/lib/targets/default.target file with that of
+ the executable stage. I.e. copy:
+ <build root>/<executable-stage-dir>/lib/targets/default.target
+ to
+ <build root>/<bindist-dir>/ghc-<X>.<Y>.<Z>-<arch>-<os>/lib/targets/default.target
+
- copy the generated docs (user guide, haddocks, etc):
<build root>/doc/
to
@@ -248,6 +255,13 @@ buildBinDistDir root conf@BindistConfig{..} = do
copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir
+ -- For cross-compilers we need to override the `targets/default.target`
+ -- file that was implicitly copied from the library stage, because this
+ -- describes a target native compiler (stage3) and not a cross-compiler.
+ when (library_stage /= executable_stage) $
+ copyFile (root -/- stageString executable_stage -/- "lib" -/- "targets" -/- "default.target")
+ (bindistFilesDir -/- "lib" -/- "targets" -/- "default.target")
+
-- Regenerate settings file without LibDir. For bindists, LibDir should
-- be derived from topdir at runtime such that the GHC binary is
-- relocatable. The package DB is always at "package.conf.d" relative to
=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -255,11 +255,14 @@ generateRules = do
prefix = root -/- stageString compilerStage -/- "lib"
go gen file = generate file (semiEmptyTarget compilerStage) gen
(prefix -/- "settings") %> \out -> do
- -- Stage0 has no library or package DB of its own (the
- -- bootstrapping compiler uses Stage1's); for any other stage the
- -- package DB lives where the LibDir redirect points (this stage's
- -- own lib dir, or the successor's when @compilerStage@ is a cross
- -- stage).
+ -- @compilerStage@ is the stage that builds the compiler, i.e. the
+ -- binary whose settings these are; @libraryStage@ is the stage
+ -- whose libraries and package DB that compiler uses. The two
+ -- differ in two cases: Stage0 has no library or package DB of its
+ -- own (the bootstrapping compiler uses Stage1's), and cross
+ -- stages use the successor stage's libraries (a cross compiler
+ -- requires libs from the successor stage, otherwise they are
+ -- compiled for the host and not the target).
isCross <- crossStage compilerStage
let libraryStage = case compilerStage of
Stage0 {} -> Stage1
@@ -273,11 +276,23 @@ generateRules = do
else root -/- stageString libraryStage -/- "lib"
relPkgDb = makeRelativeNoSysLink libTopDir pkgDb
go (generateSettings out True relPkgDb libraryStage) out
- (prefix -/- "targets" -/- "default.target") %> \out -> go (show <$> expr (targetStage (succStage compilerStage))) out
+ (prefix -/- "targets" -/- "default.target") %> \out ->
+ go (generateTargetFile compilerStage) out
where
file <~+ gen = file %> \out -> generate out emptyTarget gen >> makeExecutable out
+ generateTargetFile :: Stage -> Expr String
+ generateTargetFile compilerStage = do
+ isCrossStage <- if compilerStage < Stage3
+ then expr (crossStage compilerStage)
+ else pure False
+ let libraryStage = case compilerStage of
+ Stage0 {} -> Stage1
+ _ -> if isCrossStage then succStage compilerStage else compilerStage
+ tgt <- expr (targetStage libraryStage)
+ pure $ show tgt { tgtLocallyExecutable = not isCrossStage }
+
-- TODO: Use the Types, Luke! (drop partial function)
-- We sometimes need to evaluate expressions that do not require knowing all
-- information about the context. In this case, we don't want to know anything.
@@ -421,8 +436,9 @@ bindistRules = do
, interpolateVar "HostOS_CPP" $ fmap cppify $ interp $ queryHost queryOS
- -- Stage2 always targets the final architecture. Thus, we can use a
- -- constant stage here.
+ -- Stage2 always targets the target (as in build, host, target)
+ -- architecture. Thus, we can use it constant stage here to find
+ -- information about the target architecture.
, interpolateVar "TargetPlatform" $ getTarget Stage2 targetPlatformTriple
, interpolateVar "TargetPlatform_CPP" $ cppify <$> getTarget Stage2 targetPlatformTriple
, interpolateVar "TargetArch_CPP" $ cppify <$> getTarget Stage2 queryArch
=====================================
hadrian/src/Settings/Packages.hs
=====================================
@@ -112,8 +112,11 @@ packageArgs = do
, compilerStageOption ghcDebugAssertions ? arg "-DDEBUG" ]
, builder (Cabal Flags) ? mconcat
- [ andM [expr (ghcWithInterpreter stage), orM [expr (notM cross), stage1]] `cabalFlag` "interpreter"
- , andM [expr (ghcWithInterpreter stage), notM (expr cross)] `cabalFlag` "internal-interpreter"
+ -- In the context of cross-compilation, stage2 runs on the target
+ -- and thus can - if the architecture supports it - provide the
+ -- interpreter natively.
+ [ andM [expr (ghcWithInterpreter stage), orM [expr (notM cross), stage1, stage2]] `cabalFlag` "interpreter"
+ , andM [expr (ghcWithInterpreter stage), orM [expr (notM cross), stage2]] `cabalFlag` "internal-interpreter"
, ifM stage0
-- We build a threaded stage 1 if the bootstrapping compiler
-- supports it.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b2d34f9787bff31b3e906387bdd94b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b2d34f9787bff31b3e906387bdd94b…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/rafl/meaningful-main-return] Implement MeaningfulMainReturn
by Florian Ragwitz (@rafl) 11 Oct '26
by Florian Ragwitz (@rafl) 11 Oct '26
11 Oct '26
Florian Ragwitz pushed to branch wip/rafl/meaningful-main-return at Glasgow Haskell Compiler / GHC
Commits:
9099eb8d by Florian Ragwitz at 2026-10-10T23:28:44-07:00
Implement MeaningfulMainReturn
As per ghc-proposal#631, with one small adjustment explained in the comments.
Fixes #24848.
- - - - -
45 changed files:
- + changelog.d/MeaningfulMainReturn
- compiler/GHC/Builtin/KnownOccs.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Types/Error/Codes.hs
- + docs/users_guide/exts/meaningful_main_return.rst
- docs/users_guide/exts/misc.rst
- docs/users_guide/using-warnings.rst
- libraries/base/src/GHC/Essentials.hs
- libraries/containers
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- testsuite/tests/driver/T4437.hs
- + testsuite/tests/ghc-e/should_run/T9086.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- + testsuite/tests/meaningful-main-return/Imported.hs
- + testsuite/tests/meaningful-main-return/MainReturn_constrained_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_alias_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_bottom_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_bottom_enabled_run.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_success_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_always_exit_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_invalid_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_invalid_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_stuck_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_stuck_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_imported_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_imported_invalid_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_imported_invalid_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_imported_wrapped_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_int_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_int_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_newtype_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_newtype_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_typeapp_disabled.stderr
- + testsuite/tests/meaningful-main-return/MeaningfulMainReturn.hs
- + testsuite/tests/meaningful-main-return/all.T
- testsuite/tests/parser/should_compile/T7476/T7476.hs
- + testsuite/tests/typecheck/should_compile/tc104.stderr
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9099eb8dce2c316538aac298bd1af7c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9099eb8dce2c316538aac298bd1af7c…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/rafl/meaningful-main-return] 7 commits: Preserve sign of zero when parsing -0.0#
by Florian Ragwitz (@rafl) 11 Oct '26
by Florian Ragwitz (@rafl) 11 Oct '26
11 Oct '26
Florian Ragwitz pushed to branch wip/rafl/meaningful-main-return at Glasgow Haskell Compiler / GHC
Commits:
ffa56ae4 by sheaf at 2026-10-09T17:15:59+02:00
Preserve sign of zero when parsing -0.0#
This commit leverages the recently added GHC.Types.Literal.Floating
module in order to preserve the sign of negative zero from
source-written floating-point literals.
Fixes #27545
- - - - -
d538cac9 by Facundo Domínguez at 2026-10-09T20:26:38-04:00
Propagate annotations to simple interfaces
This allows annotations to be visible to plugins when run by
haddock. The LiquidHaskell plugin needs the annotations, in particular.
Fixes #26761
- - - - -
32c4f4ab by meooow25 at 2026-10-09T20:27:28-04:00
Bump containers submodule to 0.8.1
And fix affected tests.
* T4086a: containers depends on template-haskell-lift now instead of
template-haskell.
* T22611: Updated to be less dependent on containers internals.
- - - - -
c786065e by sheaf at 2026-10-09T20:28:20-04:00
Use an explicit pattern match in toIfaceIdDetails
The old wildcard pattern let this code bit rot: it did not properly account
for recently added 'IdDetails' such as 'RepPolyId', which resulted in
spurious 'pprTrace' messages that could even pollute HLS sessions.
Fixes #23785
- - - - -
e7cacf59 by sheaf at 2026-10-09T20:29:09-04:00
Take into account ifKind in freeNamesIfDecl
Commit 3c2f4bb4 added the 'ifKind' field to various constructors
of 'IfaceDecl', which preserves the original kind (before type synonym
expansion) for better error messages.
However, that commit forgot to update 'freeNamesIfDecl' correspondingly.
This could result in a "urk! lookup local fingerpring" crash when e.g.
a type's kind uses a type synonym defined later, as we failed to add a
dependency on the type synonym during dependency analysis.
Fixes #27916
- - - - -
7d7786e4 by Florian Ragwitz at 2026-10-10T18:36:21-07:00
Move exitWith into GHC.IO.Exception
This is low enough within the hierarchy of base such that it can be imported
into GHC.Essentials.
The implementation of exitWith is slightly changed to avoid having to import
Data.Bool, which would lead to a dependency cycle.
We chose to keep it in base rather than moving it up all the way to
GHC.Internal.IO.Exception to allow a reinstallable base to change it
independently of GHC.
With this, we can now have a known occurrence for GHC to reference in order to
implement GHC proposal #631 (#24848).
- - - - -
eea8b99a by Florian Ragwitz at 2026-10-10T18:36:22-07:00
Implement MeaningfulMainReturn
As per ghc-proposal#631, with one small adjustment explained in the comments.
Fixes #24848.
- - - - -
69 changed files:
- + changelog.d/26761
- + changelog.d/MeaningfulMainReturn
- + changelog.d/T23785
- + changelog.d/T27545
- + changelog.d/T27916
- compiler/GHC/Builtin/KnownOccs.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- + docs/users_guide/exts/meaningful_main_return.rst
- docs/users_guide/exts/misc.rst
- docs/users_guide/using-warnings.rst
- libraries/base/src/GHC/Essentials.hs
- libraries/base/src/GHC/IO/Exception.hs
- libraries/base/src/System/Exit.hs
- libraries/containers
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- testsuite/tests/driver/T4437.hs
- + testsuite/tests/ghc-e/should_run/T9086.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- + testsuite/tests/meaningful-main-return/MainReturn_constrained_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_alias_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_bottom_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_bottom_enabled_run.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_success_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_always_exit_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_invalid_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_invalid_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_stuck_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_stuck_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_int_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_int_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_newtype_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_newtype_enabled.stderr
- + testsuite/tests/meaningful-main-return/MeaningfulMainReturn.hs
- + testsuite/tests/meaningful-main-return/all.T
- + testsuite/tests/numeric/should_run/T27545.hs
- + testsuite/tests/numeric/should_run/T27545.stdout
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/package/T4806a.stderr
- testsuite/tests/package/all.T
- testsuite/tests/parser/should_compile/T7476/T7476.hs
- + testsuite/tests/plugins/T26761.hs
- + testsuite/tests/plugins/T26761.stderr
- + testsuite/tests/plugins/T26761Plugin.hs
- + testsuite/tests/plugins/T26761a.hs
- testsuite/tests/plugins/all.T
- testsuite/tests/simplCore/should_compile/T22611.hs
- testsuite/tests/simplCore/should_compile/T22611.stderr
- + testsuite/tests/simplCore/should_compile/T22611a.hs
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/typecheck/should_compile/T27916.hs
- testsuite/tests/typecheck/should_compile/all.T
- + testsuite/tests/typecheck/should_compile/tc104.stderr
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/29a91779a63413b1ae5976a003f322…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/29a91779a63413b1ae5976a003f322…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/T26543b] 44 commits: Remove the call to hoistFlag from processCmdLineP
by Simon Peyton Jones (@simonpj) 11 Oct '26
by Simon Peyton Jones (@simonpj) 11 Oct '26
11 Oct '26
Simon Peyton Jones pushed to branch wip/T26543b at Glasgow Haskell Compiler / GHC
Commits:
098bba70 by Facundo Domínguez at 2026-09-17T14:57:41-04:00
Remove the call to hoistFlag from processCmdLineP
This call was undesirable because it was causing a reconstruction
of the list of flag processors.
Even relying on list fusion would not be sufficient because we want
to replace the list with a data structure with faster lookups to
address #25763.
The removal is done in two moves:
* We move CmdLineP to CmdLine.hs
* Then we move the effect of hoisting to processArgs via a new function
hoistEwM
- - - - -
e01799c7 by Facundo Domínguez at 2026-09-17T14:57:42-04:00
Do not create duplicate flag processors for the -W flag
This makes simpler implementing the command line parser with a trie map
holding flag processors. If we were to allow duplicate flag processors
for any flag, the trie map would need to be a multimap.
- - - - -
3875b257 by Facundo Domínguez at 2026-09-17T14:57:42-04:00
Replace the list of flag processors with a trie map in `processArgs`
Previously `GHC.Driver.CmdLine.findArg` was called for each
command-line argument, doing a linear search on the list of flag
processors each time. This was somewhat costly as the list of flag
processor has near 2000 elements.
A lookup with a trie map is faster in general, but the speed up is
only noticeable when calling `GHC.Driver.CmdLine.processArgs` sufficient
times, so the amount of lookups piles up. This could happen in large
projects with many units each having many dependencies. If only a
module needs to be recompiled, the user still needs to wait for all of
the flag parsing to complete.
The benchmark at testsuite/tests/perf/compiler/cmdline-parser shows a
10x speed up when using the trie.
The trie map is implemented in `GHC.Data.StringTrie`.
The design is explained in Note [Processing command line argument fast]
in GHC.Driver.Session.
The commit also:
* adds two property-based tests for trie map operations,
* adds a benchmark of the command line parser, and
* renames the predicate `arg_ok` to `valid_flag_suffix` to decide what
flag processor should be used when there are multiple matching
prefixes on a flag.
Fixes #25763.
- - - - -
5236634a by Andreas Klebinger at 2026-09-17T14:58:24-04:00
Compile Word64{Map,Set} with -O2 always.
This is the hottest code and even if we build GHC with -O0 otherwise -O2
pays off for these modules.
Fixes #27814.
- - - - -
545fd4fb by ARATA Mizuki at 2026-09-22T15:03:24-04:00
Change the C types of hs_{bitrev,bswap}{16,32} to match the Haskell types
bitReverse{16,32}# and byteSwap{16,32}# have the type
Word# -> Word#, but their C correspondents took and
returned StgWord{16,32}.
The mismatch on bitReverse16# led to the problem reported
in #27299. Although no similar issue is reported for
bitReverse32# and byteSwap{16,32}#, it seemed wise to
change them proactively.
This commit fixes the mismatch by changing the C type.
Fixes #27299
- - - - -
bf17f289 by fendor at 2026-09-22T15:04:05-04:00
Don't lose instances from shadowed imported modules with the same name
When we look for instances below the current module, we need to check
the unit id as well when we check for whether the module is the current
module, otherwise we ignore modules we import that have the same name as
the import module.
Adds regression test.
- - - - -
53eead15 by Wolfgang Jeltsch at 2026-09-24T20:12:03-04:00
Correct the documentation of `explicitUnits`
Resolves #27787.
- - - - -
35bf6f4b by Simon Jakobi at 2026-09-24T20:12:49-04:00
Remove stale specHeader bullet from Note [Don't make fillers for constraint types]
The Note said that Specialise.specHeader also calls mkAbsentFiller.
abfc224a27c removed that call: the specialiser no longer drops dead
arguments at all, see Note [Do not drop dead args from specialisations]
in GHC.Core.Opt.Specialise.
Assisted-by: Claude Fable 5.1
- - - - -
1abef1ef by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Improve the `mhu-closure` makefile
- - - - -
a79a68ea by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Make `ghci-multi` hide all unneeded packages
- - - - -
d6e72450 by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Improve the definition of the home unit closure property
- - - - -
c9a2766d by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Re-implement the home unit closure check
Compared to the previous implementation, the new one has the following
advantages:
* It is correct.
- It distinguishes between units that have the same unit ID but
different ABI hashes.
- When `-hide-all-packages` is not used, it considers as home unit
dependencies also units that are made implicitly available
because they are in the package database.
* It seems to be faster in usual settings.
- In particular, it does not have a preparation phase in which it
merges the dependency information from all home units, so that
its running time does not grow linearly with the size of the
package database in normal Cabal scenarios.
* It is (hopefully) clearer.
* It is better documented.
- - - - -
fa96acf8 by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Remove erroneous GHC flag in `hadrian-multi`
The flag was `-Werror=-Wno-error=incomplete-record-selectors`. Its
purpose was to permit incomplete record selectors, but because of the
illegal combination of `-Werror=` and `-Wno-error` it was ignored,
without any negative consequences.
- - - - -
9f48a5b9 by Alan Zimmerman at 2026-09-25T17:02:50-04:00
EPA: Add specific layout field to AnnList
Up to now AnnList has effectively served to represent lists of things
having layout, regardless of whether they do or not.
In Haskell, layout is optional in many places, as there is also an
alternative syntax using braces and semi-colons, which is free-form.
This commit introduces AnnListLayout, a data structure capturing this
distinction.
It is deliberately set up similarly to EpLayout, so that these two can
be merged in time.
The transition is done mechanically, where AnnListBraces is not used
yet, the original Nothing case maps to AnnListNoLayout, and the Just
case to AnnListLayout.
Later commits will fine tune these against the actual parser layout.
- - - - -
234bab08 by Vladislav Zavialov at 2026-09-29T17:22:54-04:00
Add regression test for #7803
Commit 2effe18ab5, first shipped with GHC 8.2.1, fixed #7803 "Superclass
methods are left unspecialized".
This change turns the example from the ticket description into a regression
test, checking that foo1 is fully specialised at Double, with no calls to the
overloaded exp5Tail.
Closes #7803
Assisted-by: Claude Opus 5
- - - - -
c406135c by Andreas Klebinger at 2026-10-01T06:57:28-04:00
RTS: Update flag parsing/handling:
Using 0 as argument to any of these flags now resets the flags setting to default:
- ``-n0`` disables nursery chunking.
- ``-K0`` (or a bare ``-K``) removes the stack size limit.
- ``-M0`` removes the heap size limit.
- ``-H0`` resets the suggested heap size, including the nursery scaling set by ``-H``.
- ``-AL0`` makes the large object allocation limit follow ``-A`` again.
GC Generations are now limited to 64.
-n larger than -A now emits a warning and disables chunking.
Fixes #27830 #27829
- - - - -
984ee82b by Andreas Klebinger at 2026-10-01T06:58:10-04:00
Fix MultiLayerModules timeout multiplier.
We accidentally used the compile multiplier for ghci commands which
use the run timeout setting to set the timeout.
Fixes #26263 and #27796.
- - - - -
50a9cf26 by Andreas Klebinger at 2026-10-01T06:58:10-04:00
testsuite: Include runtime in JUnit report.
- - - - -
e358619f by Alan Zimmerman at 2026-10-01T06:59:01-04:00
EPA: Use EpaLocation in EpVirtualBraces
Haddock processing uses EpLayout.EpVirtualBraces to record the current
layout column, for allocating haddock comments correctly.
For exact printing, we need the line as well as the col, so we know
how many lines to skip when the indented code block starts.
This commit updates EpLayout.EpVirtualBraces so that it carries an
EpaLocation instead of just the Int column, to allow it to be used for
both purposes.
It is a simple mechanical change, with no other impact, but it allows
us to use EpLayout instead of AnnListLayout in AnnList, in the next
commit in this series.
- - - - -
1d2a26ee by Andrew Lelechenko at 2026-10-01T20:22:04-04:00
Remove bitSize from MINIMAL pragma of class Bits
Cf. https://github.com/haskell/core-libraries-committee/issues/441
The function is deprecated for 12 years and has a default implementation,
yet it was never removed from the MINIMAL pragma, putting library authors
in a very awkward position. Let's finally remove bitSize from MINIMAL.
- - - - -
3cc21e4c by Hannes Siebenhandl at 2026-10-01T20:22:59-04:00
Add regression test for #27641
- - - - -
c35096f5 by Hannes Siebenhandl at 2026-10-01T20:23:00-04:00
Don't `:add` modules the loader will reject
Only home modules can be actually added to the loader context, thus we
only accept the module if it belongs to a home unit.
- - - - -
a563cb27 by Simon Jakobi at 2026-10-02T17:37:36-04:00
ci: accept modified changelog.d entries in lint-changelog
The changelog guide says to extend an existing entry rather than add a
new one when the feature is already documented. lint_changelog only
counted added files, so such MRs failed before the validator ran.
Fixes #27779.
Assisted-by: Claude Fable 5.1
- - - - -
03082cd4 by Simon Jakobi at 2026-10-02T17:38:17-04:00
changelog.d: Fix warning flag name in the semaphore-v2 entry
The entry refers to -Wsemaphore-version-mismatch, which does not exist.
The warning GHC emits when it cannot use a -jsem semaphore, including
on a protocol version mismatch, is -Wsemaphore-open-failure.
Context: !15729, #25087
Assisted-by: Claude Fable 5.1
- - - - -
a93705ee by Simon Jakobi at 2026-10-02T17:38:17-04:00
changelog.d: Fix the CLC proposal link in the T27455 entry
The entry used the Sphinx :ref: role with a URL as its target. :ref:
resolves only internal labels, so the generated release notes would
show the proposal name without a link. Use the plain hyperlink form
like the other entries.
Context: !16274, #27455
Assisted-by: Claude Fable 5.1
- - - - -
54381079 by Hannes Siebenhandl at 2026-10-02T17:39:01-04:00
Extend the `TrustOverlay` for wired-in units
The TrustOverlay only contained the `UnitId` of all on-disk units.
However, wired-in units are referred to by their wired-in unit id, which
is not the same as the on-disk unit id.
Thus, trust checks for wired-in units failed because the lookup was
using the wired-in unit, which wasn't present in the `TrustOverlay`.
We fix #27834, by copying the trust info for wired-in unit ids.
- - - - -
f8cfb1a5 by Hécate Kleidukos at 2026-10-04T19:36:39+02:00
[CLC 341] Strict variants of mutable types
This commit is the implementation of CLC Proposal 341
https://github.com/haskell/core-libraries-committee/issues/341
- - - - -
575c4bc6 by Rodrigo Mesquita at 2026-10-05T12:32:02-04:00
ttg: HsModuleName in the AST, ModuleName in GHC
This commit makes the AST fully independent from GHC by parsing a
"module name" as an `HsModuleName (= HText)` rather than constructing an
`ModuleName (= FastString)` straight away.
In the GHC side, everything remains as a `ModuleName`. We turn AST
`HsModuleName`s into fast strings with the cheap `mkFastStringShortText`
when we process the AST for manipulation within the compiler.
There are no performance regressions introduced by this approach.
This is the final piece of #21592
Alternative plans were discussed in
gitlab.haskell.org/ghc/ghc/-/merge_requests/16546#note_694647,
but the Simon suggested one won in simplicity and performance when
compared against my attempt at implementing my original plan of having
a family `ModuleNameP`.
- - - - -
b3b89d32 by mangoiv at 2026-10-05T22:03:32-04:00
hadrian: Persist the used flavour name in the build root (#20650)
This executes the idea proposed in #20650, teaching Hadrian to persist
the flavour used to build a build root. This both makes use of multiple
build roots more ergonomic (as the user no longer needs to repeat
themselves) and avoids a tiresome foot-gun (forgetting to specify a
flavour, often wholly invalidating a build root).
Closes #20650.
Co-authored-by: Sylvain Henry <sylvain(a)haskus.fr>
- - - - -
f977837b by mangoiv at 2026-10-05T22:04:21-04:00
configure: fix sed script and subst tooldir script
Fixes #27672
Adds sanity checking for SUBST_TOOLDIR
Metric Decrease:
LinkableUsage01
MultiLayerModulesTH_OneShot
T10547
T12234
T12425
T13035
T13820
T18140
T18730
T18923
T9198
TcPlugin_RewritePerf
mhu-perf
- - - - -
f1cb08be by Hannes Siebenhandl at 2026-10-05T22:05:03-04:00
Prepend in-memory unit database for backpack
The packageDbFlags are stored in reverse order. Thus, prepending will
ensure that the in-memory unit database is the last item on the unit
database stack.
Further, the in-memory unit database needs to be able to shadow units
from earlier unit databases in the unit database stack.
Moreover, a `-clear-package-db` would remove the in-memory database if
it weren't the last item on the stack.
Closes #27835
- - - - -
8d49ed42 by Kazu Yamamoto at 2026-10-06T19:37:25-04:00
Do not leave standard file descriptors free at startup (#24450)
A process may be started with stdout closed -- `prog >&-` from a shell does
exactly that. Nothing then reserves descriptor 1, and open(), pipe() and
socket() hand out the lowest free descriptor, so the next descriptor the
runtime creates for itself takes it: the ticker's pipe, or a capability's IO
manager control pipe.
'GHC.Internal.IO.StdHandles.stdout' is a CAF, built the first time the program
writes to stdout, which is long after that has happened. It builds a 'Handle'
over descriptor 1, which now belongs to the runtime, and nothing reports an
error because the descriptor is perfectly good. The program then writes its
output into the runtime's own plumbing.
What that looks like from the outside is a hang. The descriptor the Handle has
taken over is the read end of a pipe, so poll() for POLLOUT on it never says
yes and epoll_ctl() accepts a registration for it; the thread waiting to write
blocks for ever. Closing the Handle at exit closes the runtime's descriptor,
which is worse: the ticker then fails on every tick.
'hs_init_ghc' now opens /dev/null onto whichever of descriptors 0, 1 and 2 are
closed, before the runtime creates any descriptor of its own. Each is opened
for the access that descriptor would normally have, read-only for 0 and
write-only for 1 and 2, so that writing to 'stdin' or reading from 'stdout'
still fails rather than quietly succeeding against /dev/null. See
Note [Standard file descriptors must be open].
Moving only the descriptors the runtime opens would not do: the first file the
program itself opened would land on the free number instead. The fix has to
leave no free number. A program run this way therefore finds stdout connected
to /dev/null rather than failing with EBADF on the first write, which is what
such a program would get from most other language runtimes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply(a)anthropic.com>
- - - - -
65bcf9e9 by Simon Jakobi at 2026-10-06T19:38:09-04:00
changelog: Repair the sentence describing #27477
The description read "programs using could crash", the object of
"using" having been lost. The synopsis already says which programs are
affected, so drop the dangling word.
Assisted-by: Claude Fable 5.1
- - - - -
15ece296 by mangoiv at 2026-10-08T15:14:56-04:00
ci: move hadrian/ghci into the lint category so it can be picked up by more runners
Fixes #27817
- - - - -
c0823135 by mangoiv at 2026-10-08T15:14:56-04:00
ci: make lint-adjacent jobs into platform independent
- move lint jobs into lint-anyarch tag
- unify lint jobs under the same platform independent container
- - - - -
f76464cf by Zubin Duggal at 2026-10-08T15:15:39-04:00
DmdAnal: Make AbsDmd neutral in maxDmd
fixes #27845
- - - - -
ffa56ae4 by sheaf at 2026-10-09T17:15:59+02:00
Preserve sign of zero when parsing -0.0#
This commit leverages the recently added GHC.Types.Literal.Floating
module in order to preserve the sign of negative zero from
source-written floating-point literals.
Fixes #27545
- - - - -
d538cac9 by Facundo Domínguez at 2026-10-09T20:26:38-04:00
Propagate annotations to simple interfaces
This allows annotations to be visible to plugins when run by
haddock. The LiquidHaskell plugin needs the annotations, in particular.
Fixes #26761
- - - - -
32c4f4ab by meooow25 at 2026-10-09T20:27:28-04:00
Bump containers submodule to 0.8.1
And fix affected tests.
* T4086a: containers depends on template-haskell-lift now instead of
template-haskell.
* T22611: Updated to be less dependent on containers internals.
- - - - -
c786065e by sheaf at 2026-10-09T20:28:20-04:00
Use an explicit pattern match in toIfaceIdDetails
The old wildcard pattern let this code bit rot: it did not properly account
for recently added 'IdDetails' such as 'RepPolyId', which resulted in
spurious 'pprTrace' messages that could even pollute HLS sessions.
Fixes #23785
- - - - -
e7cacf59 by sheaf at 2026-10-09T20:29:09-04:00
Take into account ifKind in freeNamesIfDecl
Commit 3c2f4bb4 added the 'ifKind' field to various constructors
of 'IfaceDecl', which preserves the original kind (before type synonym
expansion) for better error messages.
However, that commit forgot to update 'freeNamesIfDecl' correspondingly.
This could result in a "urk! lookup local fingerpring" crash when e.g.
a type's kind uses a type synonym defined later, as we failed to add a
dependency on the type synonym during dependency analysis.
Fixes #27916
- - - - -
bc171365 by Simon Peyton Jones at 2026-10-11T01:21:45+01:00
Line up simpleUnifyCheck and check_ty_eq_rhs
Even after #26543 was allegedly fixed, the original repo case in the
Description continued to fail. The reason was that the QuickLook
unifier, `qlUnify`, used `simpleUnifyCheck` for checking unification
invariants; and `simpleUnifyCheck` conservatively rejected any RHS
with a coercion hole in it. The upshot was that QuickLook was not
as clever as it should be, wrongly failing to do an impredicative
instantiation.
Interestingly `check_ty_eq_rhs`, which does the same job, only during
constraint solving, was more liberal: it just looked at the free
vars of the coercion, and allowed coercion holes.
This MR lines them up, adding some careful notes. See
Note [simpleUnifyCheck] esp (SUC1)
Note [Unification preconditions] esp (COERCIONS)
Things are better than before, but I am still uncomfortable about the
possibilty that a hole might be filled with a coercion that mentions
the LHS type variable; for now I have left this discomfort documented
in (SUC1).
- - - - -
97b5ffc7 by Simon Peyton Jones at 2026-10-11T01:21:45+01:00
Fix order-dependence in QuickLook
Ticket #27917 pointed out that QuickLook was order-dependent
-- very bad!
The solution is in `qlUnify`: spot when we are unifying a type with a
definite monotype, and then monomorphise any free instantiation
variables of that type.
See (UQL8) and (UQL9) in Note [QuickLook unification].
- - - - -
98900237 by Simon Peyton Jones at 2026-10-11T01:22:02+01:00
Add some comments about RuntimeUnk
This commit just adds comments explaining why we don't need to worry about
RuntimeUnkTv in the constraint solver.
It also tightens up docmentation of earlier (overlapping) commits in
this MR.
- - - - -
253 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- + changelog.d/24450
- + changelog.d/25763-cmdline-opt
- + changelog.d/26610
- + changelog.d/26761
- + changelog.d/27641
- + changelog.d/27845
- + changelog.d/T23785
- + changelog.d/T26543
- changelog.d/T27455
- + changelog.d/T27545
- + changelog.d/T27830-rts-flag-bounds
- + changelog.d/T27916
- + changelog.d/clc-341-strict-mutable-data-types
- changelog.d/fix-parallel-gc-selector-race-27477
- + changelog.d/hadrian-persist-flavour
- changelog.d/semaphore-v2
- changelog.d/unit-index
- compiler/GHC.hs
- compiler/GHC/Builtin/Modules.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Show.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/CallerCC/Types.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/CoreToIface.hs
- + compiler/GHC/Data/StringTrie.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Data/Word64Set/Internal.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CmdLine.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Main/Compile.hs
- compiler/GHC/Driver/Pipeline.hs-boot
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Debug.hs
- compiler/GHC/Iface/Ext/Types.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Runtime/Heap/Inspect.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Unique.hs
- compiler/GHC/Types/UnresolvedImport.hs
- compiler/GHC/Types/Var/FV.hs
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/External/Wired.hs
- compiler/GHC/Unit/Home.hs
- compiler/GHC/Unit/Module.hs
- compiler/GHC/Unit/Module/Env.hs
- + compiler/GHC/Unit/Module/Name.hs
- compiler/GHC/Unit/Parser.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Unit/Types.hs-boot
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/Language/Haskell/Syntax/Module/Name.hs
- compiler/Language/Haskell/Syntax/Text.hs
- compiler/ghc.cabal.in
- distrib/configure.ac.in
- docs/users_guide/runtime_control.rst
- ghc/GHC/Driver/Session/Mode.hs
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Info.hs
- hadrian/doc/flavours.md
- hadrian/ghci-multi-cabal.in
- hadrian/src/Rules.hs
- hadrian/src/Settings.hs
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Control/Concurrent/Chan.hs
- + libraries/base/src/Control/Concurrent/Chan/Strict.hs
- libraries/base/src/Control/Concurrent/MVar.hs
- + libraries/base/src/Control/Concurrent/MVar/Strict.hs
- libraries/base/src/Data/IORef.hs
- + libraries/base/src/Data/IORef/Strict.hs
- libraries/containers
- libraries/ghc-internal/src/GHC/Internal/Bits.hs
- linters/lint-codes/LintCodes/Static.hs
- m4/subst_tooldir.m4
- rts/RtsFlags.c
- rts/RtsStartup.c
- rts/include/rts/Flags.h
- rts/include/rts/storage/GC.h
- rts/include/stg/Prim.h
- rts/prim/bitrev.c
- rts/prim/bswap.c
- rts/sm/GC.c
- rts/sm/Storage.c
- testsuite/driver/junit.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/tests/MiniQuickCheck.hs
- + testsuite/tests/backpack/should_compile/T27835.bkp
- + testsuite/tests/backpack/should_compile/T27835.stderr
- testsuite/tests/backpack/should_compile/all.T
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/default/default-fail05.stderr
- + testsuite/tests/dmdanal/should_run/T27845.hs
- + testsuite/tests/dmdanal/should_run/T27845.stdout
- + testsuite/tests/dmdanal/should_run/T27845_Lib.hs
- + testsuite/tests/dmdanal/should_run/T27845b.hs
- + testsuite/tests/dmdanal/should_run/T27845b.stdout
- + testsuite/tests/dmdanal/should_run/T27845b_Lib.hs
- testsuite/tests/dmdanal/should_run/all.T
- testsuite/tests/driver/all.T
- testsuite/tests/driver/multipleHomeUnits/mhu-closure/Makefile
- testsuite/tests/driver/multipleHomeUnits/mhu-closure/mhu-closure.stderr
- testsuite/tests/driver/multipleHomeUnits/mhu-closure/mhu-closure.stdout
- + testsuite/tests/driver/stringtrie.hs
- + testsuite/tests/driver/stringtrie.stdout
- testsuite/tests/ghc-api/downsweep/IncrementalDownsweep.hs
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/ghci.debugger/scripts/T14628.stderr
- + testsuite/tests/ghci/prog-mhu008/Makefile
- + testsuite/tests/ghci/prog-mhu008/a/M.hs
- + testsuite/tests/ghci/prog-mhu008/all.T
- + testsuite/tests/ghci/prog-mhu008/b/M.hs
- + testsuite/tests/ghci/prog-mhu008/prog-mhu008.script
- + testsuite/tests/ghci/prog-mhu008/prog-mhu008.stdout
- + testsuite/tests/ghci/prog-mhu008/unitA
- + testsuite/tests/ghci/prog-mhu008/unitB
- + testsuite/tests/ghci/scripts/T27641.script
- + testsuite/tests/ghci/scripts/T27641.stderr
- + testsuite/tests/ghci/scripts/T27641.stdout
- + testsuite/tests/ghci/scripts/T27834.hs
- + testsuite/tests/ghci/scripts/T27834.script
- + testsuite/tests/ghci/scripts/T27834.stdout
- testsuite/tests/ghci/scripts/all.T
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/hiefile/should_run/T24544.hs
- + testsuite/tests/impredicative/T27917.hs
- testsuite/tests/impredicative/all.T
- testsuite/tests/indexed-types/should_fail/T1897b.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/module/mod185.stderr
- + testsuite/tests/numeric/should_run/T27545.hs
- + testsuite/tests/numeric/should_run/T27545.stdout
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/package/T4806a.stderr
- testsuite/tests/package/all.T
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20718b.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- + testsuite/tests/perf/compiler/T25763.stderr
- testsuite/tests/perf/compiler/all.T
- + testsuite/tests/plugins/T26761.hs
- + testsuite/tests/plugins/T26761.stderr
- + testsuite/tests/plugins/T26761Plugin.hs
- + testsuite/tests/plugins/T26761a.hs
- testsuite/tests/plugins/all.T
- + testsuite/tests/primops/should_run/T27299.hs
- + testsuite/tests/primops/should_run/T27299.stdout
- testsuite/tests/primops/should_run/all.T
- testsuite/tests/printer/AnnotationNoListTuplePuns.stdout
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/profiling/should_run/caller-cc/CallerCcParser.hs
- + testsuite/tests/rts/T24450.hs
- + testsuite/tests/rts/T24450.stderr
- testsuite/tests/rts/all.T
- testsuite/tests/rts/rtsflags001.stderr-ws-32
- testsuite/tests/rts/rtsflags001.stderr-ws-64
- testsuite/tests/simplCore/should_compile/T22611.hs
- testsuite/tests/simplCore/should_compile/T22611.stderr
- + testsuite/tests/simplCore/should_compile/T22611a.hs
- + testsuite/tests/simplCore/should_compile/T7803.hs
- + testsuite/tests/simplCore/should_compile/T7803.stderr
- + testsuite/tests/simplCore/should_compile/T7803a.hs
- testsuite/tests/simplCore/should_compile/all.T
- testsuite/tests/typecheck/should_compile/LocalGivenEqs.hs
- + testsuite/tests/typecheck/should_compile/T26543_orig.hs
- + testsuite/tests/typecheck/should_compile/T27916.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T22707.stderr
- + testsuite/tests/typecheck/should_fail/T26543a.hs
- + testsuite/tests/typecheck/should_fail/T26543a.stderr
- testsuite/tests/typecheck/should_fail/all.T
- + testsuite/tests/warnings/should_fail/WExpectedNoArgError.stderr
- testsuite/tests/warnings/should_fail/all.T
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/785d28a06410e31d9f0e15e5f2ca6c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/785d28a06410e31d9f0e15e5f2ca6c…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/supersven/hadrian-cross-stage3] Generate default.target only from the successor stage for stage0
by Sven Tennie (@supersven) 11 Oct '26
by Sven Tennie (@supersven) 11 Oct '26
11 Oct '26
Sven Tennie pushed to branch wip/supersven/hadrian-cross-stage3 at Glasgow Haskell Compiler / GHC
Commits:
b2d34f97 by Sven Tennie at 2026-10-11T00:05:25+02:00
Generate default.target only from the successor stage for stage0
This mirrors the behaviour for the settings' rules.
- - - - -
1 changed file:
- hadrian/src/Rules/Generate.hs
Changes:
=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -287,7 +287,9 @@ generateRules = do
isCrossStage <- if compilerStage < Stage3
then expr (crossStage compilerStage)
else pure False
- let libraryStage = if isCrossStage then succStage compilerStage else compilerStage
+ let libraryStage = case compilerStage of
+ Stage0 {} -> Stage1
+ _ -> if isCrossStage then succStage compilerStage else compilerStage
tgt <- expr (targetStage libraryStage)
pure $ show tgt { tgtLocallyExecutable = not isCrossStage }
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b2d34f9787bff31b3e906387bdd94b7…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b2d34f9787bff31b3e906387bdd94b7…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0