[Git][ghc/ghc][wip/sjakobi/multi-caret] 13 commits: compiler: use nubOrd from containers
Simon Jakobi pushed to branch wip/sjakobi/multi-caret at Glasgow Haskell Compiler / GHC Commits: 576987d0 by Simon Jakobi at 2026-06-02T04:53:36-04:00 compiler: use nubOrd from containers Address #27103 by replacing GHC.Utils.Misc.ordNub[On] with Data.Containers.ListUtils.nubOrd[On]. Note that nubOrd suffers from a small inefficiency, a fix for which will be included in the next containers release: https://github.com/haskell/containers/issues/1202 - - - - - deea53c3 by David Eichmann at 2026-06-02T04:54:22-04:00 Hadrian: disable response files for GHC/Haddock builders on non-Windows This makes debugging build errors easier on non-windows hosts. See issue #27230 - - - - - f2f5c6ba by Nikita Efremov at 2026-06-02T16:04:54+00:00 fix typo : compete with performance, not complete - - - - - 5524ea0e by Wolfgang Jeltsch at 2026-06-03T08:01:26-04:00 Make the current `base` buildable with GHC 9.14 This comprises the following changes: * Disable some imports into `GHC.Base` for GHC 9.14 * Disable some imports into `Prelude` for GHC 9.14 * Disable separate `ArrowLoop` import for GHC 9.14 * Disable `GHC.Internal.STM` import for GHC 9.14 * Disable `GHC.Internal.Unicode.Version` import for GHC 9.14 * Disable `GHC.Internal.TH.Monad` import for GHC 9.14 * Add alternative `fixIO` import for GHC 9.14 * Add alternative `unsafeCodeCoerce` import for GHC 9.14 * Disable hiding of imported SIMD operations for GHC 9.14 * Disable use of GHC 9.14’s `printToHandleFinalizerExceptionHandler` * Enable use of `getFileHash` from `ghc-internal` for GHC 9.14 * Make `thenA` available for GHC 9.14 * Make `thenM` available for GHC 9.14 * Disable translation of `IoManagerFlagPoll` for GHC 9.14 * Add `hGetNewlineMode` for GHC 9.14 - - - - - d3438055 by Enrico Maria De Angelis at 2026-06-03T08:02:17-04:00 Fix #27067 - Clarify haddocks on `minusNaturalMaybe` - - - - - f9bcfac2 by sheaf at 2026-06-03T14:47:19-04:00 Avoid mkTick in Core Prep breaking ANF As discovered in #27182, mkTick can break ANF. This patch introduces a variant of mkTick that skips the single optimisation that could break ANF. This is preferrable over switching to the raw Tick constructor, as the latter may introduce spurious cost centres in profiling reports. This is a temporary measure until we more thoroughly refactor how mkTick works (see #27141). See Note [mkTick breaks ANF] in GHC.CoreToStg.Prep. Fixes #27182 - - - - - cf1fd661 by Artem Pelenitsyn at 2026-06-03T14:48:09-04:00 clarify comment for getSizeofMutableByteArray#: we get the size in bytes, not "elements" - - - - - a3b431f3 by David Eichmann at 2026-06-04T10:10:19+00:00 Hadrian: convert env variable ACLOCAL_PATH to unix paths. Convert ACLOCAL_PATH to a unix style path when invoking autoreconf. Autoreconf doesn't handle windows paths. See Note [Autoreconf unix paths from ACLOCAL_PATH]. Fixes #27311 - - - - - 18f6138a by Simon Jakobi at 2026-06-04T20:20:31-04:00 testsuite: Deduplicate --only test names config.only is assumed to be a set, but supplying --only overwrote it with the (list) argparse result, which can contain duplicates. When a test ran, config.only.remove(name) dropped only the first occurrence, so a duplicated name lingered and was later misreported as a "test not found" framework failure. Store it as a set instead. Fixes #27322 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> - - - - - 2f3cc9ff by Simon Jakobi at 2026-06-08T07:55:49-04:00 testsuite: detect fast bignum via ghc-internal, not removed ghc-bignum The ghc-bignum package was merged into ghc-internal, so the BIGNUM_GMP probe in test.mk ran `ghc-pkg field ghc-bignum exposed-modules`, which fails with "cannot find package ghc-bignum". That error went to stderr and leaked into the captured stderr of every makefile_test, causing spurious [bad stderr] failures across the suite. The probe also silently returned empty, so config.have_fast_bignum was wrongly False even on GMP builds. Probe ghc-internal's extra-libraries for the gmp library instead: the GMP backend module is an other-module (not exposed), but GMP_LIBS adds gmp to extra-libraries only on a GMP build, so this distinguishes the backends. Redirect stderr to keep any future missing-package error off the harness's stderr. This also removes a stale comment as per suggestion from hsyl20. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> - - - - - eb3bf6e7 by Alan Zimmerman at 2026-06-08T07:56:32-04:00 EPA: Rename Transform.anchorEof to addModuleCommentOrigDeltas This now matches what it actually does. - - - - - f578388e by Simon Jakobi at 2026-06-09T13:22:39+02:00 Add support for related locations in Diagnostic Diagnostics can now carry "related locations" -- additional source spans beyond the primary error span. See the new Note [The source span model for diagnostics] for the model and its correspondence to the LSP Diagnostic / relatedInformation interfaces. This prepares the ground for #22637; the diagnosticRelatedLocations name is inspired by #23414. Implementation: * Related spans are carried through the MCDiagnostic message class, the single source of truth; decorateDiagnostic reads them from there. * getCaretDiagnostics takes the show-caret flag and returns the real spans that got no caret (sorted and deduped), splitting each span into 'Either SDoc RealSrcSpan' via partitionEithers; decorateDiagnostic lists those under the "At:" heading. Spans are deduped by real span, ignoring the BufSpan, so a duplicate export's related span (which often differs from the primary only in its BufSpan) is not listed twice. The single-span getCaretDiagnostic lost its only caller and is removed along with its exports and .hs-boot declaration. JSON output: * Emit related spans as a new "relatedSpans" field and bump the JSON schema version 1.2 -> 1.3 (additive, backwards compatible). Diagnostics converted: * TcRnBindingNameConflict, TcRnDuplicateDecls, TcRnDuplicateExport and TcRnDuplicateNamedDefaultExport carry related locations. The now-redundant location prose is removed from TcRnBindingNameConflict ("Bound at:") and TcRnDuplicateDecls ("Declared at:"), and TcRnDuplicateNamedDefaultExport is reworded (its two export items are always identical). check_occs threads LIE GhcPs so export items carry their source spans. TcRnConflictingExports and TcRnDuplicateFieldExport were tried but reverted: their export items and name provenance already appear in the message text, so carets only duplicated the primary span. Tests: * Enable -fdiagnostics-show-caret in several tests to show multi-caret output, and add MultiCaretFallback exercising a diagnostic whose related locations are split between carets and the "At:" fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> - - - - - b4d9842a by Simon Jakobi at 2026-06-09T16:04:39+02:00 WIP: Diagnostics: preserve author's order of related locations The caret/At: renderer used to sort and dedup the diagnostic's source spans by position, overriding whatever order the message author chose. Make order the author's responsibility instead: * decorateDiagnostic no longer nubs; sourceSpans is just primary :| related. * getCaretDiagnostics deduplicates while preserving the given order, rather than sorting first. This is now the only dedup. The construction-site leftmost_smallest sort is thus the sole authority on order. Note [The source span model for diagnostics] records that authors must order related spans deterministically themselves. To keep "Multiple declarations" output in source order under the new rule, addDupDeclErr now reports at the first declaration (NE.head) rather than the last, matching TcRnBindingNameConflict; the related spans become NE.tail. Expected outputs updated accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> - - - - - 130 changed files: - boot - + changelog.d/T27182.md - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/Core/Opt/Monad.hs - compiler/GHC/Core/Utils.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Errors.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session/Units.hs - compiler/GHC/HsToCore/Usage.hs - compiler/GHC/Linker/Unit.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Error.hs - compiler/GHC/Types/Error.hs-boot - compiler/GHC/Unit/Info.hs - compiler/GHC/Unit/State.hs - compiler/GHC/Utils/Error.hs - compiler/GHC/Utils/Logger.hs - compiler/GHC/Utils/Misc.hs - + docs/users_guide/diagnostics-as-json-schema-1_3.json - docs/users_guide/javascript.rst - docs/users_guide/using.rst - ghc/GHCi/UI.hs - ghc/GHCi/UI/Exception.hs - hadrian/src/Builder.hs - hadrian/src/Hadrian/Oracles/Path.hs - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Rules/BinaryDist.hs - libraries/base/src/Control/Applicative.hs - libraries/base/src/Control/Arrow.hs - libraries/base/src/Control/Monad.hs - libraries/base/src/Data/Array/Byte.hs - libraries/base/src/Data/Fixed.hs - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Conc.hs - libraries/base/src/GHC/Conc/Sync.hs - libraries/base/src/GHC/Exts.hs - libraries/base/src/GHC/Fingerprint.hs - libraries/base/src/GHC/IO/Handle.hs - libraries/base/src/GHC/RTS/Flags.hs - libraries/base/src/GHC/Unicode.hs - libraries/base/src/GHC/Weak.hs - libraries/base/src/GHC/Weak/Finalize.hs - libraries/base/src/Prelude.hs - libraries/base/src/System/IO.hs - libraries/base/src/System/Mem/Weak.hs - libraries/ghc-internal/src/GHC/Internal/Natural.hs - testsuite/driver/runtests.py - testsuite/mk/test.mk - testsuite/tests/default/T25857.stderr - testsuite/tests/default/all.T - testsuite/tests/driver/T16167.stdout - testsuite/tests/driver/json.stderr - testsuite/tests/driver/json2.stderr - testsuite/tests/driver/json_dump.stderr - testsuite/tests/driver/json_warn.stderr - testsuite/tests/ghci/scripts/T4127a.stderr - testsuite/tests/ghci/scripts/ghci048.stderr - testsuite/tests/haddock/haddock_examples/haddock.Test.stderr - testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr - testsuite/tests/indexed-types/should_fail/T16110_Fail1.stderr - testsuite/tests/mdo/should_fail/mdofail002.stderr - testsuite/tests/mdo/should_fail/mdofail003.stderr - testsuite/tests/module/mod128.stderr - testsuite/tests/module/mod18.stderr - testsuite/tests/module/mod19.stderr - testsuite/tests/module/mod20.stderr - testsuite/tests/module/mod21.stderr - testsuite/tests/module/mod22.stderr - testsuite/tests/module/mod23.stderr - testsuite/tests/module/mod24.stderr - testsuite/tests/module/mod38.stderr - testsuite/tests/module/mod66.stderr - testsuite/tests/overloadedrecflds/should_fail/DuplicateExports.stderr - testsuite/tests/overloadedrecflds/should_fail/FieldSelectors.stderr - testsuite/tests/overloadedrecflds/should_fail/NFSDuplicate.stderr - testsuite/tests/overloadedrecflds/should_fail/T17965.stderr - testsuite/tests/overloadedrecflds/should_fail/all.T - testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail03.stderr - testsuite/tests/patsyn/should_compile/T11959.stderr - testsuite/tests/patsyn/should_compile/T9975a.stderr - testsuite/tests/patsyn/should_fail/T14114.stderr - testsuite/tests/patsyn/should_fail/all.T - + testsuite/tests/profiling/should_compile/T27182.hs - testsuite/tests/profiling/should_compile/all.T - testsuite/tests/quasiquotation/qq006/qq006.stderr - testsuite/tests/rename/should_compile/ExportWarnings6.stderr - testsuite/tests/rename/should_compile/T23318.stderr - + testsuite/tests/rename/should_fail/MultiCaretFallback.hs - + testsuite/tests/rename/should_fail/MultiCaretFallback.stderr - testsuite/tests/rename/should_fail/T22478b.stderr - testsuite/tests/rename/should_fail/T7164.stderr - testsuite/tests/rename/should_fail/all.T - testsuite/tests/rename/should_fail/rn_dup.stderr - testsuite/tests/rename/should_fail/rnfail001.stderr - testsuite/tests/rename/should_fail/rnfail002.stderr - testsuite/tests/rename/should_fail/rnfail003.stderr - testsuite/tests/rename/should_fail/rnfail004.stderr - testsuite/tests/rename/should_fail/rnfail009.stderr - testsuite/tests/rename/should_fail/rnfail010.stderr - testsuite/tests/rename/should_fail/rnfail011.stderr - testsuite/tests/rename/should_fail/rnfail012.stderr - testsuite/tests/rename/should_fail/rnfail013.stderr - testsuite/tests/rename/should_fail/rnfail015.stderr - testsuite/tests/rename/should_fail/rnfail043.stderr - testsuite/tests/th/T8932.stderr - testsuite/tests/th/TH_dupdecl.stderr - testsuite/tests/th/TH_spliceD1.stderr - testsuite/tests/type-data/should_fail/TDMultiple01.stderr - testsuite/tests/type-data/should_fail/TDMultiple02.stderr - testsuite/tests/type-data/should_fail/TDPunning.stderr - testsuite/tests/typecheck/should_fail/T22560_fail_c.stderr - testsuite/tests/typecheck/should_fail/TyAppPat_NonlinearMultiAppPat.stderr - testsuite/tests/typecheck/should_fail/TyAppPat_NonlinearMultiPat.stderr - testsuite/tests/typecheck/should_fail/TyAppPat_NonlinearSinglePat.stderr - testsuite/tests/typecheck/should_fail/all.T - testsuite/tests/typecheck/should_fail/tcfail038.stderr - testsuite/tests/vdq-rta/should_fail/T22326_fail_nonlinear.stderr - testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_3.stderr - testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_4.stderr - utils/check-exact/Main.hs - utils/check-exact/Transform.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2f8d359fd00f968eeac09038910882e... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2f8d359fd00f968eeac09038910882e... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Jakobi (@sjakobi2)