summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* hadrian: Remove linters-common from bindistMatthew Pickering2022-04-012-3/+22
| | | | | | | | | | | | | | Zubin observed that the bindists contains the utility library linters-common. There are two options: 1. Make sure only the right files are added into the bindist.. a bit tricky due to the non-trivial structure of the lib directory. 2. Remove the bad files once they get copied in.. a bit easier So I went for option 2 but we perhaps should go for option 1 in the future. Fixes #21203
* Change may not to might notMaxHearnden2022-04-011-1/+1
|
* Add tests and docs on plugin args and order.Phil de Joux2022-04-0117-1/+208
|
* two typosEric Lindblad2022-04-012-2/+2
|
* hadrian typosEric Lindblad2022-04-014-4/+4
|
* Minor cleanupKrzysztof Gogolewski2022-04-0125-108/+28
| | | | | | | | | | | - Remove unused functions exprToCoercion_maybe, applyTypeToArg, typeMonoPrimRep_maybe, runtimeRepMonoPrimRep_maybe. - Replace orValid with a simpler check - Use splitAtList in applyTysX - Remove calls to extra_clean in the testsuite; it does not do anything. Metric Decrease: T18223
* Add test cases for #20640ARATA Mizuki2022-04-015-0/+22
| | | | Closes #20640
* Export MutableByteArray from Data.Array.ByteAndreas Klebinger2022-04-011-2/+22
| | | | This implements CLC proposal #49
* Unify RuntimeRep arguments in ty_co_matchsheaf2022-04-013-13/+45
| | | | | | | | | | | | | | | | | The `ty_co_match` function ignored the implicit RuntimeRep coercions that occur in a `FunCo`. Even though a comment explained that this should be fine, #21205 showed that it could result in discarding a RuntimeRep coercion, and thus discarding an important cast entirely. With this patch, we first match the kinds in `ty_co_match`. Fixes #21205 ------------------------- Metric Increase: T12227 T18223 -------------------------
* Clarify that runghc interprets the input programMorrow2022-04-011-2/+2
|
* new datatypes for parsedResultActionJakob Bruenker2022-04-018-56/+69
| | | | | | | | Previously, the warnings and errors were given and returned as a tuple (Messages PsWarnings, Messages PsErrors). Now, it's just PsMessages. This, together with the HsParsedModule the parser plugin gets and returns, has been wrapped up as ParsedResult.
* T13366 requires c++ & c++abi libraries on OpenBSDGreg Steuck2022-04-011-1/+1
| | | | | | | | | | | | | | Fixes this failure: =====> 1 of 1 [0, 0, 0] T13366(normal) 1 of 1 [0, 0, 0] Compile failed (exit code 1) errors were: <no location info>: error: user specified .o/.so/.DLL could not be loaded (File not found) Whilst trying to load: (dynamic) stdc++ Additional directories searched: (none) *** unexpected failure for T13366(normal)
* fp_prog_ar.m4: take AR var into considerationAdrian Ratiu2022-04-011-1/+2
| | | | | | | | | | In ChromeOS and Gentoo we want the ability to use LLVM ar instead of GNU ar even though both are installed, thus we pass (for eg) AR=llvm-ar to configure. Unfortunately GNU ar always gets picked regardless of the AR setting because the check does not consider the AR var when setting fp_prog_ar, hence this fix.
* ci: Attempt to fix windows cache issuesMatthew Pickering2022-04-012-19/+18
| | | | | It appears that running the script directly does nothing (no info is printed about saving the cache).
* ci: Regenerate jobs.yamlMatthew Pickering2022-04-012-6/+8
| | | | | It seems I forgot to update this to reflect the current state of gen_ci.hs
* users-guide: Fix a few small issues in eventlog format descriptionsBen Gamari2022-04-011-1/+2
| | | | | The CONC_MARK_END event description didn't mention its payload. Clarify the meaning of the CREATE_TASK's payload.
* Fix remaining issues in eventlog types (gen_event_types.py)Matthew Pickering2022-04-011-3/+4
| | | | | | | | | * The size of End concurrent mark phase looks wrong and, it used to be 4 and now it's 0. * The size of Task create is wrong, used to be 18 and now 14. * The event ticky-ticky entry counter begin sample has the wrong name * The event ticky-ticky entry counter being sample has the wrong size, was 0 now 32. Closes #21070
* Refactor handling of global initializersBen Gamari2022-04-0117-89/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | GHC uses global initializers for a number of things including cost-center registration, info-table provenance registration, and setup of foreign exports. Previously, the global initializer arrays which referenced these initializers would live in the object file of the C stub, which would then be merged into the main object file of the module. Unfortunately, this approach is no longer tenable with the move to Clang/LLVM on Windows (see #21019). Specifically, lld's PE backend does not support object merging (that is, the -r flag). Instead we are now rather packaging a module's object files into a static library. However, this is problematic in the case of initializers as there are no references to the C stub object in the archive, meaning that the linker may drop the object from the final link. This patch refactors our handling of global initializers to instead place initializer arrays within the object file of the module to which they belong. We do this by introducing a Cmm data declaration containing the initializer array in the module's Cmm stream. While the initializer functions themselves remain in separate C stub objects, the reference from the module's object ensures that they are not dropped from the final link. In service of #21068.
* Remove wrong claim about naturality law.gershomb2022-04-011-4/+1
| | | | | | | | | | This docs change removes a longstanding confusion in the Traversable docs. The docs say "(The naturality law is implied by parametricity and thus so is the purity law [1, p15].)". However if one reads the reference a different "natural" law is implied by parametricity. The naturality law given as a law here is imposed. Further, the reference gives examples which violate both laws -- so they cannot be implied by parametricity. This PR just removes the wrong claim.
* Fix mention of non-existent "rehydrateIface" function [skip ci]wip/t21303Matthew Pickering2022-03-301-1/+1
| | | | Fixes #21303
* Refactor: make primtypes independent of PrimRepsKrzysztof Gogolewski2022-03-305-126/+106
| | | | | | | | | | | | | | | | | Previously, 'pcPrimTyCon', the function used to define a primitive type, was taking a PrimRep, only to convert it to a RuntimeRep. Now it takes a RuntimeRep directly. Moved primRepToRuntimeRep to GHC.Types.RepType. It is now located next to its inverse function runtimeRepPrimRep. Now GHC.Builtin.Types.Prim no longer mentions PrimRep, and GHC.Types.RepType no longer imports GHC.Builtin.Types.Prim. Removed unused functions `primRepsToRuntimeRep` and `mkTupleRep`. Removed Note [PrimRep and kindPrimRep] - it was never referenced, didn't belong to Types.Prim, and Note [Getting from RuntimeRep to PrimRep] is more comprehensive.
* Fix reference to Note [FunBind vs PatBind]Ben Gamari2022-03-301-2/+2
| | | | | This Note was renamed in 2535a6716202253df74d8190b028f85cc6d21b72 yet this occurrence was not updated.
* Give parsing plugins access to errorsJakob Brünker2022-03-3018-22/+226
| | | | | | | | | | | Previously, when the parser produced non-fatal errors (i.e. it produced errors but the 'PState' is 'POk'), compilation would be aborted before the 'parsedResultAction' of any plugin was invoked. This commit changes that, so that such that 'parsedResultAction' gets collections of warnings and errors as argument, and must return them after potentially modifying them. Closes #20803
* Add test for T21306Matthew Pickering2022-03-293-0/+55
| | | | Fixes #21306
* RTS: Zero gc_cpu_start and gc_cpu_end after accountingMatthew Pickering2022-03-291-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | When passed a combination of `-N` and `-qn` options the cpu time for garbage collection was being vastly overcounted because the counters were not being zeroed appropiately. When -qn1 is passed, only 1 of the N avaiable GC threads is chosen to perform work, the rest are idle. At the end of the GC period, stat_endGC traverses all the GC threads and adds up the elapsed time from each of them. For threads which didn't participate in this GC, the value of the cpu time should be zero, but before this patch, the counters were not zeroed and hence we would count the same elapsed time on many subsequent iterations (until the thread participated in a GC again). The most direct way to zero these fields is to do so immediately after the value is added into the global counter, after which point they are never used again. We also tried another approach where we would zero the counter in yieldCapability but there are some (undiagnosed) siations where a capbility would not pass through yieldCapability before the GC ended and the same double counting problem would occur. Fixes #21082
* Hadrian: make DDEBUG separate from debugged RTSsheaf2022-03-298-36/+46
| | | | | | | | | | | This patchs separates whether -DDEBUG is enabled (i.e. whether debug assertions are enabled) from whether we are using the debugged RTS (i.e. GhcDebugged = YES). This means that we properly skip tests which have been marked with `when(compiler_debugged(), skip)`. Fixes #21113, #21153 and #21234
* hadrian: Build lib:GHC with -haddock and -Winvalid-haddock (#21273)Zubin Duggal2022-03-291-0/+3
|
* Fix all invalid haddock comments in the compilerZubin Duggal2022-03-2941-154/+154
| | | | Fixes #20935 and #20924
* Consistently attach SrcSpans to sub-expressions in TH splicesRyan Scott2022-03-281-139/+173
| | | | | | | | | | | Before, `GHC.ThToHs` was very inconsistent about where various sub-expressions would get the same `SrcSpan` from the original TH splice location or just a generic `noLoc` `SrcSpan`. I have ripped out all uses of `noLoc` in favor of the former instead, and I have added a `Note [Source locations within TH splices]` to officially enshrine this design choice. Fixes #21299.
* EPA: let stmt with semicolon has wrong anchorAlan Zimmerman2022-03-286-3/+25
| | | | | | | | | | | | | The code let ;x =1 Captures the semicolon annotation, but did not widen the anchor in the ValBinds. Fix that. Closes #20247
* hadrian: Add show target to bindist makefileMatthew Pickering2022-03-281-0/+4
| | | | | | | | | | | Some build systems use "make show" to query facts about the bindist, for example: ``` make show VALUE=ProjectVersion > version ``` to determine the ProjectVersion
* Hadrian: allow testsuite to run with cross-compilers (#21292)Sylvain Henry2022-03-281-1/+3
|
* users-guide: group ticky-ticky profiling under one headingAdam Sandberg Ericsson2022-03-281-5/+5
|
* Document typed splices inhibiting unused bind detection (#16524)jberryman2022-03-281-0/+3
|
* Add Red Herring to Note [What might equal later?]Richard Eisenberg2022-03-285-87/+149
| | | | Close #21208.
* Disable text's dependency on simdutf by defaultBen Gamari2022-03-282-0/+12
| | | | | | | Unfortunately we are simply not currently in a good position to robustly ship binary distributions which link against C++ code like simdutf. Fixes #20724.
* hadrian: Flag cabal flag handlingMatthew Pickering2022-03-281-10/+5
| | | | | | | | | | | | | | | This patch basically deletes some ad-hoc handling of Cabal Flags and replaces it with a correct query of the LocalBuildInfo. The flags in the local build info can be modified by users by passing hadrian options For example (!4331) ``` *.genapply.cabal.configure.opts += --flags=unregisterised ``` And all the flags specified by the `Cabal Flags` builder were already passed to configure properly using `--flags`.
* users-guide: Correct markdown for profilingTakenobu Tani2022-03-281-5/+6
| | | | | | This patch corrects some markdown. [skip ci]
* Modularize Tidy (#17957)Sylvain Henry2022-03-257-250/+328
| | | | | | | | - Factorize Tidy options into TidyOpts datatype. Initialize it in GHC.Driver.Config.Tidy - Same thing for StaticPtrOpts - Perform lookups of unpackCString[Utf8]# once in initStaticPtrOpts instead of for every use of mkStringExprWithFS
* Make -ddump-rn-ast and -ddump-tc-ast work in GHCiMatthew Pickering2022-03-254-1/+365
| | | | Fixes #17830
* Add instance Lift ByteArrayBodigrim2022-03-255-1/+72
|
* Add the OPAQUE pragmaChristiaan Baaij2022-03-2552-21/+1342
| | | | | | | | | | | | A new pragma, `OPAQUE`, that ensures that every call of a named function annotated with an `OPAQUE` pragma remains a call of that named function, not some name-mangled variant. Implements GHC proposal 0415: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0415-opaque-pragma.rst This commit also updates the haddock submodule to handle the newly introduced lexer tokens corresponding to the OPAQUE pragma.
* ci: Generate jobs for all normal builds and use hadrian for all buildsMatthew Pickering2022-03-245-878/+4601
| | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new script (.gitlab/gen_ci.hs) which generates a yaml file (.gitlab/jobs.yaml) which contains explicit descriptions for all the jobs we want to run. The jobs are separated into three categories: * validate - jobs run on every MR * nightly - jobs run once per day on the master branch * release - jobs for producing release artifacts The generation script is a Haskell program which includes a DSL for specifying the different jobs. The hope is that it's easier to reason about the different jobs and how the variables are merged together rather than the unclear and opaque yaml syntax. The goal is to fix issues like #21190 once and for all.. The `.gitlab/jobs.yaml` can be generated by running the `.gitlab/generate_jobs` script. You have to do this manually. Another consequence of this patch is that we use hadrian for all the validate, nightly and release builds on all platforms.
* testsuite: Remove library dependenices from T21119Matthew Pickering2022-03-243-13/+45
| | | | | | | These dependencies would affect the demand signature depending on various rules and so on. Fixes #21271
* hadrian: Correct generation of hsc2hs wrapperMatthew Pickering2022-03-241-1/+1
| | | | | | | | | | | | | | | | | If you inspect the inside of a wrapper script for hsc2hs you will see that the cflag and lflag values are concatenated incorrectly. ``` HSC2HS_EXTRA="--cflag=-U__i686--lflag=-fuse-ld=gold" ``` It should instead be ``` HSC2HS_EXTRA="--cflag=-U__i686 --lflag=-fuse-ld=gold" ``` Fixes #21221
* Add check to ensure we are not building validate jobs for releasesMatthew Pickering2022-03-241-0/+21
|
* Add test for T21035Matthew Pickering2022-03-247-0/+117
| | | | | | | | This test checks that you are allowed to explicitly supply object files for dependencies even if you haven't got the shared object for that library yet. Fixes #21035
* WorkWrap: Handle partial FUN apps in `isRecDataCon` (#21265)Sebastian Graf2022-03-244-93/+90
| | | | | | | | | | | | Partial FUN apps like `(->) Bool` aren't detected by `splitFunTy_maybe`. A silly oversight that is easily fixed by replacing `splitFunTy_maybe` with a guard in the `splitTyConApp_maybe` case. But fortunately, Simon nudged me into rewriting the whole `isRecDataCon` function in a way that makes it much shorter and hence clearer which DataCons are actually considered as recursive. Fixes #21265.
* Fix and simplify DeriveAnyClass's context inference using SubTypePredSpecRyan Scott2022-03-248-275/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As explained in `Note [Gathering and simplifying constraints for DeriveAnyClass]` in `GHC.Tc.Deriv.Infer`, `DeriveAnyClass` infers instance contexts by emitting implication constraints. Previously, these implication constraints were constructed by hand. This is a terribly trick thing to get right, as it involves a delicate interplay of skolemisation, metavariable instantiation, and `TcLevel` bumping. Despite much effort, we discovered in #20719 that the implementation was subtly incorrect, leading to valid programs being rejected. While we could scrutinize the code that manually constructs implication constraints and repair it, there is a better, less error-prone way to do things. After all, the heart of `DeriveAnyClass` is generating code which fills in each class method with defaults, e.g., `foo = $gdm_foo`. Typechecking this sort of code is tantamount to calling `tcSubTypeSigma`, as we much ensure that the type of `$gdm_foo` is a subtype of (i.e., more polymorphic than) the type of `foo`. As an added bonus, `tcSubTypeSigma` is a battle-tested function that handles skolemisation, metvariable instantiation, `TcLevel` bumping, and all other means of tricky bookkeeping correctly. With this insight, the solution to the problems uncovered in #20719 is simple: use `tcSubTypeSigma` to check if `$gdm_foo`'s type is a subtype of `foo`'s type. As a side effect, `tcSubTypeSigma` will emit exactly the implication constraint that we were attempting to construct by hand previously. Moreover, it does so correctly, fixing #20719 as a consequence. This patch implements the solution thusly: * The `PredSpec` data type (previously named `PredOrigin`) is now split into `SimplePredSpec`, which directly stores a `PredType`, and `SubTypePredSpec`, which stores the actual and expected types in a subtype check. `SubTypePredSpec` is only used for `DeriveAnyClass`; all other deriving strategies use `SimplePredSpec`. * Because `tcSubTypeSigma` manages the finer details of type variable instantiation and constraint solving under the hood, there is no longer any need to delicately split apart the method type signatures in `inferConstraintsAnyclass`. This greatly simplifies the implementation of `inferConstraintsAnyclass` and obviates the need to store skolems, metavariables, or given constraints in a `ThetaSpec` (previously named `ThetaOrigin`). As a bonus, this means that `ThetaSpec` now simply becomes a synonym for a list of `PredSpec`s, which is conceptually much simpler than it was before. * In `simplifyDeriv`, each `SubTypePredSpec` results in a call to `tcSubTypeSigma`. This is only performed for its side effect of emitting an implication constraint, which is fed to the rest of the constraint solving machinery in `simplifyDeriv`. I have updated `Note [Gathering and simplifying constraints for DeriveAnyClass]` to explain this in more detail. To make the changes in `simplifyDeriv` more manageable, I also performed some auxiliary refactoring: * Previously, every iteration of `simplifyDeriv` was skolemising the type variables at the start, simplifying, and then performing a reverse substitution at the end to un-skolemise the type variables. This is not necessary, however, since we can just as well skolemise once at the beginning of the `deriving` pipeline and zonk the `TcTyVar`s after `simplifyDeriv` is finished. This patch does just that, having been made possible by prior work in !7613. I have updated `Note [Overlap and deriving]` in `GHC.Tc.Deriv.Infer` to explain this, and I have also left comments on the relevant data structures (e.g., `DerivEnv` and `DerivSpec`) to explain when things might be `TcTyVar`s or `TyVar`s. * All of the aforementioned cleanup allowed me to remove an ad hoc deriving-related in `checkImplicationInvariants`, as all of the skolems in a `tcSubTypeSigma`–produced implication constraint should now be `TcTyVar` at the time the implication is created. * Since `simplifyDeriv` now needs a `SkolemInfo` and `UserTypeCtxt`, I have added `ds_skol_info` and `ds_user_ctxt` fields to `DerivSpec` to store these. Similarly, I have also added a `denv_skol_info` field to `DerivEnv`, which ultimately gets used to initialize the `ds_skol_info` in a `DerivSpec`. Fixes #20719.
* Define filterOut with filterSylvain Henry2022-03-231-3/+1
| | | | filter has fusion rules that filterOut lacks