Hannes Siebenhandl pushed to branch wip/fendor/bump-ci-to-9.10 at Glasgow Haskell Compiler / GHC Commits: bcdec657 by Zubin Duggal at 2025-08-05T10:37:29+05:30 compiler: Export a version of `newNameCache` that is not prone to footguns. `newNameCache` must be initialized with both a non-"reserved" unique tag, as well as a list of known key names. Failing to do so results in hard to debug unique conflicts. It is difficult for API users to tell which unique tags are safe to use. So instead of leaving this up to the user to decide, we now export a version of `newNameCache` which uses a guaranteed non-reserved unique tag. In fact, this is now the way the unique tag is initialized for all invocations of the compiler. The original version of `newNameCache` is now exported as `newNameCache'` for advanced users. We also deprecate `initNameCache` as it is also prone to footguns and is completely subsumed in functionality by `newNameCache` and `newNameCache'`. Fixes #26135 and #26055 - - - - - 57d3b4a8 by Andrew Lelechenko at 2025-08-05T18:36:31-04:00 hadrian: bump Stackage snapshot to LTS 24.2 / GHC 9.10.2 In line with #25693 we should use GHC 9.10 as a boot compiler, while Hadrian stack.yaml was stuck on GHC 9.6. - - - - - c2a78cea by Peng Fan at 2025-08-05T18:37:27-04:00 NCG/LA64: implement atomic write with finer-grained DBAR hints Signed-off-by: Peng Fan <fanpeng@loongson.cn> - - - - - 95231c8e by Teo Camarasu at 2025-08-06T08:35:58-04:00 CODEOWNERS: add CLC as codeowner of base We also remove hvr, since I think he is no longer active - - - - - 77df0ded by Andrew Lelechenko at 2025-08-06T08:36:39-04:00 Bump submodule text to 2.1.3 - - - - - 8af260d0 by Nikolaos Chatzikonstantinou at 2025-08-06T08:37:23-04:00 docs: fix internal import in getopt examples This external-facing doc example shouldn't mention GHC internals when using 'fromMaybe'. - - - - - 574d7d3e by fendor at 2025-08-06T16:50:55+00:00 Bump GHC on darwin CI to 9.10.1 - - - - - 10 changed files: - .gitlab/darwin/toolchain.nix - CODEOWNERS - compiler/GHC/CmmToAsm/LA64/CodeGen.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Types/Name/Cache.hs - hadrian/stack.yaml - hadrian/stack.yaml.lock - libraries/base/src/System/Console/GetOpt.hs - libraries/text - testsuite/tests/hiefile/should_run/TestUtils.hs Changes: ===================================== .gitlab/darwin/toolchain.nix ===================================== @@ -16,18 +16,17 @@ let ghcBindists = let version = ghc.version; in { aarch64-darwin = hostPkgs.fetchurl { url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-aarch64-apple-darwin.tar.xz"; - sha256 = "sha256-c1GTMJf3/yiW/t4QL532EswD5JVlgA4getkfsxj4TaA="; + sha256 = "sha256-/6+DtdeossBJIMbjkJwL4h3eJ7rzgNCV+ifoQKOi6AQ="; }; x86_64-darwin = hostPkgs.fetchurl { url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-x86_64-apple-darwin.tar.xz"; - sha256 = "sha256-LrYniMG0phsvyW6dhQC+3ompvzcxnwAe6GezEqqzoTQ="; + sha256 = "sha256-jPIhiJMOENesUnDUJeIaPatgavc6ZVSTY5NFIAxlC+k="; }; }; ghc = pkgs.stdenv.mkDerivation rec { - # Using 9.6.2 because of #24050 - version = "9.6.2"; + version = "9.10.1"; name = "ghc"; src = ghcBindists.${pkgs.stdenv.hostPlatform.system}; configureFlags = [ ===================================== CODEOWNERS ===================================== @@ -59,7 +59,7 @@ /compiler/GHC/Runtime/Interpreter/Wasm.hs @TerrorJack [Core libraries] -/libraries/base/ @hvr +/libraries/base/ @core-libraries /libraries/ghci/ @simonmar /libraries/template-haskell/ @rae /testsuite/tests/interface-stability/ @core-libraries ===================================== compiler/GHC/CmmToAsm/LA64/CodeGen.hs ===================================== @@ -1972,9 +1972,17 @@ genCCall target dest_regs arg_regs = do (val, fmt_val, code_val) <- getSomeReg val_reg let instrs = case ord of MemOrderRelaxed -> unitOL $ ann moDescr (ST fmt_val (OpReg w val) (OpAddr $ AddrReg p)) - -- implement with AMSWAPDB - MemOrderRelease -> unitOL $ ann moDescr (AMSWAPDB fmt_val (OpReg w zeroReg) (OpReg w val) (OpReg w p)) - MemOrderSeqCst -> unitOL $ ann moDescr (AMSWAPDB fmt_val (OpReg w zeroReg) (OpReg w val) (OpReg w p)) + -- AMSWAP_DB* insns implentment a fully functional synchronization barrier, like DBAR 0x0. + -- This is terrible. And AMSWAPDB only supports ISA version greater than LA64V1_0. So, + -- implement with DBAR + MemOrderRelease -> toOL [ + ann moDescr (DBAR HintRelease), + ST fmt_val (OpReg w val) (OpAddr $ AddrReg p) + ] + MemOrderSeqCst -> toOL [ + ann moDescr (DBAR HintSeqcst), + ST fmt_val (OpReg w val) (OpAddr $ AddrReg p) + ] _ -> panic $ "Unexpected MemOrderAcquire on an AtomicWrite" ++ show mo moDescr = (text . show) mo code = ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -245,7 +245,7 @@ import GHC.Types.IPE import GHC.Types.SourceFile import GHC.Types.SrcLoc import GHC.Types.Name -import GHC.Types.Name.Cache ( newNameCache, knownKeysOrigNameCache ) +import GHC.Types.Name.Cache ( newNameCache ) import GHC.Types.Name.Reader import GHC.Types.Name.Ppr import GHC.Types.TyThing @@ -322,7 +322,7 @@ newHscEnv top_dir dflags = do newHscEnvWithHUG :: FilePath -> DynFlags -> UnitId -> HomeUnitGraph -> IO HscEnv newHscEnvWithHUG top_dir top_dynflags cur_unit home_unit_graph = do - nc_var <- newNameCache 'r' knownKeysOrigNameCache + nc_var <- newNameCache fc_var <- initFinderCache logger <- initLogger tmpfs <- initTmpFs ===================================== compiler/GHC/Types/Name/Cache.hs ===================================== @@ -4,6 +4,7 @@ module GHC.Types.Name.Cache ( NameCache (..) , newNameCache + , newNameCacheWith , initNameCache , takeUniqFromNameCache , updateNameCache' @@ -140,11 +141,27 @@ extendOrigNameCache nc mod occ name where combine _ occ_env = extendOccEnv occ_env occ name -newNameCache :: Char -> OrigNameCache -> IO NameCache -newNameCache c nc = NameCache c <$> newMVar nc +-- | Initialize a new name cache +newNameCache :: IO NameCache +newNameCache = newNameCacheWith 'r' knownKeysOrigNameCache +-- | This is a version of `newNameCache` that lets you supply your +-- own unique tag and set of known key names. This can go wrong if the tag +-- supplied is one reserved by GHC for internal purposes. See #26055 for +-- an example. +-- +-- Use `newNameCache` when possible. +newNameCacheWith :: Char -> OrigNameCache -> IO NameCache +newNameCacheWith c nc = NameCache c <$> newMVar nc + +-- | This takes a tag for uniques to be generated and the list of knownKeyNames +-- These must be initialized properly to ensure that names generated from this +-- NameCache do not conflict with known key names. +-- +-- Use `newNameCache` or `newNameCacheWith` instead +{-# DEPRECATED initNameCache "Use newNameCache or newNameCacheWith instead" #-} initNameCache :: Char -> [Name] -> IO NameCache -initNameCache c names = newNameCache c (initOrigNames names) +initNameCache c names = newNameCacheWith c (initOrigNames names) initOrigNames :: [Name] -> OrigNameCache initOrigNames names = foldl' extendOrigNameCache' emptyModuleEnv names ===================================== hadrian/stack.yaml ===================================== @@ -1,6 +1,6 @@ -# GHC's configure script reports that GHC versions 9.6 and greater are required +# GHC's configure script reports that GHC versions 9.10 and greater are required # to build GHC from source. -resolver: lts-22.44 # GHC 9.6.7 +resolver: lts-24.2 # GHC 9.10.2 packages: - '.' ===================================== hadrian/stack.yaml.lock ===================================== @@ -1,7 +1,7 @@ # This file was autogenerated by Stack. # You should not edit this file by hand. # For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files +# https://docs.haskellstack.org/en/stable/topics/lock_files packages: - completed: @@ -40,9 +40,9 @@ packages: original: hackage: filepath-1.4.300.2 - completed: - hackage: process-1.6.25.0@sha256:092ab61596e914d21983aa2e9206a74c4faa38a5a636446b5c954305821cb496,2749 + hackage: process-1.6.25.0@sha256:9a0b2ef8096517fa0e0c7a5e9a5c2ae5744ed824c3331005f9408245810df345,2640 pantry-tree: - sha256: bdab416d3c454ad716d4fab1ced490cc75330658c1c7c66a0b6f4b3e5125017b + sha256: 9c7927cd4d7f2f4c64251256eb6904800b3922fa5c5424c60f0e08441693e12b size: 1790 original: hackage: process-1.6.25.0 @@ -55,7 +55,7 @@ packages: hackage: unix-2.8.5.1 snapshots: - completed: - sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9 - size: 721141 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/maste... - original: lts-22.44 + sha256: cd28bd74375205718f1d5fa221730a9c17a203059708b1eb95f4b20d68bf82d9 + size: 724943 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/maste... + original: lts-24.2 ===================================== libraries/base/src/System/Console/GetOpt.hs ===================================== @@ -315,7 +315,7 @@ arguments:
module Opts1 where
import System.Console.GetOpt -> import GHC.Internal.Data.Maybe ( fromMaybe ) +> import Data.Maybe ( fromMaybe )
data Flag = Verbose | Version @@ -356,7 +356,7 @@ A different approach is to group the option values in a record of type module Opts2 where
import System.Console.GetOpt -> import GHC.Internal.Data.Maybe ( fromMaybe ) +> import Data.Maybe ( fromMaybe )
data Options = Options { optVerbose :: Bool
===================================== libraries/text ===================================== @@ -1 +1 @@ -Subproject commit f1a05704a153ecc6a9bd45f6df8dd99820e74a2d +Subproject commit 5f343f668f421bfb30cead594e52d0ac6206ff67 ===================================== testsuite/tests/hiefile/should_run/TestUtils.hs ===================================== @@ -25,9 +25,6 @@ import GHC.Iface.Ext.Utils import GHC.Driver.Session import GHC.SysTools -makeNc :: IO NameCache -makeNc = initNameCache 'z' [] - dynFlagsForPrinting :: String -> IO DynFlags dynFlagsForPrinting libdir = do systemSettings <- initSysTools libdir @@ -37,7 +34,7 @@ readTestHie :: FilePath -> IO (DynFlags, HieFile) readTestHie fp = do libdir:_ <- getArgs df <- dynFlagsForPrinting libdir - nc <- makeNc + nc <- newNameCache hfr <- readHieFile nc fp pure (df, hie_file_result hfr) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c37860190cfffe719515be9bee7961... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c37860190cfffe719515be9bee7961... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Hannes Siebenhandl (@fendor)