Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC

Commits:

18 changed files:

Changes:

  • .gitlab/ci.sh
    ... ... @@ -982,23 +982,24 @@ function lint_changelog() {
    982 982
         exit 0
    
    983 983
       fi
    
    984 984
     
    
    985
    -  # Check that the MR adds at least one changelog entry.
    
    985
    +  # Check that the MR adds or modifies at least one changelog entry.
    
    986 986
       git fetch --depth=1 \
    
    987 987
         "$CI_MERGE_REQUEST_PROJECT_URL" \
    
    988 988
         "$CI_MERGE_REQUEST_DIFF_BASE_SHA"
    
    989 989
     
    
    990
    -  local added
    
    991
    -  added=$(git diff --name-only --diff-filter=A \
    
    990
    +  local entries
    
    991
    +  entries=$(git diff --name-only --diff-filter=AM \
    
    992 992
         "$CI_MERGE_REQUEST_DIFF_BASE_SHA..$CI_COMMIT_SHA" -- \
    
    993 993
         'changelog.d/' | grep -v '^changelog.d/config$' || true)
    
    994 994
     
    
    995
    -  if [ -z "$added" ]; then
    
    995
    +  if [ -z "$entries" ]; then
    
    996 996
         error "No changelog entry found in changelog.d/"
    
    997
    -    echo "Please add a changelog entry file describing your user-facing changes."
    
    997
    +    echo "Please add a changelog entry file describing your user-facing changes,"
    
    998
    +    echo "or add this MR to the 'mrs' field of an existing entry."
    
    998 999
         echo "If this MR does not need a changelog entry, apply the 'no-changelog' label."
    
    999 1000
         exit 1
    
    1000 1001
       fi
    
    1001
    -  echo "Found changelog entries: $added"
    
    1002
    +  echo "Found changelog entries: $entries"
    
    1002 1003
     
    
    1003 1004
       # Build changelog-d with the bootstrap compiler and validate all entries
    
    1004 1005
       # (checks required fields, section names, and the MR number).
    

  • changelog.d/27641
    1
    +section: ghci
    
    2
    +synopsis: Don't accept modules in `:add` that the loader will reject
    
    3
    +issues: #27641
    
    4
    +mrs: !16734

  • changelog.d/unit-index
    1 1
     section: compiler
    
    2 2
     synopsis: Use global ``UnitIndex`` to deduplicate ``UnitInfo``s over multiple home units
    
    3
    -issues: #27500 #26423 #27748
    
    4
    -mrs: !16115 !16598
    
    3
    +issues: #27500 #26423 #27748 #27834
    
    4
    +mrs: !16115 !16598 !16743
    
    5 5
     
    
    6 6
     description: {
    
    7 7
         The ``UnitState`` used to be duplicated for all ``HomeUnitEnv``, not sharing any of the ``UnitInfo``s.
    

  • compiler/GHC/Unit/External/Wired.hs
    ... ... @@ -5,6 +5,7 @@ module GHC.Unit.External.Wired (
    5 5
       isWireMapEmpty,
    
    6 6
       lookupWireMap,
    
    7 7
       listWireMap,
    
    8
    +  nonDetFoldWireMap,
    
    8 9
       -- * 'UnwireMap'
    
    9 10
       UnwireMap,
    
    10 11
       emptyUnwireMap,
    
    ... ... @@ -48,6 +49,9 @@ lookupWireMap uid (WireMap wmap) = lookupUniqMap wmap uid
    48 49
     listWireMap :: WireMap -> [(UnitId, UnitId)]
    
    49 50
     listWireMap (WireMap wmap) = nonDetUniqMapToList wmap
    
    50 51
     
    
    52
    +nonDetFoldWireMap :: ((UnitId, UnitId) -> b -> b) -> b -> WireMap -> b
    
    53
    +nonDetFoldWireMap go z (WireMap uniq) = nonDetFoldUniqMap go z uniq
    
    54
    +
    
    51 55
     -- | The reverse of 'WireMap'.
    
    52 56
     -- Records the mapping from the wired-in 'UnitId' to the on-disk 'UnitId'.
    
    53 57
     newtype UnwireMap =
    

  • compiler/GHC/Unit/State.hs
    ... ... @@ -286,6 +286,21 @@ trustUnits elements (TrustOverlay to) = TrustOverlay $ foldl' (\ acc uid -> addT
    286 286
     emptyTrustOverlay :: TrustOverlay
    
    287 287
     emptyTrustOverlay = TrustOverlay emptyUniqMap
    
    288 288
     
    
    289
    +-- | For all values in the 'WireMap', copy the recorded trust/distrust
    
    290
    +-- for the wired-in unit id.
    
    291
    +--
    
    292
    +extendForWireMap :: TrustOverlay -> WireMap -> TrustOverlay
    
    293
    +extendForWireMap to wmap =
    
    294
    +  nonDetFoldWireMap go to wmap
    
    295
    +  where
    
    296
    +    go (onDiskUid, wiredInUid) overlay =
    
    297
    +      case lookupTrustOverlay overlay onDiskUid of
    
    298
    +        Nothing -> overlay
    
    299
    +        Just Trusted ->
    
    300
    +          trustUnits [wiredInUid] overlay
    
    301
    +        Just Distrusted ->
    
    302
    +          distrustUnits [wiredInUid] overlay
    
    303
    +
    
    289 304
     {-
    
    290 305
     Note [Sharing 'UnitInfo's across the 'UnitEnv']
    
    291 306
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    ... ... @@ -957,7 +972,7 @@ mkUnitState logger unit_index cfg = do
    957 972
              , explicitUnits                = explicit_pkgs
    
    958 973
              , homeUnitDepends              = home_unit_deps
    
    959 974
              , unitInfoMap                  = pkg_db
    
    960
    -         , trustedUnits                 = trustUnitsOverlay
    
    975
    +         , trustedUnits                 = trustUnitsOverlay `extendForWireMap` wired_map
    
    961 976
              , moduleNameProvidersMap       = mod_map
    
    962 977
              , pluginModuleNameProvidersMap = mkModuleNameProvidersMap logger (unitConfigAllowVirtual cfg) pkg_db plugin_vis_map
    
    963 978
              , packageNameMap               = pkgname_map
    

  • ghc/GHCi/UI.hs
    ... ... @@ -180,6 +180,7 @@ import GHC.IO.Handle ( hFlushAll )
    180 180
     import GHC.TopHandler ( topHandler )
    
    181 181
     
    
    182 182
     import qualified GHC.Unit.Module.Graph as GHC
    
    183
    +import GHC.Unit.Home.Graph (memberHugUnit)
    
    183 184
     
    
    184 185
     -----------------------------------------------------------------------------
    
    185 186
     
    
    ... ... @@ -2400,7 +2401,9 @@ addModule files = do
    2400 2401
           result <- liftIO $
    
    2401 2402
             Finder.findImportedModule hsc_env Finder.LookupUser m NoPkgQual
    
    2402 2403
           case result of
    
    2403
    -        Found _ _ -> return True
    
    2404
    +        -- We could find a module from a dependency, such as `Data.List`, but we can't
    
    2405
    +        -- actualy load that unless the module is located in a home unit.
    
    2406
    +        Found _ m | moduleUnit m `memberHugUnit` hsc_HUG hsc_env -> return True
    
    2404 2407
             _ -> do reportError (GhciModuleError $ GhciModuleNotFound (moduleNameString m))
    
    2405 2408
                     return False
    
    2406 2409
     
    

  • libraries/base/changelog.md
    ... ... @@ -7,6 +7,7 @@
    7 7
       * Add `Data.List.NonEmpty.{zip{3..7},zipWith{3..7},unzip{3..7}}` ([CLC proposal #409)(https://github.com/haskell/core-libraries-committee/issues/409))
    
    8 8
       * Ensure that `Data.List.elem` and `notElem` can be specialized even when no list fusion happens. ([CLC proposal #412)(https://github.com/haskell/core-libraries-committee/issues/412))
    
    9 9
       * Introduce `Data.Double` and `Data.Float` modules. ([CLC proposal #378](https://github.com/haskell/core-libraries-committee/issues/378))
    
    10
    +  * Remove `bitSize` from `MINIMAL` pragma of `class Bits`. ([CLC proposal #440](https://github.com/haskell/core-libraries-committee/issues/440))
    
    10 11
       * Change `Generically a`'s `Monoid` definition to require a `Semigroup` constraint, and define its `mconcat` using `(<>)` from that constraint. ([CLC proposal #413](https://github.com/haskell/core-libraries-committee/issues/413))
    
    11 12
       * Add `withEmptyCallStack` to `GHC.Stack`. ([CLC proposal #428](https://github.com/haskell/core-libraries-committee/issues/428))
    
    12 13
       * Add new `Data.RealFloat` module re-exporting `RealFloat` from `GHC.Float` ([CLC proposal #394](https://github.com/haskell/core-libraries-committee/issues/394))
    

  • libraries/ghc-internal/src/GHC/Internal/Bits.hs
    ... ... @@ -90,7 +90,7 @@ class Eq a => Bits a where
    90 90
         {-# MINIMAL (.&.), (.|.), xor, complement,
    
    91 91
                     (shift | (shiftL, shiftR)),
    
    92 92
                     (rotate | (rotateL, rotateR)),
    
    93
    -                bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-}
    
    93
    +                bitSizeMaybe, isSigned, testBit, bit, popCount #-}
    
    94 94
     
    
    95 95
         -- | Bitwise \"and\"
    
    96 96
         (.&.) :: a -> a -> a
    

  • testsuite/tests/ghci/scripts/T27641.script
    1
    +:add Data.List
    
    2
    +:reload
    
    3
    +putStrLn ":add Data.List should fail and a subsequent :reload should succeed"

  • testsuite/tests/ghci/scripts/T27641.stderr
    1
    +<interactive>: error: [GHCi-23305] Module Data.List not found
    
    2
    +

  • testsuite/tests/ghci/scripts/T27641.stdout
    1
    +:add Data.List should fail and a subsequent :reload should succeed

  • testsuite/tests/ghci/scripts/T27834.hs
    1
    +{-# LANGUAGE Haskell2010 #-}
    
    2
    +{-# LANGUAGE Safe #-}
    
    3
    +module Main where
    
    4
    +
    
    5
    +-- Importing a wired-in in module should honour trustworthiness
    
    6
    +import GHC.Internal.Char (chr)
    
    7
    +
    
    8
    +main :: IO ()
    
    9
    +main = print (chr 120)

  • testsuite/tests/ghci/scripts/T27834.script
    1
    +:load T27834
    
    2
    +putStrLn "Can import trusted module from ghc-internal"

  • testsuite/tests/ghci/scripts/T27834.stdout
    1
    +Can import trusted module from ghc-internal

  • testsuite/tests/ghci/scripts/all.T
    ... ... @@ -402,3 +402,5 @@ test('GhciPackageRename',
    402 402
          ghci_script,
    
    403 403
          ['GhciPackageRename.script'])
    
    404 404
     test('T26233', normal, ghci_script, ['T26233.script'])
    
    405
    +test('T27641', normal, ghci_script, ['T27641.script'])
    
    406
    +test('T27834', [extra_hc_opts("-fpackage-trust -trust base -trust ghc-internal -package ghc-internal")], ghci_script, ['T27834.script'])

  • testsuite/tests/interface-stability/base-exports.stdout
    No preview for this file type
  • testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
    No preview for this file type
  • testsuite/tests/interface-stability/base-exports.stdout-mingw32
    No preview for this file type