summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Bump ghc-tarballs to fix #22497Ben Gamari2023-01-181-0/+0
| | | | | | | | | | | It turns out that gmp 6.2.1 uses the platform-reserved `x18` register on AArch64/Darwin. This was fixed in upstream changeset 18164:5f32dbc41afc, which was merged in 2020. Here I backport this patch although I do hope that a new release is forthcoming soon. Bumps gmp-tarballs submodule. Fixes #22497.
* Add missing parenthesizeHsType in cvtSigTypeKindRyan Scott2023-01-184-2/+16
| | | | | | | | We need to ensure that the output of `cvtSigTypeKind` is parenthesized (at precedence `sigPrec`) so that any type signatures with an outermost, explicit kind signature can parse correctly. Fixes #22784.
* Enable -Wstar-is-type by default (#22759)Vladislav Zavialov2023-01-1816-53/+38
| | | | | | | | | | | | | Following the plan in GHC Proposal #143 "Remove the * kind syntax", which states: In the next release (or 3 years in), enable -fwarn-star-is-type by default. The "next release" happens to be 9.6.1 I also moved the T21583 test case from should_fail to should_compile, because the only reason it was failing was -Werror=compat in our test suite configuration.
* Use -Wdefault when running Python testdriver (#22727)Krzysztof Gogolewski2023-01-184-7/+9
|
* testsuite: req_smp --> req_target_smp, req_ghc_smpSylvain Henry2023-01-1816-44/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See #22630 and !9552 This commit: - splits req_smp into req_target_smp and req_ghc_smp - changes the testsuite driver to calculate req_ghc_smp - changes a handful of tests to use req_target_smp instead of req_smp - changes a handful of tests to use req_host_smp when needed The problem: - the problem this solves is the ambiguity surrounding req_smp - on master req_smp was used to express the constraint that the program being compiled supports smp _and_ that the host RTS (i.e., the RTS used to compile the program) supported smp. Normally that is fine, but in cross compilation this is not always the case as was discovered in #22630. The solution: - Differentiate the two constraints: - use req_target_smp to say the RTS the compiled program is linked with (and the platform) supports smp - use req_host_smp to say the RTS the host is linked with supports smp WIP: fix req_smp (target vs ghc) add flag to separate bootstrapper split req_smp -> req_target_smp and req_ghc_smp update tests smp flags cleanup and add some docstrings only set ghc_with_smp to bootstrapper on S1 or CC Only set ghc_with_smp to bootstrapperWithSMP of when testing stage 1 and cross compiling test the RTS in config/ghc not hadrian re-add ghc_with_smp fix and align req names fix T11760 to use req_host_smp test the rts directly, avoid python 3.5 limitation test the compiler in a try block align out of tree and in tree withSMP flags mark failing tests as host req smp testsuite: req_host_smp --> req_ghc_smp Fix ghc vs host, fix ghc_with_smp leftover
* Hadrian: fix warnings (#22783)Vladislav Zavialov2023-01-173-5/+3
| | | | | | | | | This change fixes the following warnings when building Hadrian: src/Hadrian/Expression.hs:38:10: warning: [-Wredundant-constraints] src/Hadrian/Expression.hs:84:13: warning: [-Wtype-equality-requires-operators] src/Hadrian/Expression.hs:84:21: warning: [-Wtype-equality-requires-operators] src/Hadrian/Haskell/Cabal/Parse.hs:67:1: warning: [-Wunused-imports]
* Document the semantics of pattern bindings a bit betterSimon Peyton Jones2023-01-177-96/+295
| | | | This MR is in response to the discussion on #22719
* Avoid unnecessary printf warnings in EventLog.cViktor Dukhovni2023-01-171-4/+2
| | | | Fixes #22778
* compiler: Small optimisation of assertMBen Gamari2023-01-171-1/+7
| | | | | | | | | In #22739 @AndreasK noticed that assertM performed the action to compute the asserted predicate regardless of whether DEBUG is enabled. This is inconsistent with the other assertion operations and general convention. Fix this. Closes #22739.
* EPA: Add annotation for 'type' in DataDeclAlan Zimmerman2023-01-166-11/+84
| | | | Closes #22765
* Bump submodule parsec to 3.1.16.1Bodigrim2023-01-161-0/+0
|
* Add scripts to generate ghcup metadata on nightly and release pipelinesMatthew Pickering2023-01-1610-25/+614
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. A python script in .gitlab/rel_eng/mk-ghcup-metadata which generates suitable metadata for consumption by GHCUp for the relevant pipelines. - The script generates the metadata just as the ghcup maintainers want, without taking into account platform/library combinations. It is updated manually when the mapping changes. - The script downloads the bindists which ghcup wants to distribute, calculates the hash and generates the yaml in the correct structure. - The script is documented in the .gitlab/rel_eng/mk-ghcup-metadata/README.mk file 1a. The script requires us to understand the mapping from platform -> job. To choose the preferred bindist for each platform the .gitlab/gen_ci.hs script is modified to allow outputting a metadata file which answers the question about which job produces the bindist which we want to distribute to users for a specific platform. 2. Pipelines to run on nightly and release jobs to generate metadata - ghcup-metadata-nightly: Generates metadata which points directly to artifacts in the nightly job. - ghcup-metadata-release: Generates metadata suitable for inclusion directly in ghcup by pointing to the downloads folder where the bindist will be uploaded to. 2a. Trigger jobs which test the generated metadata in the downstream `ghccup-ci` repo. See that repo for documentation about what is tested and how but essentially we test in a variety of clean images that ghcup can download and install the bindists we say exist in our metadata.
* ci: Don't use complicated image or clone in not-interruptible jobMatthew Pickering2023-01-161-1/+3
| | | | | | This job exists only for the meta-reason of not allowing nightly pipelines to be cancelled. It was taking two minutes to run as in order to run "true" we would also clone the whole GHC repo.
* rel_eng: Add release engineering scripts into ghc treeMatthew Pickering2023-01-1611-1/+765
| | | | | | | | | | It is better to keep these scripts in the tree as they depend on the CI configuration and so on. By keeping them in tree we can keep them up-to-date as the CI config changes and also makes it easier to backport changes to the release script between release branches in future. The final motivation is that it makes generating GHCUp metadata possible.
* ci: Change owner of files in test-bootstrap jobMatthew Pickering2023-01-161-0/+1
|
* ci: Don't build aarch64-deb10-llvm job on release pipelinesMatthew Pickering2023-01-162-61/+1
| | | | Closes #22721
* ci: Change owner of files in source-tarball jobMatthew Pickering2023-01-161-0/+1
| | | | | | | | | | | | | | This fixes errors of the form: ``` fatal: detected dubious ownership in repository at '/builds/ghc/ghc' To add an exception for this directory, call: git config --global --add safe.directory /builds/ghc/ghc inferred 9.7.20230113 checking for GHC Git commit id... fatal: detected dubious ownership in repository at '/builds/ghc/ghc' To add an exception for this directory, call: git config --global --add safe.directory /builds/ghc/ghc ```
* ci: Bump CACHE_REV so that ghc-9.6 branch and HEAD have different cachesMatthew Pickering2023-01-161-1/+1
| | | | | | | | Having the same CACHE_REV on both branches leads to issues where the darwin toolchain is different on ghc-9.6 and HEAD which leads to long darwin build times. In general we should ensure that each branch has a different CACHE_REV.
* Mark maximumBy/minimumBy as INLINE.Andreas Klebinger2023-01-162-2/+34
| | | | | | | | | The RHS was too large to inline which often prevented the overhead of the Maybe from being optimized away. By marking it as INLINE we can eliminate the overhead of both the maybe and are able to unpack the accumulator when possible. Fixes #22609
* Add regression test for #22611.Andreas Klebinger2023-01-163-0/+310
| | | | A case were a function used to fail to specialize, but now does.
* Hadrian: generalise &%> to avoid warningssheaf2023-01-167-21/+91
| | | | | | | | | | This patch introduces a more general version of &%> that works with general traversable shapes, instead of lists. This allows us to pass along the information that the length of the list of filepaths passed to the function exactly matches the length of the input list of filepath patterns, avoiding pattern match warnings. Fixes #22430
* Separate core inlining logic from `Unfolding` type.Andreas Klebinger2023-01-169-572/+604
| | | | | This seems like a good idea either way, but is mostly motivated by a patch where this avoids a module loop.
* Add a missing checkEscapingKindSimon Peyton Jones2023-01-137-49/+74
| | | | | | | | Ticket #22743 pointed out that there is a missing check, for type-inferred bindings, that the inferred type doesn't have an escaping kind. The fix is easy.
* wasm ci: Remove wasm release jobsMatthew Pickering2023-01-132-191/+3
| | | | | This removes the wasm release jobs, as we do not yet intend to distribute these binaries.
* ci: add wasm ci jobs via gen_ci.hsCheng Shao2023-01-133-605/+418
| | | | | | | - There is one regular wasm job run in validate pipelines - Additionally, int-native/unreg wasm jobs run in nightly/release pipelines Also, remove the legacy handwritten wasm ci jobs in .gitlab-ci.yml.
* ci: source the toolchain env file in wasm jobsCheng Shao2023-01-131-0/+4
|
* ci: improve nix-shell for gen_ci.hs and fix some ghc/hlint warningsCheng Shao2023-01-135-34/+53
| | | | | | | | | | | - Add a ghc environment including prebuilt dependencies to the nix-shell. Get rid of the ad hoc cabal cache and all dependencies are now downloaded from the nixos binary cache. - Make gen_ci.hs a cabal package with HLS integration, to make future hacking of gen_ci.hs easier. - Fix some ghc/hlint warnings after I got HLS to work. - For the lint-ci-config job, do a shallow clone to save a few minutes of unnecessary git checkout time.
* ci: use in-image emsdk for js jobsCheng Shao2023-01-131-15/+2
|
* ci: enable xz parallel compression for x64 jobsCheng Shao2023-01-131-0/+7
|
* ci: Bump DOCKER_REVCheng Shao2023-01-131-1/+1
|
* Bump process submoduleCheng Shao2023-01-131-0/+0
|
* Bump hsc2hs submoduleCheng Shao2023-01-131-0/+0
|
* gitlab-ci: Pass -w to cabal updateBen Gamari2023-01-131-1/+3
| | | | Due to cabal#8447, cabal-install 3.8.1.0 requires a compiler to run `cabal update`.
* gitlab-ci: Bump Darwin bootstrap toolchainBen Gamari2023-01-132-8/+8
| | | | | This updates the bootstrap compiler on Darwin from 8.10.7 to 9.2.5, ensuring that we have the fix for #21964.
* Bump submodule bytestring to 0.11.4.0Bodigrim2023-01-133-11/+13
| | | | | | Metric Decrease: T21839c T21839r
* Don't run hadrian-multi on fast-ci labelMatthew Pickering2023-01-121-0/+2
| | | | Fixes #22667
* Fix #22728: Not all diagnostics in safe check are fatalOleg Grenrus2023-01-129-13/+52
| | | | Also add tests for the issue and -Winferred-safe-imports in general
* Make `GHC.Tc.Errors.Reporter` take `NonEmpty ErrorItem` rather than ↵M Farkas-Dyck2023-01-121-62/+54
| | | | | | `[ErrorItem]`, which lets us drop some panics. Also use the `BasicMismatch` constructor rather than `mkBasicMismatchMsg`, which lets us drop the "-Wno-incomplete-record-updates" flag.
* Change MSYSTEM to CLANG64 uniformlyCheng Shao2023-01-125-20/+14
|
* Only gc sparks locally when we can ensure marking is done.Andreas Klebinger2023-01-123-14/+46
| | | | | | | | When performing GC without work stealing there was no guarantee that spark pruning was happening after marking of the sparks. This could cause us to GC live sparks under certain circumstances. Fixes #22528.
* Fix contification with stable unfoldings (#22428)Sebastian Graf2023-01-127-244/+472
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many functions now return a `TailUsageDetails` that adorns a `UsageDetails` with a `JoinArity` that reflects the number of join point binders around the body for which the `UsageDetails` was computed. `TailUsageDetails` is now returned by `occAnalLamTail` as well as `occAnalUnfolding` and `occAnalRules`. I adjusted `Note [Join points and unfoldings/rules]` and `Note [Adjusting right-hand sides]` to account for the new machinery. I also wrote a new `Note [Join arity prediction based on joinRhsArity]` and refer to it when we combine `TailUsageDetails` for a recursive RHS. I also renamed * `occAnalLam` to `occAnalLamTail` * `adjustRhsUsage` to `adjustTailUsage` * a few other less important functions and properly documented the that each call of `occAnalLamTail` must pair up with `adjustTailUsage`. I removed `Note [Unfoldings and join points]` because it was redundant with `Note [Occurrences in stable unfoldings]`. While in town, I refactored `mkLoopBreakerNodes` so that it returns a condensed `NodeDetails` called `SimpleNodeDetails`. Fixes #22428. The refactoring seems to have quite beneficial effect on ghc/alloc performance: ``` CoOpt_Read(normal) ghc/alloc 784,778,420 768,091,176 -2.1% GOOD T12150(optasm) ghc/alloc 77,762,270 75,986,720 -2.3% GOOD T12425(optasm) ghc/alloc 85,740,186 84,641,712 -1.3% GOOD T13056(optasm) ghc/alloc 306,104,656 299,811,632 -2.1% GOOD T13253(normal) ghc/alloc 350,233,952 346,004,008 -1.2% T14683(normal) ghc/alloc 2,800,514,792 2,754,651,360 -1.6% T15304(normal) ghc/alloc 1,230,883,318 1,215,978,336 -1.2% T15630(normal) ghc/alloc 153,379,590 151,796,488 -1.0% T16577(normal) ghc/alloc 7,356,797,056 7,244,194,416 -1.5% T17516(normal) ghc/alloc 1,718,941,448 1,692,157,288 -1.6% T19695(normal) ghc/alloc 1,485,794,632 1,458,022,112 -1.9% T21839c(normal) ghc/alloc 437,562,314 431,295,896 -1.4% GOOD T21839r(normal) ghc/alloc 446,927,580 440,615,776 -1.4% GOOD geo. mean -0.6% minimum -2.4% maximum -0.0% ``` Metric Decrease: CoOpt_Read T10421 T12150 T12425 T13056 T18698a T18698b T21839c T21839r T9961
* configure: Fix escaping of `$tooldir`Ben Gamari2023-01-121-4/+4
| | | | | | | | | In !9547 I introduced `$tooldir` directories into GHC's default link and compilation flags to ensure that our C toolchain finds its own headers and libraries before others on the system. However, the patch was subtly wrong in the escaping of `$tooldir`. Fix this. Fixes #22561.
* rts: Drop racy assertionBen Gamari2023-01-121-0/+3
| | | | | | | 0e274c39bf836d5bb846f5fa08649c75f85326ac added an assertion in `dirty_MUT_VAR` checking that the MUT_VAR being dirtied was clean. However, this isn't necessarily the case since another thread may have raced us to dirty the object.
* Revert "rts: Drop racy assertion"Ben Gamari2023-01-121-3/+0
| | | | | | | The logic here was inverted. Reverting the commit to avoid confusion when examining the commit history. This reverts commit b3eacd64fb36724ed6c5d2d24a81211a161abef1.
* Fix finaliseArgBoxities for OPAQUE functionSimon Peyton Jones2023-01-113-22/+53
| | | | | | | We never do worker wrapper for OPAQUE functions, so we must zap the unboxing info during strictness analysis. This patch fixes #22502
* Add 'docWithStyle' to improve codegenKrzysztof Gogolewski2023-01-115-68/+78
| | | | | | | | | | | | | | This new combinator docWithStyle :: IsOutput doc => doc -> (PprStyle -> SDoc) -> doc let us remove the need for code to be polymorphic in HDoc when not used in code style. Metric Decrease: ManyConstructors T13035 T1969
* Fix void-arg-adding mechanism for worker/wrapperSimon Peyton Jones2023-01-118-135/+209
| | | | | | | | | | | | | As #22725 shows, in worker/wrapper we must add the void argument /last/, not first. See GHC.Core.Opt.WorkWrap.Utils Note [Worker/wrapper needs to add void arg last]. That led me to to study GHC.Core.Opt.SpecConstr Note [SpecConstr needs to add void args first] which suggests the opposite! And indeed I think it's the other way round for SpecConstr -- or more precisely the void arg must precede the "extra_bndrs". That led me to some refactoring of GHC.Core.Opt.SpecConstr.calcSpecInfo.
* Parse qualified terms in type signaturesHaskellMouse2023-01-1116-10/+142
| | | | | | | | This commit allows qualified terms in type signatures to pass the parser and to be cathced by renamer with more informative error message. Adds a few tests. Fixes #21605
* Refactor the treatment of loopy superclass dictswip/T20666Richard Eisenberg2023-01-1154-794/+1293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch completely re-engineers how we deal with loopy superclass dictionaries in instance declarations. It fixes #20666 and #19690 The highlights are * Recognise that the loopy-superclass business should use precisely the Paterson conditions. This is much much nicer. See Note [Recursive superclasses] in GHC.Tc.TyCl.Instance * With that in mind, define "Paterson-smaller" in Note [Paterson conditions] in GHC.Tc.Validity, and the new data type `PatersonSize` in GHC.Tc.Utils.TcType, along with functions to compute and compare PatsonSizes * Use the new PatersonSize stuff when solving superclass constraints See Note [Solving superclass constraints] in GHC.Tc.TyCl.Instance * In GHC.Tc.Solver.Monad.lookupInInerts, add a missing call to prohibitedSuperClassSolve. This was the original cause of #20666. * Treat (TypeError "stuff") as having PatersonSize zero. See Note [Paterson size for type family applications] in GHC.Tc.Utils.TcType. * Treat the head of a Wanted quantified constraint in the same way as the superclass of an instance decl; this is what fixes #19690. See GHC.Tc.Solver.Canonical Note [Solving a Wanted forall-constraint] (Thanks to Matthew Craven for this insight.) This entailed refactoring the GivenSc constructor of CtOrigin a bit, to say whether it comes from an instance decl or quantified constraint. * Some refactoring way in which redundant constraints are reported; we don't want to complain about the extra, apparently-redundant constraints that we must add to an instance decl because of the loopy-superclass thing. I moved some work from GHC.Tc.Errors to GHC.Tc.Solver. * Add a new section to the user manual to describe the loopy superclass issue and what rules it follows.
* Misc cleanupKrzysztof Gogolewski2023-01-1112-37/+24
| | | | | | | | - Remove unused mkWildEvBinder - Use typeTypeOrConstraint - more symmetric and asserts that that the type is Type or Constraint - Fix escape sequences in Python; they raise a deprecation warning with -Wdefault