[Git][ghc/ghc][wip/9.14.2-backports] 27 commits: QuickLook's tcInstFun should make instantiation variables directly
Zubin pushed to branch wip/9.14.2-backports at Glasgow Haskell Compiler / GHC Commits: 42cf12ed by Simon Peyton Jones at 2026-06-10T18:17:15+05:30 QuickLook's tcInstFun should make instantiation variables directly tcInstFun must make "instantiation variables", not regular unification variables, when instantiating function types. That was previously implemented by a hack: set the /ambient/ level to QLInstTyVar. But the hack finally bit me, when I was refactoring WhatUnifications. And it was always wrong: see the now-expunged (TCAPP2) note. This commit does it right, by making tcInstFun call its own instantiation functions. That entails a small bit of duplication, but the result is much, much cleaner. (cherry picked from commit 231adc30be97ae51650aff7a40e00e05f4876af6) - - - - - ba2aa75d by Zubin Duggal at 2026-06-10T18:17:16+05:30 Revert "docs: note #26543 in known bugs" This reverts commit ebc6d49bd309bb843bc58e8c712ade767818e9ac. Obsolete now that the fix from MR 14474 (commit 231adc30) is backported. - - - - - 770190bc by Luite Stegeman at 2026-06-10T18:17:16+05:30 Fix assert in Interpreter.c If we skip exactly the number of words on the stack we end up on the first word in the next chunk. (cherry picked from commit 404b71c181bde4256565307d495cd2fa124d02f1) - - - - - e3d88c9e by Ben Gamari at 2026-06-10T18:17:16+05:30 rts/Interpreter: Factor out ctoi tuple info tables into data Instead of a massive case let's put this into data which we can reuse elsewhere. (cherry picked from commit d2b89603425b6d08df199deb7b84cfdbd711869a) - - - - - 660297cc by Luite Stegeman at 2026-06-10T18:17:16+05:30 Support arbitrary size unboxed tuples in bytecode This stores the size (number of words on the stack) of the next expected tuple in the TSO, ctoi_spill_size field, eliminating the need of stg_ctoi_tN frames for each size. Note: On 32 bit platform there is still a bytecode tuple size limit of 255 words on the stack. Fixes #26946 (cherry picked from commit a85bd503a480cfa31f5afa09eb38f56c85c237de) - - - - - 78704a03 by Luite Stegeman at 2026-06-10T18:17:16+05:30 Add specialized frames for small tuples Small tuples are now returned more efficiently to the interpreter. They use one less word of stack space and don't need manipulation of the TSO anymore. (cherry picked from commit e2209031734770a51f04883e5b538b562449cba1) - - - - - 61e0bc2c by Luite Stegeman at 2026-06-10T18:17:16+05:30 rts: add a few missing i386 relocations in the rts linker (cherry picked from commit 04d143c02e82e9ca03eb75849959d369d07fb81a) - - - - - 457e62c0 by Luite Stegeman at 2026-06-10T18:17:16+05:30 CodeOutput: Fix finalizers on multiple platforms - ELF platforms: emit .fini_array section - wasm32/Darwin: emit initializer with __cxa_atexit call - Windows: use -Wl,--whole-archive to prevent dropping finalizer symbols - rts linker: fix crash/assertion failure unloading objects with finalizers fixes #27072 (cherry picked from commit 014087e7a5753687161a24a1b2bc55c7bf7273fd) - - - - - bf0034ff by Ben Gamari at 2026-06-10T18:17:16+05:30 ghc-internal: Move STM utilities out of GHC.Internal.Conc.Sync This is necessary to avoid an import cycle on Windows when importing `GHC.Internal.Exception.Context` in `GHC.Internal.Conc.Sync`. On the road to address #25365. (cherry picked from commit 039bac4cf9590a6a09aa302b99fa2a0993cc0a32) - - - - - 67dc9308 by Ben Gamari at 2026-06-10T18:17:16+05:30 base: Capture backtrace from throwSTM Implements core-libraries-committee#297. Fixes #25365. (cherry picked from commit 8c389e8ce9a536da8e396a1df8c726583d0bcc14) - - - - - fd1e5cf5 by Ben Gamari at 2026-06-10T18:17:16+05:30 base: Annotate rethrown exceptions in catchSTM with WhileHandling Implements core-libraries-committee#298 (cherry picked from commit e1ce1fc3ad38d192cd3b6a38cb42051f4b115e95) - - - - - 0690216e by fendor at 2026-06-10T18:17:16+05:30 Hide implementation details from base exception stack traces Ensure we hide the implementation details of the exception throwing mechanisms: * `undefined` * `throwSTM` * `throw` * `throwIO` * `error` The `HasCallStackBacktrace` should always have a length of exactly 1, not showing internal implementation details in the stack trace, as these are vastly distracting to end users. CLC proposal [#387](https://github.com/haskell/core-libraries-committee/issues/387) (cherry picked from commit 016f79d54d482de01dd396bd9bf79f958d7c4922) - - - - - 1709090b by Zubin Duggal at 2026-06-10T18:17:16+05:30 fixup! Hide implementation details from base exception stack traces - - - - - 54eec91e by sheaf at 2026-06-10T18:17:16+05:30 Relax acceptance threshold for T10421 As seen in #27289, the 1% acceptance threshold for this text was overly narrow, resulting in spurious test failures. This commit widens the acceptance threshold to 2%. Fixes #27289. (cherry picked from commit b0233814d63c2802a521dfc7dae08b1ecf494c50) - - - - - d4405142 by mangoiv at 2026-06-10T18:17:16+05:30 libraries/process: bump submodule to v1.6.29.0 This submodule bump resolves a segfault on macos 15. Fixes #27144 (cherry picked from commit 277a3687c4b729e4d1ff4d4503a5673deba5eda7) - - - - - 1c9a400f by mangoiv at 2026-06-10T18:17:16+05:30 libraries/unix: in submodule, don't pick branch 2.7 The 2.7 branch is outdated and the module has been advanced far beyond it anyway, so remove that line. (cherry picked from commit 6779bb0c2d2784182465337ba5e94b7cd8810f2b) - - - - - a3ed39c3 by Luite Stegeman at 2026-06-10T18:17:16+05:30 Fixes for black holes - suspend duplicate work for eager black holes - detect eager black holes in checkBlockingQueues - don't overwrite existing black holes even if they're not in an eager blackhole frame - don't deadlock on self when thunk is already blackholed Fixes #26936 (cherry picked from commit 63ce5770da1712f0da54665d8755772bf38ba51e) - - - - - dfd09f11 by Tom McLaughlin at 2026-06-10T18:17:16+05:30 Event/Windows.hsc: rethrow exceptions in overlapped IO This prevents the WinIO manager from swallowing exceptions in overlapped IO. It was added to make WinIO support possible in the `network` library. See https://gitlab.haskell.org/ghc/ghc/-/issues/27283. We also bump __IO_MANAGER_WINIO__ to 2 so libraries can gate on this using CPP. (cherry picked from commit 037a80dc65d3975adf4a35d46876850e644bc80e) - - - - - b1e6d7e3 by Simon Peyton Jones at 2026-06-10T18:17:16+05:30 Trim the continuation in mkDupableContWithDmds When there are no remaining argument demands, it means the application is bottoming. In this case, we can trim the continuation to avoid the panic that was observed in #27261. See Note [Trimming the continuation for bottoming functions] in GHC.Core.Opt.Simplify.Iteration. (cherry picked from commit 4a645683ee0bd4421a88cd6ec49b40c6046b041d) - - - - - dcb55823 by Zubin Duggal at 2026-06-10T18:17:16+05:30 Update to semaphore-compat 2.0.0 using v2 of the protocol On Linux and other POSIX platforms, GHC's -jsem jobserver client now speaks v2 of the semaphore-compat protocol, which uses Unix domain sockets in place of POSIX named semaphores. This avoids the libc-ABI issues that affected the old implementation. Windows is unaffected and continues to use the v1 protocol (Win32 named semaphores); its reported protocol version remains v1. When GHC receives a -jsem name whose protocol version it does not support, it emits a -Wsemaphore-version-mismatch warning and falls back to -j<N> 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. Users on a cabal-install that predates the v2 update will continue to build successfully on Linux/POSIX, but will lose the cross-process -jsem coordination and fall back to -j<N> per GHC invocation. Users must upgrade to a cabal-install that supports protocol v2 to recover full parallelism. Also fix a leak in cleanupSem (#27253): cleanupSem used to snapshot heldTokens and release them before killing the loop, while the loop's in-flight acquire/release children could still be mutating it. Cleanup now runs inside the loop's own exit handler, after draining the active child via a new activeChild TVar, so the snapshot has no concurrent mutator. See also: - GHC proposal amendment: https://github.com/ghc-proposals/ghc-proposals/pull/673 - cabal-install patch: https://github.com/haskell/cabal/pull/11628 - semaphore-compat MR: https://gitlab.haskell.org/ghc/semaphore-compat/-/merge_requests/8 Bump semaphore-compat submodule to 2.0.0 Fixes #25087 and #27253 (cherry picked from commit 8db331a381ae47ad9ad5c8613f5d3e2588d5dd55) - - - - - de7bc8a5 by Zubin Duggal at 2026-06-10T18:17:16+05:30 Revert "Trim the continuation in mkDupableContWithDmds" This reverts commit ad9f21431c61ccc3ddebd831286f895c46aa4f1c. - - - - - b0ce0465 by mangoiv at 2026-06-10T18:17:16+05:30 Trim the continuation in mkDupableContWithDmds When there are no remaining argument demands, it means the application is bottoming. In this case, we can trim the continuation to avoid the panic that was observed in #27261. See Note [Trimming the continuation for bottoming functions] in GHC.Core.Opt.Simplify.Iteration. This patch was rewritten to avoid pulling in a refactor. The original patch is included in master as 4a645683 (cherry picked from commit 53f74985860b35a879bfd0dc642e7fcafffcf5e4) - - - - - ceb50b7c by Zubin Duggal at 2026-06-10T18:17:16+05:30 fixup! Trim the continuation in mkDupableContWithDmds - - - - - 59df0884 by mangoiv at 2026-06-10T18:17:16+05:30 profiling: partial backport of 2dadf3b0 to fix #27121 This backports fix and test for #27121 from 2dadf3b0 since the entirety of the patch is not backportable without also backporting two larger refactorings. (cherry picked from commit 0ccecfc5b5a118c2c850f876709c21162d35d972) - - - - - db6bbd26 by Teo Camarasu at 2026-06-10T18:17:16+05:30 Add explicit export list to GHC.Num Let's make clear what this module exports to allow us to easily deprecate and remove some of these in the future. Resolves https://gitlab.haskell.org/ghc/ghc/-/issues/26625 (cherry picked from commit b14bdd59202e0c32df8e5cc1923677f59c8f16e7) - - - - - 2f255e3c by Teo Camarasu at 2026-06-10T18:17:17+05:30 base: deprecate GHC internals in GHC.Num Implements CLC proposal: https://github.com/haskell/core-libraries-committee/issues/360 (cherry picked from commit 75a9053d26183e71b48de4c603b04af2fa4a732d) - - - - - f1170d52 by Simon Peyton Jones at 2026-06-10T18:17:17+05:30 Add a deprecation warning for static forms The accepted GHC proposal 732: Simplify static forms https://github.com/ghc-proposals/ghc-proposals/pull/732 needs a deprecation warning added to GHC 9.14, to warn about static forms that mention nested free variables; see #26718. This MR adds that warning, with test T26718 to check it. There is no flag to switch the warning off. (cherry picked from commit 6b7d6287c6ff4fd1b0d3aa2abfdaf73d43c4a9a0) - - - - - 143 changed files: - .gitmodules - + changelog.d/bump-process - + changelog.d/fix-blackhole-handling - + changelog.d/fix-finalizers-27072 - + changelog.d/jobserver-leak-fix - + changelog.d/semaphore-v2 - + changelog.d/windows-rethrow-overlapped-exception - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Utils.hs - compiler/GHC/Driver/CodeOutput.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/MakeAction.hs - compiler/GHC/Driver/MakeSem.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Static.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/SysTools/Cpp.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Utils/Instantiate.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/ForeignStubs.hs - compiler/GHC/Types/Hint.hs - compiler/GHC/Types/Hint/Ppr.hs - docs/users_guide/bugs.rst - docs/users_guide/using-warnings.rst - docs/users_guide/using.rst - hadrian/src/Flavour.hs - libraries/base/src/GHC/Conc.hs - libraries/base/src/GHC/Conc/Sync.hs - libraries/base/src/GHC/Num.hs - libraries/ghc-experimental/tests/backtraces/T26806b.stderr - libraries/ghc-internal/ghc-internal.cabal.in - libraries/ghc-internal/src/GHC/Internal/Conc/IO.hs - libraries/ghc-internal/src/GHC/Internal/Conc/POSIX.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs - libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs-boot - libraries/ghc-internal/src/GHC/Internal/Conc/Windows.hs - libraries/ghc-internal/src/GHC/Internal/Event/Thread.hs - libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc - libraries/ghc-internal/src/GHC/Internal/Event/Windows/Thread.hs - libraries/ghc-internal/src/GHC/Internal/Exception.hs - + libraries/ghc-internal/src/GHC/Internal/STM.hs - + libraries/ghc-internal/tests/backtraces/T15395.hs - + libraries/ghc-internal/tests/backtraces/T15395.stdout - libraries/ghc-internal/tests/backtraces/all.T - libraries/ghc-internal/tests/stack-annotation/ann_frame005.stdout - libraries/process - libraries/semaphore-compat - rts/Apply.cmm - rts/Continuation.c - rts/ContinuationOps.cmm - rts/Interpreter.c - rts/Linker.c - rts/LinkerInternals.h - rts/Messages.c - rts/Printer.c - rts/RaiseAsync.c - rts/RtsSymbols.c - rts/Schedule.c - rts/StgMiscClosures.cmm - rts/ThreadPaused.c - rts/Threads.c - rts/Threads.h - rts/Updates.h - rts/include/rts/Bytecodes.h - rts/include/rts/storage/ClosureMacros.h - rts/include/rts/storage/TSO.h - rts/include/stg/MiscClosures.h - rts/linker/Elf.c - testsuite/tests/arrows/should_compile/T21301.stderr - + testsuite/tests/bytecode/tuplestress/ByteCode.hs - + testsuite/tests/bytecode/tuplestress/Common.hs-incl - + testsuite/tests/bytecode/tuplestress/Obj.hs - + testsuite/tests/bytecode/tuplestress/TupleStress.hs - + testsuite/tests/bytecode/tuplestress/TupleStress.stdout - + testsuite/tests/bytecode/tuplestress/all.T - testsuite/tests/codeGen/should_run/CgStaticPointers.hs - testsuite/tests/codeGen/should_run/CgStaticPointersNoFullLazyness.hs - + testsuite/tests/codeGen/should_run/T27072d.hs - + testsuite/tests/codeGen/should_run/T27072d.stdout - + testsuite/tests/codeGen/should_run/T27072d_c.c - + testsuite/tests/codeGen/should_run/T27072d_check.c - + testsuite/tests/codeGen/should_run/T27072w.hs - + testsuite/tests/codeGen/should_run/T27072w.stdout - + testsuite/tests/codeGen/should_run/T27072w_c.c - testsuite/tests/codeGen/should_run/all.T - testsuite/tests/deSugar/should_fail/DsStrictFail.stderr - testsuite/tests/deSugar/should_run/T20024.stderr - testsuite/tests/deSugar/should_run/dsrun005.stderr - testsuite/tests/deSugar/should_run/dsrun007.stderr - testsuite/tests/deSugar/should_run/dsrun008.stderr - testsuite/tests/default/default-fail05.stderr - testsuite/tests/deriving/should_run/T9576.stderr - testsuite/tests/diagnostic-codes/codes.stdout - testsuite/tests/ghci/scripts/Defer02.stderr - testsuite/tests/ghci/scripts/T15325.stderr - testsuite/tests/indexed-types/should_fail/T1897b.stderr - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/patsyn/should_run/ghci.stderr - testsuite/tests/perf/compiler/all.T - + testsuite/tests/profiling/should_compile/T27121.hs - + testsuite/tests/profiling/should_compile/T27121_aux.hs - testsuite/tests/profiling/should_compile/all.T - testsuite/tests/quotes/LiftErrMsgDefer.stderr - testsuite/tests/rename/should_fail/RnStaticPointersFail01.stderr - testsuite/tests/rename/should_fail/RnStaticPointersFail03.stderr - testsuite/tests/rep-poly/RepPolyRightSection.stderr - + testsuite/tests/rts/linker/T27072/Lib.c - + testsuite/tests/rts/linker/T27072/Makefile - + testsuite/tests/rts/linker/T27072/T27072.stdout - + testsuite/tests/rts/linker/T27072/all.T - + testsuite/tests/rts/linker/T27072/main.c - testsuite/tests/safeHaskell/safeLanguage/SafeLang15.stderr - + testsuite/tests/simplCore/should_compile/T27261.hs - + testsuite/tests/simplCore/should_compile/T27261_aux.hs - testsuite/tests/simplCore/should_compile/all.T - testsuite/tests/th/all.T - testsuite/tests/type-data/should_run/T22332a.stderr - + testsuite/tests/typecheck/should_compile/T26718.hs - + testsuite/tests/typecheck/should_compile/T26718.stderr - testsuite/tests/typecheck/should_compile/all.T - testsuite/tests/typecheck/should_run/T10284.stderr - testsuite/tests/typecheck/should_run/T13838.stderr - testsuite/tests/typecheck/should_run/T9497a-run.stderr - testsuite/tests/typecheck/should_run/T9497b-run.stderr - testsuite/tests/typecheck/should_run/T9497c-run.stderr - testsuite/tests/unsatisfiable/T23816.stderr - testsuite/tests/unsatisfiable/UnsatDefer.stderr - utils/deriveConstants/Main.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2b08ab0bc0a2a915cfb0ddd1fc7ecc4... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2b08ab0bc0a2a915cfb0ddd1fc7ecc4... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Zubin (@wz1000)