summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* testsuite: Add more debug output on failure to call ghc-pkgMatthew Pickering2021-07-271-1/+1
|
* hadrian: Call ghc-pkg recache after copying package database into bindistMatthew Pickering2021-07-271-0/+5
| | | | | | | | | | | The package.cache needs to have a later mod-time than all of the .conf files. This invariant can be destroyed by `cp -r` and so we run `ghc-pkg recache` to ensure the package database which is distributed is consistent. If you are installing a relocatable bindist, for example, on windows, you should preserve mtimes by using cp -a or run ghc-pkg recache after installing.
* hadrian: Add exe suffix to executables in testsuiteMatthew Pickering2021-07-271-4/+4
|
* hadrian: Install windows bindist by copying in test_hadrianMatthew Pickering2021-07-271-3/+12
|
* packaging: Don't include configure scripts in windows bindistMatthew Pickering2021-07-271-11/+13
| | | | Fixes #19868
* packaging: Add note about wrappersMatthew Pickering2021-07-271-3/+27
|
* packaging: Create both versioned and unversioned executablesMatthew Pickering2021-07-273-6/+67
| | | | | | | | | Before we would just copy the unversioned executable into the bindist. Now the actual executable is copied into the bindist and a version suffix is added. Then a wrapper or symlink is added which points to the versioned executable. Fixes #20074
* hadrian: Remove special haddock copying ruleMatthew Pickering2021-07-271-12/+0
|
* hadrian: Update hsc2hs wrapper to match current masterMatthew Pickering2021-07-271-19/+5
|
* packaging: Give ghc-pkg the same version as ProjectVersionMatthew Pickering2021-07-274-1/+4
|
* packaging: Be more precise about which executables to copy and wrappers to ↵Matthew Pickering2021-07-271-14/+43
| | | | | | | | | | | | | | | | | | | create Exes ---- Before: The whole bin/ folder was copied which could contain random old/stale/testsuite executables After: Be precise Wrappers -------- Before: Wrappers were created for everything in the bin folder, including internal executables such as "unlit" After: Only create wrappers for the specific things which we want to include in the user's path. This makes the hadrian bindists match up more closely with the make bindists.
* validate: Add note for BINDIST variable, GitLab validation; clean up commentsAlina Banerjee2021-07-271-3/+15
|
* validate: check both stage1, stage2 test failures for deciding success of ↵Alina Banerjee2021-07-271-1/+15
| | | | entire test run
* validate: run stage1 tests using stage1 compiler when BINSTIST is falseAlina Banerjee2021-07-271-2/+13
|
* validate: change test ghc based on BINDIST value (YES/NO)Alina Banerjee2021-07-271-1/+7
|
* validate: update quick-validate flavour for validation with --fastAlina Banerjee2021-07-273-20/+28
|
* validate: add a debug flag (in both Hadrian and legacy Make) for running testsAlina Banerjee2021-07-271-1/+12
|
* validate: add flags using Hadrian's user settings for ignoring changes in ↵Alina Banerjee2021-07-271-29/+90
| | | | performance tests
* validate: fix #18477, improve syntax & add if-else checks for test ↵Alina Banerjee2021-07-271-123/+142
| | | | | | | outcomes/validation paths ShellCheck(https://github.com/koalaman/shellcheck/wiki) has been used to check the script.
* doc: fix copy/paste errorFraser Tweedale2021-07-271-2/+2
| | | | | | | | | The `divInt#` implementation note has heading: See Note [divInt# implementation] This seems to be a copy/paste mistake. Remove "See" from the heading.
* rts: Fix inconsistent signatures for collect_pointersBen Gamari2021-07-271-1/+1
| | | | Fixes #20160.
* rts/OSThreads: Improve error handling consistencyBen Gamari2021-07-273-23/+33
| | | | | | | | | | | | Previously we relied on the caller to check the return value from broadcastCondition and friends, most of whom neglected to do so. Given that these functions should not fail anyways, I've opted to drop the return value entirely and rather move the result check into the OSThreads functions. This slightly changes the semantics of timedWaitCondition which now returns false only in the case of timeout, rather than any error as previously done.
* rts/OSThreads: Ensure that we catch failures from pthread_mutex_lockBen Gamari2021-07-271-4/+5
| | | | Previously we would only catch EDEADLK errors.
* Use pthread if available on linuxAndreas Klebinger2021-07-271-4/+2
|
* Rename itimer to ticker in rts/posix for consistency.Andreas Klebinger2021-07-276-23/+26
|
* rts: Don't declare libCffi as bundled when using system libffiBen Gamari2021-07-273-5/+15
| | | | | Previously the rts's cabal file would claim that it bundled libffi, even if we are using the system's libffi. Fixes #19869.
* hadrian: Always specify flag values explicitlyBen Gamari2021-07-273-24/+33
| | | | | Previously we would often allow cabal flags to default, making it harder than necessary to reason about the effective build configuration.
* rts: Drop allocateExec and friendsBen Gamari2021-07-273-110/+0
| | | | All uses of these now use ExecPage.
* rts: Introduce and use ExecPage abstractionBen Gamari2021-07-2717-113/+179
| | | | | Here we introduce a very thin abstraction for allocating, filling, and freezing executable pages to replace allocateExec.
* rts/adjustor: Drop redundant commmentsBen Gamari2021-07-275-15/+0
|
* rts: Break up adjustor logicBen Gamari2021-07-2721-1329/+1583
|
* rts: Move libffi interfaces all to AdjustorBen Gamari2021-07-272-90/+51
| | | | | | | Previously the libffi Adjustor implementation would use allocateExec to create executable mappings. However, allocateExec is also used elsewhere in GHC to allocate things other than ffi_closure, which is a use-case which libffi does not support.
* rts: Document CPP guardsBen Gamari2021-07-271-10/+10
|
* rename: Avoid unnecessary map lookupBen Gamari2021-07-271-2/+2
| | | | | | | | Previously the -Wcompat-unqualified-imports warning would first check whether an import is of a covered module, incurring an map lookup, before checking the simple boolean predicate of whether it is qualified. This is more expensive than strictly necessary (although at the moment the warning is unused, so this will make little difference).
* Remove unused module GHC.Rename.DocFendor2021-07-271-23/+0
|
* RTS: try to fix timer racesSylvain Henry2021-07-262-2/+5
| | | | | | | | | | | | | | | | | | * Pthread based timer was initialized started while some other parts of the RTS assume it is initialized stopped, e.g. in hs_init_ghc: /* Start the "ticker" and profiling timer but don't start until the * scheduler is up. However, the ticker itself needs to be initialized * before the scheduler to ensure that the ticker mutex is initialized as * moreCapabilities will attempt to acquire it. */ * after a fork, don't start the timer before the IOManager is initialized: the timer handler (handle_tick) might call wakeUpRts to perform an idle GC, which calls wakeupIOManager/ioManagerWakeup Found while debugging #18033/#20132 but I couldn't confirm if it fixes them.
* hadrian: Don't add empty -I argumentswip/hadrian/libffi-includesBen Gamari2021-07-251-1/+1
| | | | | | Previously hadrian would add a -I$FfiIncludeDir flag to compiler invocations even if FfiIncludeDir was null, resulting in compilation errors.
* [rts] Untag bq->bh prior to reading the info tableMoritz Angermann2021-07-251-1/+12
| | | | | | | | | | | | | | | | | In `checkBlockingQueues` we must always untag the `bh` field of an `StgBlockingQueue`. While at first glance it might seem a sensible assumption that `bh` will always be a blackhole and therefore never be tagged, the GC could shortcut the indirection and put a tagged pointer into the indirection. This blew up on aarch64-darwin with a misaligned access. `bh` pointed to an address that always ended in 0xa. On architectures that are a little less strict about alignment, this would have read a garbage info table pointer, which very, very unlikely would have been equal to `stg_BLACKHOLE_info` and therefore things accidentally worked. However, on AArch64, the read of the info table pointer resulted in a SIGBUS due to misaligned read. Fixes #20093.
* [CI] absolutely no caching on darwinMoritz Angermann2021-07-252-20/+16
| | | | | | | We failed at doing caching properly, so for now we won't do any caching at all. This is not safe in a concurrent setting, however all our darwin builders run with concurrency 1, and -j8, on 8 core m1 mac minis.
* testsuite: Add test for #20142Ben Gamari2021-07-232-0/+31
|
* Cmm.Opt: Fix type of shift amount in constant foldingBen Gamari2021-07-231-2/+2
| | | | | | | | Previously the `MO_S_Quot` constant folding rule would incorrectly pass the shift amount of the same width as the shifted value. However, the machop's type expects the shift amount to be a Word. Fixes #20142.
* Stop ug_boring_info retaining a chain of old CoreExprMatthew Pickering2021-07-231-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | It was noticed in #20134 that each simplifier iteration used an increasing amount of memory and that a certain portion of memory was not released until the simplfier had completely finished. I profiled the program using `-hi` profiling and observed that there was a thunk arising in the computation of `ug_boring_ok`. On each iteration `ug_boring_ok` would be updated, but not forced, which would leave a thunk in the shape of ug_boring_ok = inlineBoringOk expr0 || inlineBoringOk expr2 || inlineBoringOk expr3 || ... which would retain all previous `expr` until `ug_boring_ok` was forced or discarded. Forcing this accumulator eagerly results in a flat profile over multiple simplifier runs. This reduces the maximum residency when compiling the test in #20134 from 2GB to 1.3G. ------------------------- Metric Decrease: T11545 -------------------------
* Fix a few retainer leaks of TcGblEnvMatthew Pickering2021-07-233-4/+18
| | | | | | | | | | | | Methodology: Create a -hi profile and then search for TcGblEnv then use ghc-debug to work out why they are being retained and remove the reason. Retaining TcGblEnv is dangerous because it contains pointers to things such as a TypeEnv which is updated throughout compilation. I found two places which were retaining a TcGblEnv unecessarily. Also fix a few places where an OccName was retaining an Id.
* Introduce FinderLocations for decoupling Finder from DynFlagsFendor2021-07-2320-103/+200
|
* Check the buffer size *before* calling the continuation in withEncodedCStringMatthew Pickering2021-07-233-13/+63
| | | | | | | | | | | | | | | | | | | | This fixes a very subtle bug in withEncodedCString where a reference would be kept to the whole continuation until the continuation had finished executing. This was because the call to tryFillBufferAndCall could fail, if the buffer was already full and so the `go` helper would be recursively called on failure which necessitated keeping a reference to `act`. The failure could only happen during the initial checking phase of the function but not during the call to the continuation. Therefore the fix is to first perform the size check, potentially recursively and then finally calling tail calling the continuation. In the real world, this broke writing lazy bytestrings because a reference to the head of the bytestring would be retained in the continuation until the whole string had been written to a file. Fixes #20107
* Add test for #13157Matthew Pickering2021-07-233-0/+16
| | | | Closes #13157
* Generalise reallyUnsafePtrEquality# and use itsheaf2021-07-2319-90/+446
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #9192 and #17126 updates containers submodule 1. Changes the type of the primop `reallyUnsafePtrEquality#` to the most general version possible (heterogeneous as well as levity-polymorphic): > reallyUnsafePtrEquality# > :: forall {l :: Levity} {k :: Levity} > (a :: TYPE (BoxedRep l)) (b :: TYPE (BoxedRep k)) > . a -> b -> Int# 2. Adds a new internal module, `GHC.Ext.PtrEq`, which contains pointer equality operations that are now subsumed by `reallyUnsafePtrEquality#`. These functions are then re-exported by `GHC.Exts` (so that no function goes missing from the export list of `GHC.Exts`, which is user-facing). More specifically, `GHC.Ext.PtrEq` defines: - A new function: * reallyUnsafePtrEquality :: forall (a :: Type). a -> a -> Int# - Library definitions of ex-primops: * `sameMutableArray#` * `sameSmallMutableArray` * `sameMutableByteArray#` * `sameMutableArrayArray#` * `sameMutVar#` * `sameTVar#` * `sameMVar#` * `sameIOPort#` * `eqStableName#` - New functions for comparing non-mutable arrays: * `sameArray#` * `sameSmallArray#` * `sameByteArray#` * `sameArrayArray#` These were requested in #9192. Generally speaking, existing libraries that use `reallyUnsafePtrEquality#` will continue to work with the new, levity-polymorphic version. But not all! Some (`containers`, `unordered-containers`, `dependent-map`) contain the following: > unsafeCoerce# reallyUnsafePtrEquality# a b If we make `reallyUnsafePtrEquality#` levity-polymorphic, this code fails the current GHC representation-polymorphism checks. We agreed that the right solution here is to modify the library; in this case by deleting the call to `unsafeCoerce#`, since `reallyUnsafePtrEquality#` is now type-heterogeneous too.
* Add nontrivial type-checking plugin testssheaf2021-07-2312-0/+454
| | | | | | | | | | | | | Three new tests for type-checking plugins: - TcPlugin_Nullary, solving a nullary class constraint - TcPlugin_Args, providing evidence for a (unary) class constraint using arguments supplied to the plugin - TcPlugin_TyFam, solving an equality constraint to rewrite a type-family application More extensive descriptions of the plugins can be found in their respective defining modules.
* Perf: fix strictness in OccurAnalSylvain Henry2021-07-231-168/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enhances OccurAnal perf by using a dedicated WithUsageDetails datatype instead of a tuple (similarly to what has been done in demand-analysis) with strict fields. OccEnv is also passed strictly with more strict fields as it improves results even more. T9198 flukes isn't reproducible locally (cf https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5667#note_364358) Metric Decrease: ManyConstructors T10421 T12150 T12425 T12707 T13056 T13253 T13253-spj T15164 T16577 T18282 T18698a T18698b T1969 T4801 T5642 T9020 T9233 T9630 T9675 T9961 WWRec T12227 T13035 T18304 T6048 T12234 T783 T20049 Metric Increase: T9198
* Use fix-sized equality primops for fixed size boxed typesJohn Ericson2021-07-212-12/+12
| | | | These are the last to be converted.