Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 93a90e4a by Simon Jakobi at 2026-10-02T13:37:17-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 - - - - - d50b26bc by Simon Jakobi at 2026-10-02T13:37:18-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 - - - - - 83d3989a by Simon Jakobi at 2026-10-02T13:37:18-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 - - - - - dcf52c44 by Hannes Siebenhandl at 2026-10-02T13:37:19-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. - - - - - 10 changed files: - .gitlab/ci.sh - changelog.d/T27455 - changelog.d/semaphore-v2 - changelog.d/unit-index - compiler/GHC/Unit/External/Wired.hs - compiler/GHC/Unit/State.hs - + testsuite/tests/ghci/scripts/T27834.hs - + testsuite/tests/ghci/scripts/T27834.script - + testsuite/tests/ghci/scripts/T27834.stdout - testsuite/tests/ghci/scripts/all.T Changes: ===================================== .gitlab/ci.sh ===================================== @@ -982,23 +982,24 @@ function lint_changelog() { exit 0 fi - # Check that the MR adds at least one changelog entry. + # Check that the MR adds or modifies at least one changelog entry. git fetch --depth=1 \ "$CI_MERGE_REQUEST_PROJECT_URL" \ "$CI_MERGE_REQUEST_DIFF_BASE_SHA" - local added - added=$(git diff --name-only --diff-filter=A \ + local entries + entries=$(git diff --name-only --diff-filter=AM \ "$CI_MERGE_REQUEST_DIFF_BASE_SHA..$CI_COMMIT_SHA" -- \ 'changelog.d/' | grep -v '^changelog.d/config$' || true) - if [ -z "$added" ]; then + if [ -z "$entries" ]; then error "No changelog entry found in changelog.d/" - echo "Please add a changelog entry file describing your user-facing changes." + echo "Please add a changelog entry file describing your user-facing changes," + echo "or add this MR to the 'mrs' field of an existing entry." echo "If this MR does not need a changelog entry, apply the 'no-changelog' label." exit 1 fi - echo "Found changelog entries: $added" + echo "Found changelog entries: $entries" # Build changelog-d with the bootstrap compiler and validate all entries # (checks required fields, section names, and the MR number). ===================================== changelog.d/T27455 ===================================== @@ -4,5 +4,5 @@ mrs: !16274 synopsis: Don't drop `ExceptionContext` in `SomeException(toException)` description: - Previously the implementation of ``Exception(toException)`` given to `SomeException` would inappropriately drop the carried `ExceptionContext`. Now ``toException = id``, faithfully implementing the semantics proposed in :ref:`CLC Proposal #200 <https://github.com/haskell/core-libraries-committee/issues/200>`. + Previously the implementation of ``Exception(toException)`` given to `SomeException` would inappropriately drop the carried `ExceptionContext`. Now ``toException = id``, faithfully implementing the semantics proposed in `CLC Proposal #200 <https://github.com/haskell/core-libraries-committee/issues/200>`_. ===================================== changelog.d/semaphore-v2 ===================================== @@ -12,7 +12,7 @@ description: semaphores); its reported protocol version remains v1. When GHC receives a ``-jsem`` name whose protocol version it does not - support, it now emits a ``-Wsemaphore-version-mismatch`` warning and + support, it now emits a :ghc-flag:`-Wsemaphore-open-failure` warning and falls back to ``-j1`` rather than crashing. ``ghc --info`` exposes the supported version in a new ``"Semaphore version"`` entry so cabal-install can detect a mismatch before invoking GHC. ===================================== changelog.d/unit-index ===================================== @@ -1,7 +1,7 @@ section: compiler synopsis: Use global ``UnitIndex`` to deduplicate ``UnitInfo``s over multiple home units -issues: #27500 #26423 #27748 -mrs: !16115 !16598 +issues: #27500 #26423 #27748 #27834 +mrs: !16115 !16598 !16743 description: { 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 ( isWireMapEmpty, lookupWireMap, listWireMap, + nonDetFoldWireMap, -- * 'UnwireMap' UnwireMap, emptyUnwireMap, @@ -48,6 +49,9 @@ lookupWireMap uid (WireMap wmap) = lookupUniqMap wmap uid listWireMap :: WireMap -> [(UnitId, UnitId)] listWireMap (WireMap wmap) = nonDetUniqMapToList wmap +nonDetFoldWireMap :: ((UnitId, UnitId) -> b -> b) -> b -> WireMap -> b +nonDetFoldWireMap go z (WireMap uniq) = nonDetFoldUniqMap go z uniq + -- | The reverse of 'WireMap'. -- Records the mapping from the wired-in 'UnitId' to the on-disk 'UnitId'. newtype UnwireMap = ===================================== compiler/GHC/Unit/State.hs ===================================== @@ -286,6 +286,21 @@ trustUnits elements (TrustOverlay to) = TrustOverlay $ foldl' (\ acc uid -> addT emptyTrustOverlay :: TrustOverlay emptyTrustOverlay = TrustOverlay emptyUniqMap +-- | For all values in the 'WireMap', copy the recorded trust/distrust +-- for the wired-in unit id. +-- +extendForWireMap :: TrustOverlay -> WireMap -> TrustOverlay +extendForWireMap to wmap = + nonDetFoldWireMap go to wmap + where + go (onDiskUid, wiredInUid) overlay = + case lookupTrustOverlay overlay onDiskUid of + Nothing -> overlay + Just Trusted -> + trustUnits [wiredInUid] overlay + Just Distrusted -> + distrustUnits [wiredInUid] overlay + {- Note [Sharing 'UnitInfo's across the 'UnitEnv'] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -957,7 +972,7 @@ mkUnitState logger unit_index cfg = do , explicitUnits = explicit_pkgs , homeUnitDepends = home_unit_deps , unitInfoMap = pkg_db - , trustedUnits = trustUnitsOverlay + , trustedUnits = trustUnitsOverlay `extendForWireMap` wired_map , moduleNameProvidersMap = mod_map , pluginModuleNameProvidersMap = mkModuleNameProvidersMap logger (unitConfigAllowVirtual cfg) pkg_db plugin_vis_map , packageNameMap = pkgname_map ===================================== testsuite/tests/ghci/scripts/T27834.hs ===================================== @@ -0,0 +1,9 @@ +{-# LANGUAGE Haskell2010 #-} +{-# LANGUAGE Safe #-} +module Main where + +-- Importing a wired-in in module should honour trustworthiness +import GHC.Internal.Char (chr) + +main :: IO () +main = print (chr 120) ===================================== testsuite/tests/ghci/scripts/T27834.script ===================================== @@ -0,0 +1,2 @@ +:load T27834 +putStrLn "Can import trusted module from ghc-internal" ===================================== testsuite/tests/ghci/scripts/T27834.stdout ===================================== @@ -0,0 +1 @@ +Can import trusted module from ghc-internal ===================================== testsuite/tests/ghci/scripts/all.T ===================================== @@ -403,3 +403,4 @@ test('GhciPackageRename', ['GhciPackageRename.script']) test('T26233', normal, ghci_script, ['T26233.script']) test('T27641', normal, ghci_script, ['T27641.script']) +test('T27834', [extra_hc_opts("-fpackage-trust -trust base -trust ghc-internal -package ghc-internal")], ghci_script, ['T27834.script']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c67e8aadcb704a785abed8ef43c4906... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c67e8aadcb704a785abed8ef43c4906... 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