summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Base/JS: GHC.JS.Foreign.Callback module (issue 23126)wip/js-exportsJosh Meredith2023-04-1128-4/+638
| | | | | | | | | | | | | * Add the Callback module for "exporting" Haskell functions to be available to plain JavaScript code * Fix some primitives defined in GHC.JS.Prim * Add a JavaScript section to the user guide with instructions on how to use the JavaScript FFI, building up to using Callbacks to interact with the browser * Add tests for the JavaScript FFI and Callbacks
* Renamer: don't call addUsedGRE on an exact Namesheaf2023-04-076-16/+41
| | | | | | | | | | When looking up a record field in GHC.Rename.Env.lookupRecFieldOcc, we could end up calling addUsedGRE on an exact Name, which would then lead to a panic in the bestImport function: it would be incapable of processing a GRE which is not local but also not brought into scope by any imports (as it is referred to by its unique instead). Fixes #23240
* Add structured error messages for GHC.Tc.TyCl.UtilsTorsten Schmits2023-04-077-18/+42
| | | | | | | | | Tracking ticket: #20117 MR: !10251 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Adjust wording wrt representation polymorphism of ($)Sebastian Graf2023-04-071-1/+1
|
* Remove trailing whitespace from ($) commentaryAlex Dixon2023-04-071-3/+3
|
* Improve documentation for ($) (#22963)Alex Dixon2023-04-071-12/+63
|
* Add release note for GHC.Unicode refactor in base-4.18.Pierre Le Marre2023-04-061-3/+4
| | | | | Also merge CLC proposal 130 in base-4.19 with CLC proposal 59 in base-4.18 and add proper release date.
* Fix reverse flag for -Wunsupported-llvm-versionBrandon Chinn2023-04-061-1/+1
|
* nonmoving: Disable slop-zeroingBen Gamari2023-04-061-4/+8
| | | | | | | | | As noted in #23170, the nonmoving GC can race with a mutator zeroing the slop of an updated thunk (in much the same way that two mutators would race). Consequently, we must disable slop-zeroing when the nonmoving GC is in use. Closes #23170
* Add testcase for #23192sheaf2023-04-042-0/+17
| | | | | | | | | | This issue around solving of constraints arising from superclass expansion using other constraints also borned from superclass expansion was the topic of commit aed1974e. That commit made sure we don't emit a "redundant constraint" warning in a situation in which removing the constraint would cause errors. Fixes #23192
* Fix unification with oversaturated type familiesKrzysztof Gogolewski2023-04-044-30/+154
| | | | | | unify_ty was incorrectly saying that F x y ~ T x are surely apart, where F x y is an oversaturated type family and T x is a tyconapp. As a result, the simplifier dropped a live case alternative (#23134).
* Make INLINE pragmas for pattern synonyms work with THRyan Scott2023-04-044-1/+63
| | | | | | | | | | Previously, the code for converting `INLINE <name>` pragmas from TH splices used `vNameN`, which assumed that `<name>` must live in the variable namespace. Pattern synonyms, on the other hand, live in the constructor namespace. I've fixed the issue by switching to `vcNameN` instead, which works for both the variable and constructor namespaces. Fixes #23203.
* GHCi.RemoteTypes: fix doc and avoid unsafeCoerce (#23201)Sylvain Henry2023-04-042-26/+45
|
* Relax assertion in varToRecFieldOccsheaf2023-04-045-4/+54
| | | | | | | | | | | | When using Template Haskell, it is possible to re-parent a field OccName belonging to one data constructor to another data constructor. The lsp-types package did this in order to "extend" a data constructor with additional fields. This ran into an assertion in 'varToRecFieldOcc'. This assertion can simply be relaxed, as the resulting splices are perfectly sound. Fixes #23220
* StgToCmm: Upgrade -fcheck-prim-bounds behaviorMatthew Craven2023-04-0415-111/+573
| | | | | Fixes #21054. Additionally, we can now check for range overlap when generating Cmm for primops that use memcpy internally.
* Add a few more memcpy-ish primopsMatthew Craven2023-04-046-40/+155
| | | | | | | | | | | | | | | | * copyMutableByteArrayNonOverlapping# * copyAddrToAddr# * copyAddrToAddrNonOverlapping# * setAddrRange# The implementations of copyBytes, moveBytes, and fillBytes in base:Foreign.Marshal.Utils now use these new primops, which can cause us to work a bit harder generating code for them, resulting in the metric increase in T21839c observed by CI on some architectures. But in exchange, we get better code! Metric Increase: T21839c
* Fixes around unsafeCoerce#Krzysztof Gogolewski2023-04-035-69/+59
| | | | | | | | | | | | 1. `unsafeCoerce#` was documented in `GHC.Prim`. But since the overhaul in 74ad75e87317, `unsafeCoerce#` is no longer defined there. I've combined the documentation in `GHC.Prim` with the `Unsafe.Coerce` module. 2. The documentation of `unsafeCoerce#` stated that you should not cast a function to an algebraic type, even if you later cast it back before applying it. But ghci was doing that type of cast, as can be seen with 'ghci -ddump-ds' and typing 'x = not'. I've changed it to use Any following the documentation.
* Convert diagnostics in GHC.Rename.HsType to proper TcRnMessageHaskell-mouse2023-04-0331-132/+395
| | | | | | | | | | | | | | | | | | I've turned all occurrences of TcRnUnknownMessage in GHC.Rename.HsType module into a proper TcRnMessage. Instead, these TcRnMessage messages were introduced: TcRnDataKindsError TcRnUnusedQuantifiedTypeVar TcRnIllegalKindSignature TcRnUnexpectedPatSigType TcRnSectionPrecedenceError TcRnPrecedenceParsingError TcRnIllegalKind TcRnNegativeNumTypeLiteral TcRnUnexpectedKindVar TcRnBindMultipleVariables TcRnBindVarAlreadyInScope
* JS: fix issues with FD api supportSylvain Henry2023-04-032-2/+11
| | | | | | | | - Add missing implementations for fcntl_read/write/lock - Fix fdGetMode These were found while implementing TH in !9779. These functions must be used somehow by the external interpreter code.
* hadrian: Improve option parsingKrzysztof Gogolewski2023-04-031-76/+56
| | | | | | | | Several options in Hadrian had their argument marked as optional (`OptArg`), but if the argument wasn't there they were just giving an error. It's more idiomatic to mark the argument as required instead; the code uses less Maybes, the parser can enforce that the argument is present, --help gives better output.
* ci: Add job to test 9.6 bootstrappingMatthew Pickering2023-04-031-1/+3
|
* hadrian: Update bootstrap plans for 9.2.6, 9.2.7, 9.4.4, 9.4.5, 9.6.1Matthew Pickering2023-04-0326-140/+1257
| | | | | | | | Also fixes the ./generate_bootstrap_plans script which was recently broken We can hopefully drop the 9.2 plans soon but they still work so kept them around for now.
* ghc-heap: remove wrong Addr# coercion (#23181)Sylvain Henry2023-04-033-4/+5
| | | | Conversion from Addr# to I# isn't correct with the JS backend.
* cmm: implement parsing of MO_AtomicRMW from hand-written CMM filesBodigrim2023-04-025-0/+153
| | | | Fixes #23206
* Rework documentation for data CharBodigrim2023-04-021-11/+90
|
* TH: revert changes to GadtC & RecGadtCsheaf2023-04-0115-66/+79
| | | | | | | Commit 3f374399 included a breaking-change to the template-haskell library when it made the GadtC and RecGadtC constructors take non-empty lists of names. As this has the potential to break many users' packages, we decided to revert these changes for now.
* Improve haddocks of template-haskell Con datatypesheaf2023-04-011-11/+27
| | | | | This adds a bit more information, in particular about the lists of constructors in the GadtC and RecGadtC cases.
* JS: Linker: use saturated JExprdoyougnu2023-04-012-100/+5
| | | | Follow on to MR!10142 in pursuit of #22736
* Add structured error messages for GHC.Tc.TyClTorsten Schmits2023-04-0197-440/+1028
| | | | | | | | | Tracking ticket: #20117 MR: !10183 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* driver: Unit State Data.Map -> GHC.Unique.UniqMapdoyougnu2023-04-0113-159/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In pursuit of #22426. The driver and unit state are major contributors. This commit also bumps the haddock submodule to reflect the API changes in UniqMap. ------------------------- Metric Decrease: MultiComponentModules MultiComponentModulesRecomp T10421 T10547 T12150 T12234 T12425 T13035 T16875 T18140 T18304 T18698a T18698b T18923 T20049 T5837 T6048 T9198 -------------------------
* User Guide: update copyright year: 2020->2023Artem Pelenitsyn2023-04-011-1/+1
|
* [feat] make ($) representation polymorphicmangoiv2023-04-0115-27/+47
| | | | | | | | | | | | | | - this change was approved by the CLC in [1] following a CLC proposal [2] - make ($) representation polymorphic (adjust the type signature) - change ($) implementation to allow additional polymorphism - adjust the haddock of ($) to reflect these changes - add additional documentation to document these changes - add changelog entry - adjust tests (move now succeeding tests and adjust stdout of some tests) [1] https://github.com/haskell/core-libraries-committee/issues/132#issuecomment-1487456854 [2] https://github.com/haskell/core-libraries-committee/issues/132
* Add test for T23184Matthew Pickering2023-03-313-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an outright bug, which Simon fixed in July 2021, as a little side-fix on a complicated patch: ``` commit 6656f0165a30fc2a22208532ba384fc8e2f11b46 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Fri Jul 23 23:57:01 2021 +0100 A bunch of changes related to eta reduction This is a large collection of changes all relating to eta reduction, originally triggered by #18993, but there followed a long saga. Specifics: ...lots of lines omitted... Other incidental changes * Fix a fairly long-standing outright bug in the ApplyToVal case of GHC.Core.Opt.Simplify.mkDupableContWithDmds. I was failing to take the tail of 'dmds' in the recursive call, which meant the demands were All Wrong. I have no idea why this has not caused problems before now. ``` Note this "Fix a fairly longstanding outright bug". This is the specific fix ``` @@ -3552,8 +3556,8 @@ mkDupableContWithDmds env dmds -- let a = ...arg... -- in [...hole...] a -- NB: sc_dup /= OkToDup; that is caught earlier by contIsDupable - do { let (dmd:_) = dmds -- Never fails - ; (floats1, cont') <- mkDupableContWithDmds env dmds cont + do { let (dmd:cont_dmds) = dmds -- Never fails + ; (floats1, cont') <- mkDupableContWithDmds env cont_dmds cont ; let env' = env `setInScopeFromF` floats1 ; (_, se', arg') <- simplArg env' dup se arg ; (let_floats2, arg'') <- makeTrivial env NotTopLevel dmd (fsLit "karg") arg' ``` Ticket #23184 is a report of the bug that this diff fixes.
* testsuite: asyncify the testsuite driverCheng Shao2023-03-303-133/+140
| | | | | | | | | | | | | | This patch refactors the testsuite driver, gets rid of multi-threading logic for running test cases concurrently, and uses asyncio & coroutines instead. This is not yak shaving for its own sake; the previous multi-threading logic is prone to livelock/deadlock conditions for some reason, even if the total number of threads is bounded to a thread pool's capacity. The asyncify change is an internal implementation detail of the testsuite driver and does not impact most GHC maintainers out there. The patch does not touch the .T files, test cases can be added/modified the exact same way as before.
* testsuite: use context variable instead of thread-local variableCheng Shao2023-03-302-7/+7
| | | | | | | | This patch changes a thread-local variable to context variable instead, which works as intended when the testsuite transitions to use asyncio & coroutines instead of multi-threading to concurrently run test cases. Note that this also raises the minimum Python version to 3.7.
* testsuite: mypy typing error fixesCheng Shao2023-03-305-50/+10
| | | | | This patch fixes some mypy typing errors which weren't caught in previous linting jobs.
* testsuite: handle target executable extensionCheng Shao2023-03-301-2/+7
|
* testsuite: strip the cross ghc prefix in output and error messageCheng Shao2023-03-301-0/+6
|
* testsuite: normalize the .wasm extensionCheng Shao2023-03-301-0/+5
|
* testsuite: don't add optllvm way for wasm32Cheng Shao2023-03-301-1/+1
|
* hadrian: Pass CROSS_EMULATOR to runtests.pyBen Gamari2023-03-301-0/+2
|
* testsuite/driver: Normalize away differences in ghc executable nameBen Gamari2023-03-301-0/+12
|
* testsuite/driver: Add basic support for testing cross-compilersBen Gamari2023-03-303-2/+29
|
* ci: use alpine3_17-wasm image for wasm jobsCheng Shao2023-03-303-80/+74
| | | | | Bump the ci-images dependency and use the new alpine3_17-wasm docker image for wasm jobs.
* ci: fix lint-testsuite jobCheng Shao2023-03-301-6/+1
| | | | | | | The list_broken make target will transitively depend on the calibrate.out target, which used STAGE1_GHC instead of TEST_HC. It really should be TEST_HC since that's what get passed in the gitlab CI config.
* ci: unset CROSS_EMULATOR for js jobCheng Shao2023-03-301-0/+2
|
* ci: ensure that all non-i386 pipelines do parallel xz compressionCheng Shao2023-03-301-1/+1
| | | | | | We can safely enable parallel xz compression for non-i386 pipelines. However, previously we didn't export XZ_OPT, so the xz process won't see it if XZ_OPT hasn't already been set in the current job.
* ci: make lint-ci-config job fast againCheng Shao2023-03-303-4/+4
| | | | | | | | We don't pin our nixpkgs revision and tracks the default nixpkgs-unstable channel anyway. Instead of using haskell.packages.ghc924, we should be using haskell.packages.ghc92 to maximize the binary cache hit rate and make lint-ci-config job fast again. Also bumps the nix docker image to the latest revision.
* Add LANGUAGE GADTs to GHC.Rename.Env sheaf2023-03-301-1/+1
| | | | | We need to enable this extension for the file to compile with ghc 9.2, as we are pattern matching on a GADT and this required the GADT extension to be enabled until 9.4.
* docs: move RecordUpd changelog entry to 9.8sheaf2023-03-302-5/+5
| | | | This was accidentally included in the 9.6 changelog instead of the 9.6 changelog.