[Git][ghc/ghc][master] 2 commits: ci: bump freebsd boot ghc to 9.10.3
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 87db83e2 by Cheng Shao at 2026-04-24T14:37:21-04:00 ci: bump freebsd boot ghc to 9.10.3 This commit bumps freebsd boot ghc to 9.10.3 to align with other platforms and prevent outdated boot libs in boot ghc to block the freebsd job. - - - - - 17e3a0b7 by Cheng Shao at 2026-04-24T14:37:21-04:00 compiler: improve Binary instance of Array This patch improves the `Binary` instance of `Array`: - We no longer allocate intermediate lists. When serializing an `Array`, we iterate over the elements directly; when deserializing it, we allocate the result `Array` and fill it in a loop. - Now we only serialize the array bounds tuple; the length field is not needed. Closes #27109. - - - - - 4 changed files: - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + changelog.d/binary-array-no-list - compiler/GHC/Utils/Binary.hs Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -445,7 +445,7 @@ opsysVariables _ FreeBSD14 = mconcat -- Prefer to use the system's clang-based toolchain and not gcc , "CC" =: "cc" , "CXX" =: "c++" - , "FETCH_GHC_VERSION" =: "9.10.1" + , "FETCH_GHC_VERSION" =: "9.10.3" , "CABAL_INSTALL_VERSION" =: "3.14.2.0" ] opsysVariables arch (Linux distro) = distroVariables arch distro ===================================== .gitlab/jobs.yaml ===================================== @@ -1721,7 +1721,7 @@ "CC": "cc", "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check", "CXX": "c++", - "FETCH_GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.3", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-freebsd14-validate", @@ -4543,7 +4543,7 @@ "CC": "cc", "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check", "CXX": "c++", - "FETCH_GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.3", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", @@ -5643,7 +5643,7 @@ "CC": "cc", "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check", "CXX": "c++", - "FETCH_GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.3", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-freebsd14-validate" ===================================== changelog.d/binary-array-no-list ===================================== @@ -0,0 +1,13 @@ +section: compiler +synopsis: Reduce allocations when (de)serialising `Array` in the `ghc` library. +issues: #27109 +mrs: !15805 + +description: { + The `ghc` library's `Binary` instance for `Array` was changed to + avoid allocating an intermediate list and to omit a redundant length + field during (de)serialisation. + + This should only affect the `ghc` library's (de)serialisation code paths, + primarily when parsing HIE files and bytecode objects. +} ===================================== compiler/GHC/Utils/Binary.hs ===================================== @@ -142,6 +142,8 @@ import Control.DeepSeq import Control.Monad ( when, (<$!>), unless, forM_, void ) import Foreign hiding (bit, setBit, clearBit, shiftL, shiftR, void) import Data.Array +import Data.Array.Base (unsafeFreezeIOArray) +import Data.Array.IArray (traverseArray_) import Data.Array.IO import Data.Array.Unsafe import qualified Data.Binary as Binary @@ -970,11 +972,12 @@ instance Binary a => Binary (NonEmpty a) where instance (Ix a, Binary a, Binary b) => Binary (Array a b) where put_ bh arr = do put_ bh $ bounds arr - put_ bh $ elems arr + traverseArray_ (put_ bh) arr + get bh = do - bounds <- get bh - xs <- get bh - return $ listArray bounds xs + (l, u) <- get bh + marr <- newGenArray (l, u) $ \_ -> get bh + unsafeFreezeIOArray marr instance Binary a => Binary (SmallArray a) where put_ bh sa = do View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4ed78760a5e1c303b0bb7bbf111dff5... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4ed78760a5e1c303b0bb7bbf111dff5... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)