- May 14, 2025
-
-
This reverts commit fee9b351. Unfortunately the chrome test jobs may still timeout on certain runners (e.g. OpenCape) for unknown reasons.
-
-
Bumps libffi submodule.
-
Deprecated as per CLC proposal 329 (https://github.com/haskell/core-libraries-committee/issues/329)
-
In !12264 we started using the NativeObj machinery introduced some time ago for loading of shared objects. One of the side-effects of this change is shared objects are now loaded eagerly (i.e. with `RTLD_NOW`). This is needed by NativeObj to ensure full visibility of the mappings of the loaded object, which is in turn needed for safe shared object unloading. Unfortunately, this change subtly regressed, causing compilation failures in some programs. Specifically, shared objects which refer to undefined symbols (e.g. which may be usually provided by either the executable image or libraries loaded via `dlopen`) will fail to load with eager binding. This is problematic as GHC loads all package dependencies while, e.g., evaluating TemplateHaskell splices. This results in compilation failures in programs depending upon (but not using at compile-time) packages with undefined symbol references. To mitigate this NativeObj now first attempts to load an object via eager binding, reverting to lazy binding (and disabling unloading) on failure. See Note [Don't fail due to RTLD_NOW]. Fixes #25943.
-
- May 11, 2025
-
-
This patch adds a zero length fast path for `fromJSString`; when marshaling a zero-length `JSString` we don't need to allocate an empty `ByteArray#` at all.
-
This patch marks `freeJSVal` as `INLINE` for the wasm backend. I noticed that the `freeJSVal` invocations are not inlined when inspecting STG/Cmm dumps of downstream libraries that use release build of the wasm backend. The performance benefit of inlining here is very modest, but so is the cost anyway; if you are using `freeJSVal` at all then you care about every potential chance to improve performance :)
-
This little MR fixes #26020. We are on the edge of completeness for newtype equalities (that doesn't change) but this MR makes GHC a bit more consistent -- and fixes the bug reported.
-
- May 09, 2025
-
-
Fix #26105, by upgrading the (horrible, hacky) `dropMisleading` function. This fix makes things a bit better but does not cure the underlying problem.
-
This patch fixes multiple bugs (#22581, #25983, #25984, #25991) in name resolution of subordinate import lists. Bug #22581 ---------- In subordinate import lists, the use of the `type` namespace specifier used to be ignored. For example, this import statement was incorrectly accepted: import Prelude (Bool(type True)) Now it results in an error message: <interactive>:2:17: error: [GHC-51433] In the import of ‘Prelude’: a data type called ‘Bool’ is exported, but its subordinate item ‘True’ is not in the type namespace. Bug #25983 ---------- In subordinate import lists within a `hiding` clause, non-existent items led to a poor warning message with -Wdodgy-imports. Consider: import Prelude hiding (Bool(X)) The warning message for this import statement used to misreport the cause of the problem: <interactive>:3:24: warning: [GHC-56449] [-Wdodgy-imports] In the import of ‘Prelude’: an item called ‘Bool’...
-
- May 08, 2025
-
-
Currently only firefox is enabled for wasm ghci browser tests, for some reason testing with chrome works on my machine but gets stuck on gitlab instance runners. This patch re-enables testing with chrome by passing `--no-sandbox`, since chrome sandboxing doesn't work in containers without `--cap-add=SYS_ADMIN`.
-
Intended for use with :{ :}, but doesn't look for those characters. Any consecutive lines with birdtracks will only have initial whitespace stripped up to the column of the first line.
-
LLVM now insists that built-in arrays use Appending linkage, not Internal. Fixes #25769.
-
Previously the predicate to identify LLVM builtin global variables was checking for `$llvm` rather than `@llvm` as it should.
-
- May 06, 2025
-
-
This patch addresses #26004. The root cause was that simplifyInfer was willing to unify variables "far out". The fix, in runTcSWithEvBinds', is to initialise the inert set given-eq level with the current level. See (TGE6) in Note [Tracking Given equalities] in GHC.Tc.Solver.InertSet Two loosely related refactors: * Refactored approximateWCX to return just the free type variables of the un-quantified constraints. That avoids duplication of work (these free vars are needed in simplifyInfer) and makes it clearer that the constraints themselves are irrelevant. * A little local refactor of TcSMode, which reduces the number of parameters to runTcSWithEvBinds
-
Counts the number of OccNames in an OccEnv
-
This makes the code clearer and allows the top-level import context to be fetched directly from the HomeModInfo through the API (e.g. useful for the debugger).
-
- May 05, 2025
- May 04, 2025
-
-
Serge S. Gulin authored
1. Add Windows AArch64 cross-compilation support via CI jobs Introduce new CI configurations for cross-compiling to Windows ARM64 using Debian12Wine, FEX, and MSYS2. Configure toolchain variables for LLVM MinGW and Wine emulation in CI pipelines. 2. Adjust compiler and RTS for AArch64 Windows compatibility Reserve register `x18` on Windows and Darwin platforms in AArch64 codegen. Handle Windows-specific relocations and data sections in AArch64 assembler. Update PEi386 linker to recognize ARM64 binaries and support exception handling. Adjust LLVM target definitions and data layouts for new architectures. Update `ghc-toolchain` and build scripts to handle `TablesNextToCode` on Windows ARM64. 3. Enhance CI scripts and stability Modify `ci.sh` to handle mingw cross-targets, fixing GHC executable paths and test execution. Use `diff -w` in tests to ignore whitespace differences, improving cross-platform consistency. 4. Refactor and clean up code Remove redundant imports in hello.hs test. Improve error messages and checks for unsupported configurations in the driver. Add `EXDEV` error code to `errno.js`. Add async/sync flags to IO logs at `base.js`. Improve POSIX compatibility for file close at `base.js`: decrease indeterminism for mixed cases of async and sync code. 5. Update dependencies: `Cabal`, `Win32`, `directory`, `process`, `haskeline`, and `unix`. submodule Co-authored-by:
Cheng Shao <terrorjack@type.dance> Co-authored-by:
Dmitrii Egorov <egorov.d.i@icloud.com> Co-authored-by:
Andrei Borzenkov <root@sandwitch.dev>
-
- Apr 30, 2025
-
-
Fixes #25968.
-
- Apr 29, 2025
-
-
-
This broke in the refactor in !13128, where the old code parsed escape codes and collapsed string gaps at the same time, but the new code collapsed gaps first, then resolved escape codes. The new code used a naive heuristic to skip escaped backslashes, but didn't account for "\^\".
-
- Apr 28, 2025
-
-
The key change, which fixed #25440, is to call `recordRewriter` in GHC.Tc.Solver.Rewrite.rewrite_exact_fam_app. This missing call meant that we were secretly rewriting a Wanted with a Wanted, but not really noticing; and that led to a very bad error message, as you can see in the ticket. But of course that led me into rabbit hole of other refactoring around the RewriteSet code: * Improve Notes [Wanteds rewrite Wanteds] * Zonk the RewriterSet in `zonkCtEvidence` rather than only in GHC.Tc.Errors. This is tidier anyway (e.g. de-clutters debug output), and helps with the next point. * In GHC.Tc.Solver.Equality.inertsCanDischarge, don't replace a constraint with no rewriters with an equal constraint that has many. See See (CE4) in Note [Combining equalities] * Move zonkRewriterSet and friends from GHC.Tc.Zonk.Type into GHC.Tc.Zonk.TcType, where they properly belong. A handful of tests get better error messages. For some reason T24984 gets 12% less compiler allocation -- good Metric Decrease: T24984
-
- Apr 27, 2025
-
-
Simon Peyton Jones authored
On the way to #23109 (unary classes) I discovered some infelicities (or maybe tiny bugs, I forget) in the type-class specialiser. I also tripped over #25965, an outright bug in the rule matcher Specifically: * Refactor: I enhanced `wantCallsFor`, whih previously always said `True`, to discard calls of class-ops, data constructors etc. This is a bit more efficient; and it means we don't need to worry about filtering them out later. * Fix: I tidied up some tricky logic that eliminated redundant specialisations. It wasn't working correctly. See the expanded Note [Specialisations already covered], and (MP3) in Note [Specialising polymorphic dictionaries]. See also the new top-level `alreadyCovered` function, which now goes via `GHC.Core.Rules.ruleLhsIsMoreSpecific` I also added a useful Note [The (CI-KEY) invariant] * Fix #25965: fixed a tricky bug in the `go_fam_fam` in `GHC.Core.Unify.uVarOrFam`, which allows matching to succeed without binding all type varibles. I enhanced Note [Apartness and type families] some more * #25703. This ticket "just works" with -fpolymorphic-specialisation; but I was surprised that it worked! In this MR I added documentation to Note [Interesting dictionary arguments] to explain; and tests to ensure it stays fixed.
-
In particular when we have a pattern binding K p1 .. pn = rhs where K is a pattern synonym. (It might be nested.) This small MR fixes #25995. It's a tiny fix, to an error message, removing an always-dubious `unkSkol`. The bug report was in the context of horde-ad, a big program, and I didn't manage to make a small repro case quickly. I decided not to bother further.
-
- Apr 25, 2025
-
-
Matthew Pickering authored
This commit introduces the `ExplicitLevelImports` and `ImplicitStagePersistence` language extensions as proposed in GHC Proposal #682. Key Features ------------ - `ExplicitLevelImports` adds two new import modifiers - `splice` and `quote` - allowing precise control over the level at which imported identifiers are available - `ImplicitStagePersistence` (enabled by default) preserves existing path-based cross-stage persistence behavior - `NoImplicitStagePersistence` disables implicit cross-stage persistence, requiring explicit level imports Benefits -------- - Improved compilation performance by reducing unnecessary code generation - Enhanced IDE experience with faster feedback in `-fno-code` mode - Better dependency tracking by distinguishing compile-time and runtime dependencies - Foundation for future cross-compilation improvements This implementation enables the separation of modules needed at compile-time from those needed at runtime, allowing for more efficient compilation pipelines and clearer code organization in projects using Template Haskell. Implementation Notes -------------------- The level which a name is availble at is stored in the 'GRE', in the normal GlobalRdrEnv. The function `greLevels` returns the levels which a specific GRE is imported at. The level information for a 'Name' is computed by `getCurrentAndBindLevel`. The level validity is checked by `checkCrossLevelLifting`. Instances are checked by `checkWellLevelledDFun`, which computes the level an instance by calling `checkWellLevelledInstanceWhat`, which sees what is available at by looking at the module graph. Modifications to downsweep -------------------------- Code generation is now only enabled for modules which are needed at compile time. See the Note [-fno-code mode] for more information. Uniform error messages for level errors --------------------------------------- All error messages to do with levels are now reported uniformly using the `TcRnBadlyStaged` constructor. Error messages are uniformly reported in terms of levels. 0 - top-level 1 - quote level -1 - splice level The only level hard-coded into the compiler is the top-level in GHC.Types.ThLevelIndex.topLevelIndex. Uniformly refer to levels and stages ------------------------------------ There was much confusion about levels vs stages in the compiler. A level is a semantic concept, used by the typechecker to ensure a program can be evaluated in a well-staged manner. A stage is an operational construct, program evaluation proceeds in stages. Deprecate -Wbadly-staged-types ------------------------------ `-Wbadly-staged-types` is deprecated in favour of `-Wbadly-levelled-types`. Lift derivation changed ----------------------- Derived lift instances will now not generate code with expression quotations. Before: ``` data A = A Int deriving Lift => lift (A x) = [| A $(lift x) |] ``` After: ``` lift (A x) = conE 'A `appE` (lift x) ``` This is because if you attempt to derive `Lift` in a module where `NoImplicitStagePersistence` is enabled, you would get an infinite loop where a constructor was attempted to be persisted using the instance you are currently defining. GHC API Changes --------------- The ModuleGraph now contains additional information about the type of the edges (normal, quote or splice) between modules. This is abstracted using the `ModuleGraphEdge` data type. Fixes #25828 ------------------------- Metric Increase: MultiLayerModulesTH_Make -------------------------
-
- Apr 24, 2025
-
-
In 36cddd2c @alt-romes removed CallStack output from `GHC.Utils.Panic.Plain.assertPanic'`. While this output is redundant due to the exception backtrace proposal, we may be bootstrapping with a compiler which does not yet include this machinery. Reintroduce the output for now. Fixes #25898.
-
-
The `EvalBreakpoint` is used to communicate that a breakpoint was encountered during code evaluation. This `EvalBreakpoint` needs to be converted to an `InternalBreakpointId` which stores a `Module` to uniquely find the correct `Module` in the Home Package Table. The `EvalBreakpoint` used to store only a `ModuleName` which is then converted to a `Module` based on the currently active home unit. This is incorrect in the face of multiple home units, the break point could be in an entirely other home unit! To fix this, we additionally store the `UnitId` of the `Module` in `EvalBreakpoint` to later reconstruct the correct `Module` All of the changes are the consequence of extending `EvalBreakpoint` with the additional `ShortByteString` of the `UnitId`. For performance reasons, we store the `ShortByteString` backing the `UnitId` directly, avoiding marshalling overhead.
-
J_TBL result in local jumps, there should not deallocate stack slots (see Note [extra spill slots].) J is for non-local jumps, these may need to deallocate stack slots.
-
-
loadSrcInterface takes a user given `ModuleName` and resolves it to the module which needs to be loaded (taking into account module renaming/visibility etc). loadInterfaceForModule takes a specific module and loads it. The modules in `ImpDeclSpec` have already been resolved to the actual module to get the information from during renaming. Therefore we just need to fetch the precise interface from disk (and not attempt to rename it again). Fixes #25951
-
- Apr 22, 2025
-
-
These notes were suggested in !14241
-
This note was left behind when all the code which referred to it was moved into the GHC.Driver.Downsweep module
-
Andreas Klebinger authored
When applying tagToEnum# to a out-of-range value it's best to simply constant fold it to a bottom expression. That potentially allows more dead code elimination and makes debugging easier. Fixes #25976
-
- Apr 20, 2025
-
-
Fixes #25975.
-