summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* compiler: Rework handling of mutator abortingwip/T22038Ben Gamari2022-08-199-37/+72
| | | | | | | | | | | | | | | | | | | | | Previously `-dtag-inference-checks`, `-dcheck-prim-bounds`, and `-falignment-sanitization` all aborted by calling `barf` from the mutator. However, this can lead to deadlocks in the threaded RTS. For instance, in the case of `-dcheck-prim-bounds` the following can happen 1. the mutator takes a capability and begins execution 2. the bounds check fails, calling `barf` 3. `barf` calls `rtsFatalInternalErrorFn`, which in turn calls `endEventLogging` 4. `endEventLogging` calls `flushEventLog`, which it turn initiates a sync to request that all capabilities flush their local event logs 5. we deadlock as the the capability held by the crashing mutator can never join the sync To avoid this we now have a more principled means of aborting: we return to the scheduler setting the thread's return value to ThreadAborting. The scheduler will see this and call `barf`. Fixes #22038.
* Be more careful in chooseInferredQuantifiersSimon Peyton Jones2022-08-187-30/+146
| | | | | | | This fixes #22065. We were failing to retain a quantifier that was mentioned in the kind of another retained quantifier. Easy to fix.
* driver: Honour -x optionMatthew Pickering2022-08-185-40/+45
| | | | | | | | | | | | | The -x option is used to manually specify which phase a file should be started to be compiled from (even if it lacks the correct extension). I just failed to implement this when refactoring the driver. In particular Cabal calls GHC with `-E -cpp -x hs Foo.cpphs` to preprocess source files using GHC. I added a test to exercise this case. Fixes #22044
* ghc-heap: Fix decoding of TSO closuresMatthew Pickering2022-08-182-2/+7
| | | | | | | An extra field was added to the TSO structure in 6d1700b6 but the decoding logic in ghc-heap was not updated for this new field. Fixes #22046
* Implement Response File support for HPCPeter Becich2022-08-178-16/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an improvement to HPC authored by Richard Wallace (https://github.com/purefn) and myself. I have received permission from him to attempt to upstream it. This improvement was originally implemented as a patch to HPC via input-output-hk/haskell.nix: https://github.com/input-output-hk/haskell.nix/pull/1464 Paraphrasing Richard, HPC currently requires all inputs as command line arguments. With large projects this can result in an argument list too long error. I have only seen this error in Nix, but I assume it can occur is a plain Unix environment. This MR adds the standard response file syntax support to HPC. For example you can now pass a file to the command line which contains the arguments. ``` hpc @response_file_1 @response_file_2 ... The contents of a Response File must have this format: COMMAND ... example: report my_library.tix --include=ModuleA --include=ModuleB ``` Updates hpc submodule Co-authored-by: Richard Wallace <rwallace@thewallacepack.net> Fixes #22050
* users-guide: Rephrase the rewrite rule documentationBen Gamari2022-08-161-2/+2
| | | | | | Previously the wording was a tad unclear. Fix this. Closes #21114.
* relnotes: Add "included libraries" sectionBen Gamari2022-08-161-0/+47
| | | | As noted in #21988, some users rely on this.
* base: Add changelog entries from ghc-9.2Ben Gamari2022-08-161-6/+47
| | | | Closes #21922.
* Bump haddock submoduleBen Gamari2022-08-161-0/+0
| | | | | Includes merge of `main` into `ghc-head` as well as some Haddock users guide fixes.
* hadrian: Place manpage in docrootBen Gamari2022-08-161-1/+1
| | | | This relocates it from docs/ to doc/
* users-guide: Add :ghc-flag: referenceBen Gamari2022-08-161-1/+1
|
* users-guide: Fix incorrect reference to `:extension: roleBen Gamari2022-08-161-1/+1
|
* users-guide: Fix reference to dead llvm-version substitutionBen Gamari2022-08-161-2/+2
| | | | Fixes #22052.
* Fix #21979 - compact-share failing with -OAndreas Klebinger2022-08-161-2/+2
| | | | | I don't have good reason to believe the optimization level should affect if sharing works or not here. So limit the test to the normal way.
* CmmToAsm/AArch64: correct a typoCheng Shao2022-08-161-1/+1
|
* run_ci: remove monoidal-containersBryan Richter2022-08-161-11/+26
| | | | | | | | | Fixes #21492 MonoidalMap is inlined and used to implement Variables, as before. The top-level value "jobs" is reimplemented as a regular Map, since it doesn't use the monoidal union anyway.
* CmmToLlvm: Don't aliasify builtin LLVM variablesBen Gamari2022-08-161-4/+16
| | | | | | | | | Our aliasification logic would previously turn builtin LLVM variables into aliases, which apparently confuses LLVM. This manifested in initializers failing to be emitted, resulting in many profiling failures with the LLVM backend. Fixes #22019.
* typoEric Lindblad2022-08-161-2/+2
|
* Revert "gitlab-ci: Add release job for aarch64/debian 11"Matthew Pickering2022-08-112-178/+0
| | | | | | | | | This reverts commit 5765e13370634979eb6a0d9f67aa9afa797bee46. The job was not tested before being merged and fails CI (https://gitlab.haskell.org/ghc/ghc/-/jobs/1139392) Ticket #22005
* EPA: DotFieldOcc does not have exact print annotationsAlan Zimmerman2022-08-1136-77/+160
| | | | | | | | | | | | | | | | | For the code {-# LANGUAGE OverloadedRecordUpdate #-} operatorUpdate f = f{(+) = 1} There are no exact print annotations for the parens around the + symbol, nor does normal ppr print them. This MR fixes that. Closes #21805 Updates haddock submodule
* Document that threadDelay / timeout are susceptible to overflows on 32-bit ↵Bodigrim2022-08-108-1/+48
| | | | machines
* Note [Trimming auto-rules]: State that this improves compiler perf.Andreas Klebinger2022-08-101-0/+7
|
* ncg/aarch64: Don't use x18 register on AArch64/Darwinnormalcoder2022-08-101-0/+8
| | | | | | | | | Apple's ABI documentation [1] says: "The platforms reserve register x18. Don’t use this register." While this wasn't problematic in previous Darwin releases, macOS 13 appears to start zeroing this register periodically. See #21964. [1] https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
* hadrian: Don't attempt to install documentation if doc/ doesn't existBen Gamari2022-08-101-4/+6
| | | | | | | | | Previously we would attempt to install documentation even if the `doc` directory doesn't exist (e.g. due to `--docs=none`). This would result in the surprising side-effect of the entire contents of the bindist being installed in the destination documentation directory. Fix this. Fixes #21976.
* gitlab-ci: Run ARMv7 jobs when ~ARM label is usedBen Gamari2022-08-102-75/+78
|
* gitlab-ci: Fix ARMv7 buildBen Gamari2022-08-102-5/+21
| | | | | | | It appears that the CI refactoring carried out in 5ff690b8474c74e9c968ef31e568c1ad0fe719a1 failed to carry over some critical configuration: setting the build/host/target platforms and forcing use of a non-broken linker.
* Add support for external static plugins (#20964)Sylvain Henry2022-08-1018-11/+341
| | | | | | | | | | | | | | | | | | | | This patch adds a new command-line flag: -fplugin-library=<file-path>;<unit-id>;<module>;<args> used like this: -fplugin-library=path/to/plugin.so;package-123;Plugin.Module;["Argument","List"] It allows a plugin to be loaded directly from a shared library. With this approach, GHC doesn't compile anything for the plugin and doesn't load any .hi file for the plugin and its dependencies. As such GHC doesn't need to support two environments (one for plugins, one for target code), which was the more ambitious approach tracked in #14335. Fix #20964 Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
* hadrian RunRest: add type signature for stageNumberJens Petersen2022-08-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | avoids warning seen on 9.4.1: src/Settings/Builders/RunTest.hs:264:53: warning: [-Wtype-defaults] • Defaulting the following constraints to type ‘Integer’ (Show a0) arising from a use of ‘show’ at src/Settings/Builders/RunTest.hs:264:53-84 (Num a0) arising from a use of ‘stageNumber’ at src/Settings/Builders/RunTest.hs:264:59-83 • In the second argument of ‘(++)’, namely ‘show (stageNumber (C.stage ctx))’ In the second argument of ‘($)’, namely ‘"config.stage=" ++ show (stageNumber (C.stage ctx))’ In the expression: arg $ "config.stage=" ++ show (stageNumber (C.stage ctx)) | 264 | , arg "-e", arg $ "config.stage=" ++ show (stageNumber (C.stage ctx)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ compilation tested locally
* Updates language extension documentationTrevis Elser2022-08-1045-59/+107
| | | | | | | | | | | | | | | | Adding a 'Status' field with a few values: - Deprecated - Experimental - InternalUseOnly - Noting if included in 'GHC2021', 'Haskell2010' or 'Haskell98' Those values are pulled from the existing descriptions or elsewhere in the documentation. While at it, include the :implied by: where appropriate, to provide more detail. Fixes #21475
* base: Fix races in IOManager (setNumCapabilities,closeFdWith)Douglas Wilson2022-08-102-20/+75
| | | | | | | | | | | | | Fix for #21651 Fixes three bugs: - writes to eventManager should be atomic. It is accessed concurrently by ioManagerCapabilitiesChanged and closeFdWith. - The race in closeFdWith described in the ticket. - A race in getSystemEventManager where it accesses the 'IOArray' in 'eventManager' before 'ioManagerCapabilitiesChanged' has written to 'eventManager', causing an Array Index exception. The fix here is to 'yield' and retry.
* testsuite: 21651 add test for closeFdWith + setNumCapabilitiesDouglas Wilson2022-08-103-1/+135
| | | | | This bug does not affect windows, which does not use the base module GHC.Event.Thread.
* Fix size_up_alloc to account for UnliftedDatatypessheaf2022-08-091-4/+3
| | | | | | | | The size_up_alloc function mistakenly considered any type that isn't lifted to not allocate anything, which is wrong. What we want instead is to check the type isn't boxed. This accounts for (BoxedRep Unlifted). Fixes #21939
* gitlab-ci: Bump to use freebsd13 runnersBen Gamari2022-08-093-39/+40
|
* system-cxx-std-lib: Add support for FreeBSD libcxxrtBen Gamari2022-08-091-20/+55
|
* rts/linker: Resolve iconv_* on FreeBSDBen Gamari2022-08-091-9/+50
| | | | | | | | | | FreeBSD's libiconv includes an implementation of the iconv_* functions in libc. Unfortunately these can only be resolved using dlvsym, which is how the RTS linker usually resolves such functions. To fix this we include an ad-hoc special case for iconv_*. Fixes #20354.
* Cleanups around pretty-printingKrzysztof Gogolewski2022-08-0913-63/+27
| | | | | | | | | | * Remove hack when printing OccNames. No longer needed since e3dcc0d5 * Remove unused `pprCmms` and `instance Outputable Instr` * Simplify `pprCLabel` (no need to pass platform) * Remove evil `Show`/`Eq` instances for `SDoc`. They were needed by ImmLit, but that can take just a String instead. * Remove instance `Outputable CLabel` - proper output of labels needs a platform, and is done by the `OutputableP` instance
* hadrian: Fix access mode of installed package registration filesBen Gamari2022-08-091-0/+2
| | | | | | | | Previously hadrian's bindist Makefile would modify package registrations placed by `install` via a shell pipeline and `mv`. However, the use of `mv` means that if umask is set then the user may otherwise end up with package registrations which are inaccessible. Fix this by ensuring that the mode is 0644.
* hadrian: Fix bindist installation on DarwinBen Gamari2022-08-094-46/+41
| | | | | | | It turns out that `cp -P` on Darwin does not always copy a symlink as a symlink. In order to get these semantics one must pass `-RP`. It's not entirely clear whether this is valid under POSIX, but it is nevertheless what Apple does.
* gitlab-ci: Don't use coreutils on DarwinBen Gamari2022-08-091-1/+0
| | | | | | | | | In general we want to ensure that the tested environment is as similar as possible to the environment the user will use. In the case of Darwin, this means we want to use the system's BSD command-line utilities, not coreutils. This would have caught #21974.
* testsuite: Add test for #21962Ben Gamari2022-08-082-0/+12
|
* rts: Ensure that Array# card arrays are initializedBen Gamari2022-08-082-1/+7
| | | | | | | | | | | | In #19143 I noticed that newArray# failed to initialize the card table of newly-allocated arrays. However, embarrassingly, I then only fixed the issue in newArrayArray# and, in so doing, introduced the potential for an integer underflow on zero-length arrays (#21962). Here I fix the issue in newArray#, this time ensuring that we do not underflow in pathological cases. Fixes #19143.
* gitlab-ci: Add basic support for cross-compiler testiingBen Gamari2022-08-084-25/+65
| | | | Here we add a simple qemu-based test for cross-compilers.
* Bump process submoduleBen Gamari2022-08-081-0/+0
|
* gitlab-ci: Introduce validation job for aarch64 cross-compilationBen Gamari2022-08-082-1/+128
| | | | Begins to address #11958.
* gitlab-ci: Add release job for aarch64/debian 11Ben Gamari2022-08-082-0/+178
|
* Document a divergence from the report in parsing function lhss.Andreas Klebinger2022-08-081-0/+4
| | | | | | | | GHC is happy to parse `(f) x y = x + y` when it should be a parse error based on the Haskell report. Seems harmless enough so we won't fix it but it's documented now. Fixes #19788
* rts: remove redundant stg_traceCcszhCheng Shao2022-08-083-17/+0
| | | | | | This out-of-line primop has no Haskell wrapper and hasn't been used anywhere in the tree. Furthermore, the code gets in the way of !7632, so it should be garbage collected.
* dataToTag#: Skip runtime tag check if argument is infered taggedAndreas Klebinger2022-08-085-11/+499
| | | | This addresses one part of #21710.
* NCG(x86): Compile add+shift as lea if possible.wip/andreask/add_mul_leaAndreas Klebinger2022-08-084-0/+95
|
* hadrian: Extend xattr Darwin hack to cover /libBen Gamari2022-08-071-1/+7
| | | | | | | As noted in #21506, it is now necessary to remove extended attributes from `/lib` as well as `/bin` to avoid SIP issues on Darwin. Fixes #21506.