[Git][ghc/ghc][wip/binary-array-no-list] 2 commits: ci: bump freebsd boot ghc to 9.10.3
Cheng Shao pushed to branch wip/binary-array-no-list at Glasgow Haskell Compiler / GHC Commits: b75a01f8 by Cheng Shao at 2026-04-08T11:55:52+00: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. - - - - - 5c9b59dc by Cheng Shao at 2026-04-08T11:55:52+00: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. - - - - - 3 changed files: - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - 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" ===================================== 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/1a713d562961d5db909a97031962d86... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1a713d562961d5db909a97031962d86... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Cheng Shao (@TerrorJack)