[Git][ghc/ghc][wip/int-index/tok-where] 936 commits: Hadrian: fix ghcDebugAssertions off-by-one error
Andrei Borzenkov (@sand-witch)
gitlab at gitlab.haskell.org
Mon May 29 15:37:46 UTC 2023
Andrei Borzenkov pushed to branch wip/int-index/tok-where at Glasgow Haskell Compiler / GHC
Commits:
cd31acad by sheaf at 2022-12-06T15:45:58-05:00
Hadrian: fix ghcDebugAssertions off-by-one error
Commit 6b2f7ffe changed the logic that decided whether to enable debug
assertions. However, it had an off-by-one error, as the stage parameter
to the function inconsistently referred to the stage of the compiler
being used to build or the stage of the compiler we are building.
This patch makes it consistent. Now the parameter always refers to the
the compiler which is being built.
In particular, this patch re-enables
assertions in the stage 2 compiler when building with devel2 flavour,
and disables assertions in the stage 2 compiler when building with
validate flavour.
Some extra performance tests are now run in the "validate" jobs because
the stage2 compiler no longer contains assertions.
-------------------------
Metric Decrease:
CoOpt_Singletons
MultiComponentModules
MultiComponentModulesRecomp
MultiLayerModulesTH_OneShot
T11374
T12227
T12234
T13253-spj
T13701
T14683
T14697
T15703
T17096
T17516
T18304
T18478
T18923
T5030
T9872b
TcPlugin_RewritePerf
Metric Increase:
MultiComponentModules
MultiComponentModulesRecomp
MultiLayerModules
MultiLayerModulesRecomp
MultiLayerModulesTH_Make
T13386
T13719
T3294
T9233
T9675
parsing001
-------------------------
- - - - -
21d66db1 by mrkun at 2022-12-06T15:46:38-05:00
Push DynFlags out of runInstallNameTool
- - - - -
aaaaa79b by mrkun at 2022-12-06T15:46:38-05:00
Push DynFlags out of askOtool
- - - - -
4e28f49e by mrkun at 2022-12-06T15:46:38-05:00
Push DynFlags out of runInjectRPaths
- - - - -
a7422580 by mrkun at 2022-12-06T15:46:38-05:00
Push DynFlags out of Linker.MacOS
- - - - -
e902d771 by Matthew Craven at 2022-12-08T08:30:23-05:00
Fix bounds-checking buglet in Data.Array.Byte
...another manifestation of #20851 which
I unfortunately missed in my first pass.
- - - - -
8d36c0c6 by Gergő Érdi at 2022-12-08T08:31:03-05:00
Remove copy-pasted definitions of `graphFromEdgedVertices*`
- - - - -
c5d8ed3a by Gergő Érdi at 2022-12-08T08:31:03-05:00
Add version of `reachableGraph` that avoids loop for cyclic inputs
by building its result connected component by component
Fixes #22512
- - - - -
90cd5396 by Krzysztof Gogolewski at 2022-12-08T08:31:39-05:00
Mark Type.Reflection.Unsafe as Unsafe
This module can be used to construct ill-formed TypeReps, so it should
be Unsafe.
- - - - -
2057c77d by Ian-Woo Kim at 2022-12-08T08:32:19-05:00
Truncate eventlog event for large payload (#20221)
RTS eventlog events for postCapsetVecEvent are truncated if payload
is larger than EVENT_PAYLOAD_SIZE_MAX
Previously, postCapsetVecEvent records eventlog event with payload
of variable size larger than EVENT_PAYLOAD_SIZE_MAX (2^16) without
any validation, resulting in corrupted data.
For example, this happens when a Haskell binary is invoked with very
long command line arguments exceeding 2^16 bytes (see #20221).
Now we check the size of accumulated payload messages incrementally,
and truncate the message just before the payload size exceeds
EVENT_PAYLOAD_SIZE_MAX. RTS will warn the user with a message showing
how many arguments are truncated.
- - - - -
9ec76f61 by Cheng Shao at 2022-12-08T08:32:59-05:00
hadrian: don't add debug info to non-debug ways of rts
Hadrian used to pass -g when building all ways of rts. It makes output
binaries larger (especially so for wasm backend), and isn't needed by
most users out there, so this patch removes that flag. In case the
debug info is desired, we still pass -g3 when building the debug way,
and there's also the debug_info flavour transformer which ensures -g3
is passed for all rts ways.
- - - - -
7658cdd4 by Krzysztof Gogolewski at 2022-12-08T08:33:36-05:00
Restore show (typeRep @[]) == "[]"
The Show instance for TypeRep [] has changed in 9.5 to output "List"
because the name of the type constructor changed.
This seems to be accidental and is inconsistent with TypeReps of saturated
lists, which are printed as e.g. "[Int]".
For now, I'm restoring the old behavior; in the future,
maybe we should show TypeReps without puns (List, Tuple, Type).
- - - - -
216deefd by Matthew Pickering at 2022-12-08T22:45:27-05:00
Add test for #22162
- - - - -
5d0a311f by Matthew Pickering at 2022-12-08T22:45:27-05:00
ci: Add job to test interface file determinism guarantees
In this job we can run on every commit we add a test which builds the
Cabal library twice and checks that the ABI hash and interface hash is
stable across the two builds.
* We run the test 20 times to try to weed out any race conditions due to
`-j`
* We run the builds in different temporary directories to try to weed
out anything related to build directory affecting ABI or interface
file hash.
Fixes #22180
- - - - -
0a76d7d4 by Matthew Pickering at 2022-12-08T22:45:27-05:00
ci: Add job for testing interface stability across builds
The idea is that both the bindists should product libraries with the
same ABI and interface hash.
So the job checks with ghc-pkg to make sure the computed ABI
is the same.
In future this job can be extended to check for the other facets of
interface determinism.
Fixes #22180
- - - - -
74c9bf91 by Matthew Pickering at 2022-12-08T22:45:27-05:00
backpack: Be more careful when adding together ImportAvails
There was some code in the signature merging logic which added together
the ImportAvails of the signature and the signature which was merged
into it. This had the side-effect of making the merged signature depend
on the signature (via a normal module dependency). The intention was to
propagate orphan instances through the merge but this also messed up
recompilation logic because we shouldn't be attempting to load B.hi when
mergeing it.
The fix is to just combine the part of ImportAvails that we intended to
(transitive info, orphan instances and type family instances) rather
than the whole thing.
- - - - -
d122e022 by Matthew Pickering at 2022-12-08T22:45:27-05:00
Fix mk_mod_usage_info if the interface file is not already loaded
In #22217 it was observed that the order modules are compiled in affects
the contents of an interface file. This was because a module dependended
on another module indirectly, via a re-export but the interface file for
this module was never loaded because the symbol was never used in the
file.
If we decide that we depend on a module then we jolly well ought to
record this fact in the interface file! Otherwise it could lead to very
subtle recompilation bugs if the dependency is not tracked and the
module is updated.
Therefore the best thing to do is just to make sure the file is loaded
by calling the `loadSysInterface` function. This first checks the
caches (like we did before) but then actually goes to find the interface
on disk if it wasn't loaded.
Fixes #22217
- - - - -
ea25088d by lrzlin at 2022-12-08T22:46:06-05:00
Add initial support for LoongArch Architecture.
- - - - -
9eb9d2f4 by Bodigrim at 2022-12-08T22:46:47-05:00
Update submodule mtl to 2.3.1, parsec to 3.1.15.1, haddock and Cabal to HEAD
- - - - -
08d8fe2a by Bodigrim at 2022-12-08T22:46:47-05:00
Allow mtl-2.3 in hadrian
- - - - -
3807a46c by Bodigrim at 2022-12-08T22:46:47-05:00
Support mtl-2.3 in check-exact
- - - - -
ef702a18 by Bodigrim at 2022-12-08T22:46:47-05:00
Fix tests
- - - - -
3144e8ff by Sebastian Graf at 2022-12-08T22:47:22-05:00
Make (^) INLINE (#22324)
So that we get to cancel away the allocation for the lazily used base.
We can move `powImpl` (which *is* strict in the base) to the top-level
so that we don't duplicate too much code and move the SPECIALISATION
pragmas onto `powImpl`.
The net effect of this change is that `(^)` plays along much better with
inlining thresholds and loopification (#22227), for example in `x2n1`.
Fixes #22324.
- - - - -
1d3a8b8e by Matthew Pickering at 2022-12-08T22:47:59-05:00
Typeable: Fix module locations of some definitions in GHC.Types
There was some confusion in Data.Typeable about which module certain
wired-in things were defined in. Just because something is wired-in
doesn't mean it comes from GHC.Prim, in particular things like LiftedRep
and RuntimeRep are defined in GHC.Types and that's the end of the story.
Things like Int#, Float# etc are defined in GHC.Prim as they have no
Haskell definition site at all so we need to generate type
representations for them (which live in GHC.Types).
Fixes #22510
- - - - -
0f7588b5 by Sebastian Graf at 2022-12-08T22:48:34-05:00
Make `drop` and `dropWhile` fuse (#18964)
I copied the fusion framework we have in place for `take`.
T18964 asserts that we regress neither when fusion fires nor when it doesn't.
Fixes #18964.
- - - - -
26e71562 by Sebastian Graf at 2022-12-08T22:49:10-05:00
Do not strictify a DFun's parameter dictionaries (#22549)
... thus fixing #22549.
The details are in the refurbished and no longer dead
`Note [Do not strictify a DFun's parameter dictionaries]`.
There's a regression test in T22549.
- - - - -
36093407 by John Ericson at 2022-12-08T22:49:45-05:00
Delete `rts/package.conf.in`
It is a relic of the Make build system. The RTS now uses a
`package.conf` file generated the usual way by Cabal.
- - - - -
b0cc2fcf by Krzysztof Gogolewski at 2022-12-08T22:50:21-05:00
Fixes around primitive literals
* The SourceText of primitive characters 'a'# did not include
the #, unlike for other primitive literals 1#, 1##, 1.0#, 1.0##, "a"#.
We can now remove the function pp_st_suffix, which was a hack
to add the # back.
* Negative primitive literals shouldn't use parentheses, as described in
Note [Printing of literals in Core]. Added a testcase to T14681.
- - - - -
aacf616d by Bryan Richter at 2022-12-08T22:50:56-05:00
testsuite: Mark conc024 fragile on Windows
- - - - -
ed239a24 by Ryan Scott at 2022-12-09T09:42:16-05:00
Document TH splices' interaction with INCOHERENT instances
Top-level declaration splices can having surprising interactions with
`INCOHERENT` instances, as observed in #22492. This patch
resolves #22492 by documenting this strange interaction in the GHC User's
Guide.
[ci skip]
- - - - -
1023b432 by Mike Pilgrem at 2022-12-09T09:42:56-05:00
Fix #22300 Document GHC's extensions to valid whitespace
- - - - -
79b0cec0 by Luite Stegeman at 2022-12-09T09:43:38-05:00
Add support for environments that don't have setImmediate
- - - - -
5b007ec5 by Luite Stegeman at 2022-12-09T09:43:38-05:00
Fix bound thread status
- - - - -
65335d10 by Matthew Pickering at 2022-12-09T20:15:45-05:00
Update containers submodule
This contains a fix necessary for the multi-repl to work on GHC's code
base where we try to load containers and template-haskell into the same
session.
- - - - -
4937c0bb by Matthew Pickering at 2022-12-09T20:15:45-05:00
hadrian-multi: Put interface files in separate directories
Before we were putting all the interface files in the same directory
which was leading to collisions if the files were called the same thing.
- - - - -
8acb5b7b by Matthew Pickering at 2022-12-09T20:15:45-05:00
hadrian-toolargs: Add filepath to allowed repl targets
- - - - -
5949d927 by Matthew Pickering at 2022-12-09T20:15:45-05:00
driver: Set correct UnitId when rehydrating modules
We were not setting the UnitId before rehydrating modules which just led
to us attempting to find things in the wrong HPT. The test for this is
the hadrian-multi command (which is now added as a CI job).
Fixes #22222
- - - - -
ab06c0f0 by Matthew Pickering at 2022-12-09T20:15:45-05:00
ci: Add job to test hadrian-multi command
I am not sure this job is good because it requires booting HEAD with
HEAD, but it should be fine.
- - - - -
fac3e568 by Matthew Pickering at 2022-12-09T20:16:20-05:00
hadrian: Update bootstrap plans to 9.2.* series and 9.4.* series.
This updates the build plans for the most recent compiler versions, as
well as fixing the hadrian-bootstrap-gen script to a specific GHC
version.
- - - - -
195b08b4 by Matthew Pickering at 2022-12-09T20:16:20-05:00
ci: Bump boot images to use ghc-9.4.3
Also updates the bootstrap jobs to test booting 9.2 and 9.4.
- - - - -
c658c580 by Matthew Pickering at 2022-12-09T20:16:20-05:00
hlint: Removed redundant UnboxedSums pragmas
UnboxedSums is quite confusingly implied by UnboxedTuples, alas, just
the way it is.
See #22485
- - - - -
b3e98a92 by Oleg Grenrus at 2022-12-11T12:26:17-05:00
Add heqT, a kind-heterogeneous variant of heq
CLC proposal https://github.com/haskell/core-libraries-committee/issues/99
- - - - -
bfd7c1e6 by Bodigrim at 2022-12-11T12:26:55-05:00
Document that Bifunctor instances for tuples are lawful only up to laziness
- - - - -
5d1a1881 by Bryan Richter at 2022-12-12T16:22:36-05:00
Mark T21336a fragile
- - - - -
c30accc2 by Matthew Pickering at 2022-12-12T16:23:11-05:00
Add test for #21476
This issues seems to have been fixed since the ticket was made, so let's
add a test and move on.
Fixes #21476
- - - - -
e9d74a3e by Sebastian Graf at 2022-12-13T22:18:39-05:00
Respect -XStrict in the pattern-match checker (#21761)
We were missing a call to `decideBangHood` in the pattern-match checker.
There is another call in `matchWrapper.mk_eqn_info` which seems redundant
but really is not; see `Note [Desugaring -XStrict matches in Pmc]`.
Fixes #21761.
- - - - -
884790e2 by Gergő Érdi at 2022-12-13T22:19:14-05:00
Fix loop in the interface representation of some `Unfolding` fields
As discovered in #22272, dehydration of the unfolding info of a
recursive definition used to involve a traversal of the definition
itself, which in turn involves traversing the unfolding info. Hence,
a loop.
Instead, we now store enough data in the interface that we can produce
the unfolding info without this traversal. See Note [Tying the 'CoreUnfolding' knot]
for details.
Fixes #22272
Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com>
- - - - -
9f301189 by Alan Zimmerman at 2022-12-13T22:19:50-05:00
EPA: When splitting out header comments, keep ones for first decl
Any comments immediately preceding the first declaration are no longer
kept as header comments, but attach to the first declaration instead.
- - - - -
8b1f1b45 by Sylvain Henry at 2022-12-13T22:20:28-05:00
JS: fix object file name comparison (#22578)
- - - - -
e9e161bb by Bryan Richter at 2022-12-13T22:21:03-05:00
configure: Bump min bootstrap GHC version to 9.2
- - - - -
75855643 by Ben Gamari at 2022-12-15T03:54:02-05:00
hadrian: Don't enable TSAN in stage0 build
- - - - -
da7b51d8 by Ben Gamari at 2022-12-15T03:54:02-05:00
cmm: Introduce blockConcat
- - - - -
34f6b09c by Ben Gamari at 2022-12-15T03:54:02-05:00
cmm: Introduce MemoryOrderings
- - - - -
43beaa7b by Ben Gamari at 2022-12-15T03:54:02-05:00
llvm: Respect memory specified orderings
- - - - -
8faf74fc by Ben Gamari at 2022-12-15T03:54:02-05:00
Codegen/x86: Eliminate barrier for relaxed accesses
- - - - -
6cc3944a by Ben Gamari at 2022-12-15T03:54:02-05:00
cmm/Parser: Reduce some repetition
- - - - -
6c9862c4 by Ben Gamari at 2022-12-15T03:54:02-05:00
cmm/Parser: Add syntax for ordered loads and stores
- - - - -
748490d2 by Ben Gamari at 2022-12-15T03:54:02-05:00
cmm/Parser: Atomic load syntax
Originally I had thought I would just use the `prim` call syntax instead
of introducing new syntax for atomic loads. However, it turns out that
`prim` call syntax tends to make things quite unreadable. This new
syntax seems quite natural.
- - - - -
28c6781a by Ben Gamari at 2022-12-15T03:54:02-05:00
codeGen: Introduce ThreadSanitizer instrumentation
This introduces a new Cmm pass which instruments the program with
ThreadSanitizer annotations, allowing full tracking of mutator memory
accesses via TSAN.
- - - - -
d97aa311 by Ben Gamari at 2022-12-15T03:54:02-05:00
Hadrian: Drop TSAN_ENABLED define from flavour
This is redundant since the TSANUtils.h already defines it.
- - - - -
86974ef1 by Ben Gamari at 2022-12-15T03:54:02-05:00
hadrian: Enable Cmm instrumentation in TSAN flavour
- - - - -
93723290 by Ben Gamari at 2022-12-15T03:54:02-05:00
rts: Ensure that global regs are never passed as fun call args
This is in general unsafe as they may be clobbered if they are mapped to
caller-saved machine registers. See Note [Register parameter passing].
- - - - -
2eb0fb87 by Matthew Pickering at 2022-12-15T03:54:39-05:00
Package Imports: Get candidate packages also from re-exported modules
Previously we were just looking at the direct imports to try and work
out what a package qualifier could apply to but #22333 pointed out we
also needed to look for reexported modules.
Fixes #22333
- - - - -
552b7908 by Ben Gamari at 2022-12-15T03:55:15-05:00
compiler: Ensure that MutVar operations have necessary barriers
Here we add acquire and release barriers in readMutVar# and
writeMutVar#, which are necessary for soundness.
Fixes #22468.
- - - - -
933d61a4 by Simon Peyton Jones at 2022-12-15T03:55:51-05:00
Fix bogus test in Lint
The Lint check for branch compatiblity within an axiom, in
GHC.Core.Lint.compatible_branches was subtly different to the
check made when contructing an axiom, in
GHC.Core.FamInstEnv.compatibleBranches.
The latter is correct, so I killed the former and am now using the
latter.
On the way I did some improvements to pretty-printing and documentation.
- - - - -
03ed0b95 by Ryan Scott at 2022-12-15T03:56:26-05:00
checkValidInst: Don't expand synonyms when splitting sigma types
Previously, the `checkValidInst` function (used when checking that an instance
declaration is headed by an actual type class, not a type synonym) was using
`tcSplitSigmaTy` to split apart the `forall`s and instance context. This is
incorrect, however, as `tcSplitSigmaTy` expands type synonyms, which can cause
instances headed by quantified constraint type synonyms to be accepted
erroneously.
This patch introduces `splitInstTyForValidity`, a variant of `tcSplitSigmaTy`
specialized for validity checking that does _not_ expand type synonyms, and
uses it in `checkValidInst`.
Fixes #22570.
- - - - -
ed056bc3 by Ben Gamari at 2022-12-16T16:12:44-05:00
rts/Messages: Refactor
This doesn't change behavior but makes the code a bit easier to follow.
- - - - -
7356f8e0 by Ben Gamari at 2022-12-16T16:12:44-05:00
rts/ThreadPaused: Ordering fixes
- - - - -
914f0025 by Ben Gamari at 2022-12-16T16:12:44-05:00
eventlog: Silence spurious data race
- - - - -
fbc84244 by Ben Gamari at 2022-12-16T16:12:44-05:00
Introduce SET_INFO_RELEASE for Cmm
- - - - -
821b5472 by Ben Gamari at 2022-12-16T16:12:44-05:00
rts: Use fences instead of explicit barriers
- - - - -
2228c999 by Ben Gamari at 2022-12-16T16:12:44-05:00
rts/stm: Fix memory ordering in readTVarIO#
See #22421.
- - - - -
99269b9f by Ben Gamari at 2022-12-16T16:12:44-05:00
Improve heap memory barrier Note
Also introduce MUT_FIELD marker in Closures.h to document mutable
fields.
- - - - -
70999283 by Ben Gamari at 2022-12-16T16:12:44-05:00
rts: Introduce getNumCapabilities
And ensure accesses to n_capabilities are atomic (although with relaxed
ordering). This is necessary as RTS API callers may concurrently call
into the RTS without holding a capability.
- - - - -
98689f77 by Ben Gamari at 2022-12-16T16:12:44-05:00
ghc: Fix data race in dump file handling
Previously the dump filename cache would use a non-atomic update which
could potentially result in lost dump contents. Note that this is still
a bit racy since the first writer may lag behind a later appending
writer.
- - - - -
605d9547 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Always use atomics for context_switch and interrupt
Since these are modified by the timer handler.
- - - - -
86f20258 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts/Timer: Always use atomic operations
As noted in #22447, the existence of the pthread-based ITimer
implementation means that we cannot assume that the program is
single-threaded.
- - - - -
f8e901dc by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Encapsulate recent_activity access
This makes it easier to ensure that it is accessed using the necessary
atomic operations.
- - - - -
e0affaa9 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Encapsulate access to capabilities array
- - - - -
7ca683e4 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Encapsulate sched_state
- - - - -
1cf13bd0 by Ben Gamari at 2022-12-16T16:12:45-05:00
PrimOps: Fix benign MutVar race
Relaxed ordering is fine here since the later CAS implies a release.
- - - - -
3d2a7e08 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Style fix
- - - - -
82c62074 by Ben Gamari at 2022-12-16T16:12:45-05:00
compiler: Use release store in eager blackholing
- - - - -
eb1a0136 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Fix ordering of makeStableName
- - - - -
ad0e260a by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Use ordered accesses instead of explicit barriers
- - - - -
a3eccf06 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Statically allocate capabilities
This is a rather simplistic way of solving #17289.
- - - - -
287fa3fb by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Ensure that all accesses to pending_sync are atomic
- - - - -
351eae58 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Note race with wakeBlockingQueue
- - - - -
5acf33dd by Bodigrim at 2022-12-16T16:13:22-05:00
Bump submodule directory to 1.3.8.0 and hpc to HEAD
- - - - -
0dd95421 by Bodigrim at 2022-12-16T16:13:22-05:00
Accept allocations increase on Windows
This is because of `filepath-1.4.100.0` and AFPP, causing increasing round-trips
between lists and ByteArray. See #22625 for discussion.
Metric Increase:
MultiComponentModules
MultiComponentModulesRecomp
MultiLayerModules
MultiLayerModulesRecomp
T10421
T10547
T12150
T12227
T12234
T12425
T13035
T13253
T13253-spj
T13701
T13719
T15703
T16875
T18140
T18282
T18304
T18698a
T18698b
T18923
T20049
T21839c
T21839r
T5837
T6048
T9198
T9961
TcPlugin_RewritePerf
hard_hole_fits
- - - - -
ef9ac9d2 by Cheng Shao at 2022-12-16T16:13:59-05:00
testsuite: Mark T9405 as fragile instead of broken on Windows
It's starting to pass again, and the unexpected pass blocks CI.
- - - - -
1f3abd85 by Cheng Shao at 2022-12-16T21:16:28+00:00
compiler: remove obsolete commented code in wasm NCG
It was just a temporary hack to workaround a bug in the relooper, that
bug has been fixed long before the wasm backend is merged.
- - - - -
e3104eab by Cheng Shao at 2022-12-16T21:16:28+00:00
compiler: add missing export list of GHC.CmmToAsm.Wasm.FromCmm
Also removes some unreachable code here.
- - - - -
1c6930bf by Cheng Shao at 2022-12-16T21:16:28+00:00
compiler: change fallback function signature to Cmm function signature in wasm NCG
In the wasm NCG, when handling a `CLabel` of undefined function
without knowing its function signature, we used to fallback to `() ->
()` which is accepted by `wasm-ld`. This patch changes it to the
signature of Cmm functions, which equally works, but would be required
when we emit tail call instructions.
- - - - -
8a81d9d9 by Cheng Shao at 2022-12-16T21:16:28+00:00
compiler: add optional tail-call support in wasm NCG
When the `-mtail-call` clang flag is passed at configure time, wasm
tail-call extension is enabled, and the wasm NCG will emit
`return_call`/`return_call_indirect` instructions to take advantage of
it and avoid the `StgRun` trampoline overhead.
Closes #22461.
- - - - -
d1431cc0 by Cheng Shao at 2022-12-17T08:07:15-05:00
base: add missing autoconf checks for waitpid/umask
These are not present in wasi-libc. Required for fixing #22589
- - - - -
da3f1e91 by Cheng Shao at 2022-12-17T08:07:51-05:00
compiler: make .wasm the default executable extension on wasm32
Following convention as in other wasm toolchains. Fixes #22594.
- - - - -
ad21f4ef by Cheng Shao at 2022-12-17T08:07:51-05:00
ci: support hello.wasm in ci.sh cross testing logic
- - - - -
6fe2d778 by amesgen at 2022-12-18T19:33:49-05:00
Correct `exitWith` Haddocks
The `IOError`-specific `catch` in the Prelude is long gone.
- - - - -
b3eacd64 by Ben Gamari at 2022-12-18T19:34:24-05:00
rts: Drop racy assertion
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.
- - - - -
761c1f49 by Ben Gamari at 2022-12-18T19:35:00-05:00
rts/libdw: Silence uninitialized usage warnings
As noted in #22538, previously some GCC versions warned that various
locals in Libdw.c may be used uninitialized. Although this wasn't
strictly true (since they were initialized in an inline assembler block)
we fix this by providing explicit empty initializers.
Fixes #22538
- - - - -
5e047eff by Matthew Pickering at 2022-12-20T15:12:04+00:00
testsuite: Mark T16392 as fragile on windows
See #22649
- - - - -
703a4665 by M Farkas-Dyck at 2022-12-20T21:14:46-05:00
Scrub some partiality in `GHC.Cmm.Info.Build`: `doSRTs` takes a `[(CAFSet, CmmDecl)]` but truly wants a `[(CAFSet, CmmStatics)]`.
- - - - -
9736ab74 by Matthew Pickering at 2022-12-20T21:15:22-05:00
packaging: Fix upload_ghc_libs.py script
This change reflects the changes where .cabal files are now generated by
hadrian rather than ./configure.
Fixes #22518
- - - - -
7c6de18d by Ben Gamari at 2022-12-20T21:15:57-05:00
configure: Drop uses of AC_PROG_CC_C99
As noted in #22566, this macro is deprecated as of autoconf-2.70
`AC_PROG_CC` now sets `ac_cv_prog_cc_c99` itself.
Closes #22566.
- - - - -
36c5d98e by Ben Gamari at 2022-12-20T21:15:57-05:00
configure: Use AS_HELP_STRING instead of AC_HELP_STRING
The latter has been deprecated.
See #22566.
- - - - -
befe6ff8 by Bodigrim at 2022-12-20T21:16:37-05:00
GHCi.UI: fix various usages of head and tail
- - - - -
666d0ba7 by Bodigrim at 2022-12-20T21:16:37-05:00
GHCi.UI: avoid head and tail in parseCallEscape and around
- - - - -
5d96fd50 by Bodigrim at 2022-12-20T21:16:37-05:00
Make GHC.Driver.Main.hscTcRnLookupRdrName to return NonEmpty
- - - - -
3ce2ab94 by Bodigrim at 2022-12-21T06:17:56-05:00
Allow transformers-0.6 in ghc, ghci, ghc-bin and hadrian
- - - - -
954de93a by Bodigrim at 2022-12-21T06:17:56-05:00
Update submodule haskeline to HEAD (to allow transformers-0.6)
- - - - -
cefbeec3 by Bodigrim at 2022-12-21T06:17:56-05:00
Update submodule transformers to 0.6.0.4
- - - - -
b4730b62 by Bodigrim at 2022-12-21T06:17:56-05:00
Fix tests
T13253 imports MonadTrans, which acquired a quantified constraint in transformers-0.6, thus increase in allocations
Metric Increase:
T13253
- - - - -
0be75261 by Simon Peyton Jones at 2022-12-21T06:18:32-05:00
Abstract over the right free vars
Fix #22459, in two ways:
(1) Make the Specialiser not create a bogus specialisation if
it is presented by strangely polymorphic dictionary.
See Note [Weird special case in SpecDict] in
GHC.Core.Opt.Specialise
(2) Be more careful in abstractFloats
See Note [Which type variables to abstract over]
in GHC.Core.Opt.Simplify.Utils.
So (2) stops creating the excessively polymorphic dictionary in
abstractFloats, while (1) stops crashing if some other pass should
nevertheless create a weirdly polymorphic dictionary.
- - - - -
df7bc6b3 by Ying-Ruei Liang (TheKK) at 2022-12-21T14:31:54-05:00
rts: explicitly store return value of ccall checkClosure to prevent type error (#22617)
- - - - -
e193e537 by Simon Peyton Jones at 2022-12-21T14:32:30-05:00
Fix shadowing lacuna in OccurAnal
Issue #22623 demonstrated another lacuna in the implementation
of wrinkle (BS3) in Note [The binder-swap substitution] in
the occurrence analyser.
I was failing to add TyVar lambda binders using
addInScope/addOneInScope and that led to a totally bogus binder-swap
transformation.
Very easy to fix.
- - - - -
3d55d8ab by Simon Peyton Jones at 2022-12-21T14:32:30-05:00
Fix an assertion check in addToEqualCtList
The old assertion saw that a constraint ct could rewrite itself
(of course it can) and complained (stupid).
Fixes #22645
- - - - -
ceb2e9b9 by Ben Gamari at 2022-12-21T15:26:08-05:00
configure: Bump version to 9.6
- - - - -
fb4d36c4 by Ben Gamari at 2022-12-21T15:27:49-05:00
base: Bump version to 4.18
Requires various submodule bumps.
- - - - -
93ee7e90 by Ben Gamari at 2022-12-21T15:27:49-05:00
ghc-boot: Fix bootstrapping
- - - - -
fc3a2232 by Ben Gamari at 2022-12-22T13:45:06-05:00
Bump GHC version to 9.7
- - - - -
914f7fe3 by Andreas Klebinger at 2022-12-22T23:36:10-05:00
Don't consider large byte arrays/compact regions pinned.
Workaround for #22255 which showed how treating large/compact regions
as pinned could cause segfaults.
- - - - -
32b32d7f by Matthew Pickering at 2022-12-22T23:36:46-05:00
hadrian bindist: Install manpages to share/man/man1/ghc.1
When the installation makefile was copied over the manpages were no
longer installed in the correct place. Now we install it into share/man/man1/ghc.1
as the make build system did.
Fixes #22371
- - - - -
b3ddf803 by Ben Gamari at 2022-12-22T23:37:23-05:00
rts: Drop paths from configure from cabal file
A long time ago we would rely on substitutions from the configure script
to inject paths of the include and library directories of libffi and
libdw. However, now these are instead handled inside Hadrian when
calling Cabal's `configure` (see the uses of `cabalExtraDirs` in
Hadrian's `Settings.Packages.packageArgs`).
While the occurrences in the cabal file were redundant, they did no
harm. However, since b5c714545abc5f75a1ffdcc39b4bfdc7cd5e64b4 they have
no longer been interpolated. @mpickering noticed the suspicious
uninterpolated occurrence of `@FFIIncludeDir@` in #22595,
prompting this commit to finally remove them.
- - - - -
b2c7523d by Ben Gamari at 2022-12-22T23:37:59-05:00
Bump libffi-tarballs submodule
We will now use libffi-3.4.4.
- - - - -
3699a554 by Alan Zimmerman at 2022-12-22T23:38:35-05:00
EPA: Make EOF position part of AnnsModule
Closes #20951
Closes #19697
- - - - -
99757ce8 by Sylvain Henry at 2022-12-22T23:39:13-05:00
JS: fix support for -outputdir (#22641)
The `-outputdir` option wasn't correctly handled with the JS backend
because the same code path was used to handle both objects produced by
the JS backend and foreign .js files. Now we clearly distinguish the
two in the pipeline, fixing the bug.
- - - - -
02ed7d78 by Simon Peyton Jones at 2022-12-22T23:39:49-05:00
Refactor mkRuntimeError
This patch fixes #22634. Because we don't have TYPE/CONSTRAINT
polymorphism, we need two error functions rather than one.
I took the opportunity to rname runtimeError to impossibleError,
to line up with mkImpossibleExpr, and avoid confusion with the
genuine runtime-error-constructing functions.
- - - - -
35267f07 by Ben Gamari at 2022-12-22T23:40:32-05:00
base: Fix event manager shutdown race on non-Linux platforms
During shutdown it's possible that we will attempt to use a closed fd
to wakeup another capability's event manager. On the Linux eventfd path
we were careful to handle this. However on the non-Linux path we failed
to do so. Fix this.
- - - - -
317f45c1 by Simon Peyton Jones at 2022-12-22T23:41:07-05:00
Fix unifier bug: failing to decompose over-saturated type family
This simple patch fixes #22647
- - - - -
14b2e3d3 by Ben Gamari at 2022-12-22T23:41:42-05:00
rts/m32: Fix sanity checking
Previously we would attempt to clear pages which were marked as
read-only. Fix this.
- - - - -
16a1bcd1 by Matthew Pickering at 2022-12-23T09:15:24+00:00
ci: Move wasm pipelines into nightly rather than master
See #22664 for the changes which need to be made to bring one of these
back to the validate pipeline.
- - - - -
18d2acd2 by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Fix race in marking of blackholes
We must use an acquire-fence when marking to ensure that the indirectee
is visible.
- - - - -
11241efa by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Fix segment list races
- - - - -
602455c9 by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Use atomic when looking at bd->gen
Since it may have been mutated by a moving GC.
- - - - -
9d63b160 by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Eliminate race in bump_static_flag
To ensure that we don't race with a mutator entering a new CAF we take
the SM mutex before touching static_flag. The other option here would be
to instead modify newCAF to use a CAS but the present approach is a bit
safer.
- - - - -
26837523 by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Ensure that mutable fields have acquire barrier
- - - - -
8093264a by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Fix races in collector status tracking
Mark a number of accesses to do with tracking of the status of the
concurrent collection thread as atomic. No interesting races here,
merely necessary to satisfy TSAN.
- - - - -
387d4fcc by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Make segment state updates atomic
- - - - -
543cae00 by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Refactor update remembered set initialization
This avoids a lock inversion between the storage manager mutex and
the stable pointer table mutex by not dropping the SM_MUTEX in
nonmovingCollect. This requires quite a bit of rejiggering but it
does seem like a better strategy.
- - - - -
c9936718 by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Ensure that we aren't holding locks when closing them
TSAN complains about this sort of thing.
- - - - -
0cd31f7d by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Make bitmap accesses atomic
This is a benign race on any sensible hard since these are byte
accesses. Nevertheless, atomic accesses are necessary to satisfy
TSAN.
- - - - -
d3fe110a by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Fix benign race in update remembered set check
Relaxed load is fine here since we will take the lock before looking at
the list.
- - - - -
ab6cf893 by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Fix race in shortcutting
We must use an acquire load to read the info table pointer since if we
find an indirection we must be certain that we see the indirectee.
- - - - -
36c9f23c by Ben Gamari at 2022-12-23T19:09:30-05:00
nonmoving: Make free list counter accesses atomic
Since these may race with the allocator(s).
- - - - -
aebef31c by doyougnu at 2022-12-23T19:10:09-05:00
add GHC.Utils.Binary.foldGet' and use for Iface
A minor optimization to remove lazy IO and a lazy accumulator
strictify foldGet'
IFace.Binary: use strict foldGet'
remove superfluous bang
- - - - -
5eb357d9 by Ben Gamari at 2022-12-24T00:41:05-05:00
compiler: Ensure that GHC toolchain is first in search path
As noted in #22561, it is important that GHC's toolchain look
first for its own headers and libraries to ensure that the
system's are not found instead. If this happens things can
break in surprising ways (e.g. see #22561).
- - - - -
cbaebfb9 by Matthew Pickering at 2022-12-24T00:41:40-05:00
head.hackage: Use slow-validate bindist for linting jobs
This enables the SLOW_VALIDATE env var for the linting head.hackage
jobs, namely the jobs enabled manually, by the label or on the nightly
build now use the deb10-numa-slow-validate bindist which has assertions
enabled.
See #22623 for a ticket which was found by using this configuration
already!
The head.hackage jobs triggered by upstream CI are now thusly:
hackage-lint: Can be triggered on any MR, normal validate pipeline or nightly build.
Runs head.hackage with -dlint and a slow-validate bindist
hackage-label-lint: Trigged on MRs with "user-facing" label, runs the slow-validate
head.hackage build with -dlint.
nightly-hackage-lint: Runs automatically on nightly pipelines with slow-validate + dlint config.
nightly-hackage-perf: Runs automaticaly on nightly pipelines with release build and eventlogging enabled.
release-hackage-lint: Runs automatically on release pipelines with -dlint on a release bindist.
- - - - -
f4850f36 by Matthew Pickering at 2022-12-24T00:41:40-05:00
ci: Don't run abi-test-nightly on release jobs
The test is not configured to get the correct dependencies for the
release pipelines (and indeed stops the release pipeline being run at
all)
- - - - -
c264b06b by Matthew Pickering at 2022-12-24T00:41:40-05:00
ci: Run head.hackage jobs on upstream-testing branch rather than master
This change allows less priviledged users to trigger head.hackage jobs
because less permissions are needed to trigger jobs on the
upstream-testing branch, which is not protected.
There is a CI job which updates upstream-testing each hour to the state
of the master branch so it should always be relatively up-to-date.
- - - - -
63b97430 by Ben Gamari at 2022-12-24T00:42:16-05:00
llvmGen: Fix relaxed ordering
Previously I used LLVM's `unordered` ordering for the C11 `relaxed`
ordering. However, this is wrong and should rather use the LLVM
`monotonic` ordering.
Fixes #22640
- - - - -
f42ba88f by Ben Gamari at 2022-12-24T00:42:16-05:00
gitlab-ci: Introduce aarch64-linux-llvm job
This nightly job will ensure that we don't break the LLVM backend on
AArch64/Linux by bootstrapping GHC.
This would have caught #22640.
- - - - -
6d62f6bf by Matthew Pickering at 2022-12-24T00:42:51-05:00
Store RdrName rather than OccName in Holes
In #20472 it was pointed out that you couldn't defer out of scope but
the implementation collapsed a RdrName into an OccName to stuff it into
a Hole. This leads to the error message for a deferred qualified name
dropping the qualification which affects the quality of the error
message.
This commit adds a bit more structure to a hole, so a hole can replace a
RdrName without losing information about what that RdrName was. This is
important when printing error messages.
I also added a test which checks the Template Haskell deferral of out of
scope qualified names works properly.
Fixes #22130
- - - - -
3c3060e4 by Richard Eisenberg at 2022-12-24T17:34:19+00:00
Drop support for kind constraints.
This implements proposal 547 and closes ticket #22298.
See the proposal and ticket for motivation.
Compiler perf improves a bit
Metrics: compile_time/bytes allocated
-------------------------------------
CoOpt_Singletons(normal) -2.4% GOOD
T12545(normal) +1.0%
T13035(normal) -13.5% GOOD
T18478(normal) +0.9%
T9872d(normal) -2.2% GOOD
geo. mean -0.2%
minimum -13.5%
maximum +1.0%
Metric Decrease:
CoOpt_Singletons
T13035
T9872d
- - - - -
6d7d4393 by Ben Gamari at 2022-12-24T21:09:56-05:00
hadrian: Ensure that linker scripts are used when merging objects
In #22527 @rui314 inadvertantly pointed out a glaring bug in Hadrian's
implementation of the object merging rules: unlike the old `make` build
system we utterly failed to pass the needed linker scripts. Fix this.
- - - - -
a5bd0eb8 by Bodigrim at 2022-12-24T21:10:34-05:00
Document infelicities of instance Ord Double and workarounds
- - - - -
62b9a7b2 by Zubin Duggal at 2023-01-03T12:22:11+00:00
Force the Docs structure to prevent leaks in GHCi with -haddock without -fwrite-interface
Involves adding many new NFData instances.
Without forcing Docs, references to the TcGblEnv for each module are retained
by the Docs structure. Usually these are forced when the ModIface is serialised
but not when we aren't writing the interface.
- - - - -
21bedd84 by Facundo Domínguez at 2023-01-03T23:27:30-05:00
Explain the auxiliary functions of permutations
- - - - -
32255d05 by Matthew Pickering at 2023-01-04T11:58:42+00:00
compiler: Add -f[no-]split-sections flags
Here we add a `-fsplit-sections` flag which may some day replace
`-split-sections`. This has the advantage of automatically providing a
`-fno-split-sections` flag, which is useful for our packaging because we
enable `-split-sections` by default but want to disable it in certain
configurations.
- - - - -
e640940c by Matthew Pickering at 2023-01-04T11:58:42+00:00
hadrian: Fix computation of tables_next_to_code for outOfTreeCompiler
This copy-pasto was introduced in de5fb3489f2a9bd6dc75d0cb8925a27fe9b9084b
- - - - -
15bee123 by Matthew Pickering at 2023-01-04T11:58:42+00:00
hadrian: Add test:all_deps to build just testsuite dependencies
Fixes #22534
- - - - -
fec6638e by Matthew Pickering at 2023-01-04T11:58:42+00:00
hadrian: Add no_split_sections tranformer
This transformer reverts the effect of `split_sections`, which we intend
to use for platforms which don't support split sections.
In order to achieve this we have to modify the implemntation of the
split_sections transformer to store whether we are enabling
split_sections directly in the `Flavour` definition. This is because
otherwise there's no convenient way to turn off split_sections due to
having to pass additional linker scripts when merging objects.
- - - - -
3dc05726 by Matthew Pickering at 2023-01-04T11:58:42+00:00
check-exact: Fix build with -Werror
- - - - -
53a6ae7a by Matthew Pickering at 2023-01-04T11:58:42+00:00
ci: Build all test dependencies with in-tree compiler
This means that these executables will honour flavour transformers such
as "werror".
Fixes #22555
- - - - -
32e264c1 by Matthew Pickering at 2023-01-04T11:58:42+00:00
hadrian: Document using GHC environment variable to select boot compiler
Fixes #22340
- - - - -
be9dd9b0 by Matthew Pickering at 2023-01-04T11:58:42+00:00
packaging: Build perf builds with -split-sections
In 8f71d958 the make build system was made to use split-sections on
linux systems but it appears this logic never made it to hadrian.
There is the split_sections flavour transformer but this doesn't appear
to be used for perf builds on linux.
This is disbled on deb9 and windows due to #21670
Closes #21135
- - - - -
00dc5106 by Matthew Pickering at 2023-01-04T14:32:45-05:00
sphinx: Use modern syntax for extlinks
This fixes the following build error:
```
Command line: /opt/homebrew/opt/sphinx-doc/bin/sphinx-build -b man -d /private/tmp/extra-dir-55768274273/.doctrees-man -n -w /private/tmp/extra-dir-55768274273/.log docs/users_guide /private/tmp/extra-dir-55768274273
===> Command failed with error code: 2
Exception occurred:
File "/opt/homebrew/Cellar/sphinx-doc/6.0.0/libexec/lib/python3.11/site-packages/sphinx/ext/extlinks.py", line 101, in role
title = caption % part
~~~~~~~~^~~~~~
TypeError: not all arguments converted during string formatting
```
I tested on Sphinx-5.1.1 and Sphinx-6.0.0
Thanks for sterni for providing instructions about how to test using
sphinx-6.0.0.
Fixes #22690
- - - - -
541aedcd by Krzysztof Gogolewski at 2023-01-05T10:48:34-05:00
Misc cleanup
- Remove unused uniques and hs-boot declarations
- Fix types of seq and unsafeCoerce#
- Remove FastString/String roundtrip in JS
- Use TTG to enforce totality
- Remove enumeration in Heap/Inspect; the 'otherwise' clause
serves the primitive types well.
- - - - -
22bb8998 by Alan Zimmerman at 2023-01-05T10:49:09-05:00
EPA: Do not collect comments from end of file
In Parser.y semis1 production triggers for the virtual semi at the end
of the file. This is detected by it being zero length.
In this case, do not extend the span being used to gather comments, so
any final comments are allocated at the module level instead.
- - - - -
9e077999 by Vladislav Zavialov at 2023-01-05T23:01:55-05:00
HsToken in TypeArg (#19623)
Updates the haddock submodule.
- - - - -
b2a2db04 by Matthew Pickering at 2023-01-05T23:02:30-05:00
Revert "configure: Drop uses of AC_PROG_CC_C99"
This reverts commit 7c6de18dd3151ead954c210336728e8686c91de6.
Centos7 using a very old version of the toolchain (autotools-2.69) where
the behaviour of these macros has not yet changed. I am reverting this
without haste as it is blocking the 9.6 branch.
Fixes #22704
- - - - -
28f8c0eb by Luite Stegeman at 2023-01-06T18:16:24+09:00
Add support for sized literals in the bytecode interpreter.
The bytecode interpreter only has branching instructions for
word-sized values. These are used for pattern matching.
Branching instructions for other types (e.g. Int16# or Word8#)
weren't needed, since unoptimized Core or STG never requires
branching on types like this.
It's now possible for optimized STG to reach the bytecode
generator (e.g. fat interface files or certain compiler flag
combinations), which requires dealing with various sized
literals in branches.
This patch improves support for generating bytecode from
optimized STG by adding the following new bytecode
instructions:
TESTLT_I64
TESTEQ_I64
TESTLT_I32
TESTEQ_I32
TESTLT_I16
TESTEQ_I16
TESTLT_I8
TESTEQ_I8
TESTLT_W64
TESTEQ_W64
TESTLT_W32
TESTEQ_W32
TESTLT_W16
TESTEQ_W16
TESTLT_W8
TESTEQ_W8
Fixes #21945
- - - - -
ac39e8e9 by Matthew Pickering at 2023-01-06T13:47:00-05:00
Only store Name in FunRhs rather than Id with knot-tied fields
All the issues here have been caused by #18758.
The goal of the ticket is to be able to talk about things like
`LTyClDecl GhcTc`. In the case of HsMatchContext,
the correct "context" is whatever we want, and in fact storing just a
`Name` is sufficient and correct context, even if the rest of the AST is
storing typechecker Ids.
So this reverts (#20415, !5579) which intended to get closed to #18758 but
didn't really and introduced a few subtle bugs.
Printing of an error message in #22695 would just hang, because we would
attempt to print the `Id` in debug mode to assertain whether it was
empty or not. Printing the Name is fine for the error message.
Another consequence is that when `-dppr-debug` was enabled the compiler would
hang because the debug printing of the Id would try and print fields
which were not populated yet.
This also led to 32070e6c2e1b4b7c32530a9566fe14543791f9a6 having to add
a workaround for the `checkArgs` function which was probably a very
similar bug to #22695.
Fixes #22695
- - - - -
c306d939 by Matthew Pickering at 2023-01-06T22:08:53-05:00
ci: Upgrade darwin, windows and freebsd CI to use GHC-9.4.3
Fixes #22599
- - - - -
0db496ff by Matthew Pickering at 2023-01-06T22:08:53-05:00
darwin ci: Explicitly pass desired build triple to configure
On the zw3rk machines for some reason the build machine was inferred to
be arm64. Setting the build triple appropiately resolve this confusion
and we produce x86 binaries.
- - - - -
2459c358 by Ben Gamari at 2023-01-06T22:09:29-05:00
rts: MUT_VAR is not a StgMutArrPtrs
There was previously a comment claiming that the MUT_VAR closure type
had the layout of StgMutArrPtrs.
- - - - -
6206cb92 by Simon Peyton Jones at 2023-01-07T12:14:40-05:00
Make FloatIn robust to shadowing
This MR fixes #22622. See the new
Note [Shadowing and name capture]
I did a bit of refactoring in sepBindsByDropPoint too.
The bug doesn't manifest in HEAD, but it did show up in 9.4,
so we should backport this patch to 9.4
- - - - -
a960ca81 by Matthew Pickering at 2023-01-07T12:15:15-05:00
T10955: Set DYLD_LIBRARY_PATH for darwin
The correct path to direct the dynamic linker on darwin is
DYLD_LIBRARY_PATH rather than LD_LIBRARY_PATH. On recent versions of OSX
using LD_LIBRARY_PATH seems to have stopped working.
For more reading see:
https://stackoverflow.com/questions/3146274/is-it-ok-to-use-dyld-library-path-on-mac-os-x-and-whats-the-dynamic-library-s
- - - - -
73484710 by Matthew Pickering at 2023-01-07T12:15:15-05:00
Skip T18623 on darwin (to add to the long list of OSs)
On recent versions of OSX, running `ulimit -v` results in
```
ulimit: setrlimit failed: invalid argument
```
Time is too short to work out what random stuff Apple has been doing
with ulimit, so just skip the test like we do for other platforms.
- - - - -
8c0ea25f by Matthew Pickering at 2023-01-07T12:15:15-05:00
Pass -Wl,-no_fixup_chains to ld64 when appropiate
Recent versions of MacOS use a version of ld where `-fixup_chains` is on by default.
This is incompatible with our usage of `-undefined dynamic_lookup`. Therefore we
explicitly disable `fixup-chains` by passing `-no_fixup_chains` to the linker on
darwin. This results in a warning of the form:
ld: warning: -undefined dynamic_lookup may not work with chained fixups
The manual explains the incompatible nature of these two flags:
-undefined treatment
Specifies how undefined symbols are to be treated. Options are: error, warning,
suppress, or dynamic_lookup. The default is error. Note: dynamic_lookup that
depends on lazy binding will not work with chained fixups.
A relevant ticket is #22429
Here are also a few other links which are relevant to the issue:
Official comment: https://developer.apple.com/forums/thread/719961
More relevant links:
https://openradar.appspot.com/radar?id=5536824084660224
https://github.com/python/cpython/issues/97524
Note in release notes: https://developer.apple.com/documentation/xcode-release-notes/xcode-13-releas e-notes
- - - - -
365b3045 by Matthew Pickering at 2023-01-09T02:36:20-05:00
Disable split sections on aarch64-deb10 build
See #22722
Failure on this job:
https://gitlab.haskell.org/ghc/ghc/-/jobs/1287852
```
Unexpected failures:
/builds/ghc/ghc/tmp/ghctest-s3d8g1hj/test spaces/testsuite/tests/th/T10828.run T10828 [exit code non-0] (ext-interp)
/builds/ghc/ghc/tmp/ghctest-s3d8g1hj/test spaces/testsuite/tests/th/T13123.run T13123 [exit code non-0] (ext-interp)
/builds/ghc/ghc/tmp/ghctest-s3d8g1hj/test spaces/testsuite/tests/th/T20590.run T20590 [exit code non-0] (ext-interp)
Appending 232 stats to file: /builds/ghc/ghc/performance-metrics.tsv
```
```
Compile failed (exit code 1) errors were:
data family D_0 a_1 :: * -> *
data instance D_0 GHC.Types.Int GHC.Types.Bool :: * where
DInt_2 :: D_0 GHC.Types.Int GHC.Types.Bool
data E_3 where MkE_4 :: a_5 -> E_3
data Foo_6 a_7 b_8 where
MkFoo_9, MkFoo'_10 :: a_11 -> Foo_6 a_11 b_12
newtype Bar_13 :: * -> GHC.Types.Bool -> * where
MkBar_14 :: a_15 -> Bar_13 a_15 b_16
data T10828.T (a_0 :: *) where
T10828.MkT :: forall (a_1 :: *) . a_1 -> a_1 -> T10828.T a_1
T10828.MkC :: forall (a_2 :: *) (b_3 :: *) . (GHC.Types.~) a_2
GHC.Types.Int => {T10828.foo :: a_2,
T10828.bar :: b_3} -> T10828.T GHC.Types.Int
T10828.hs:1:1: error: [GHC-87897]
Exception when trying to run compile-time code:
ghc-iserv terminated (-4)
Code: (do TyConI dec <- runQ $ reify (mkName "T")
runIO $ putStrLn (pprint dec) >> hFlush stdout
d <- runQ
$ [d| data T' a :: Type
where
MkT' :: a -> a -> T' a
MkC' :: forall a b. (a ~ Int) => {foo :: a, bar :: b} -> T' Int |]
runIO $ putStrLn (pprint d) >> hFlush stdout
....)
*** unexpected failure for T10828(ext-interp)
=====> 7000 of 9215 [0, 1, 0]
=====> 7000 of 9215 [0, 1, 0]
=====> 7000 of 9215 [0, 1, 0]
=====> 7000 of 9215 [0, 1, 0]
Compile failed (exit code 1) errors were:
T13123.hs:1:1: error: [GHC-87897]
Exception when trying to run compile-time code:
ghc-iserv terminated (-4)
Code: ([d| data GADT
where MkGADT :: forall k proxy (a :: k). proxy a -> GADT |])
*** unexpected failure for T13123(ext-interp)
=====> 7100 of 9215 [0, 2, 0]
=====> 7100 of 9215 [0, 2, 0]
=====> 7200 of 9215 [0, 2, 0]
Compile failed (exit code 1) errors were:
T20590.hs:1:1: error: [GHC-87897]
Exception when trying to run compile-time code:
ghc-iserv terminated (-4)
Code: ([d| data T where MkT :: forall a. a -> T |])
*** unexpected failure for T20590(ext-interp)
```
Looks fairly worrying to me.
- - - - -
965a2735 by Alan Zimmerman at 2023-01-09T02:36:20-05:00
EPA: exact print HsDocTy
To match ghc-exactprint
https://github.com/alanz/ghc-exactprint/pull/121
- - - - -
5d65773e by John Ericson at 2023-01-09T20:39:27-05:00
Remove RTS hack for configuring
See the brand new Note [Undefined symbols in the RTS] for additional
details.
- - - - -
e3fff751 by Sebastian Graf at 2023-01-09T20:40:02-05:00
Handle shadowing in DmdAnal (#22718)
Previously, when we had a shadowing situation like
```hs
f x = ... -- demand signature <1L><1L>
main = ... \f -> f 1 ...
```
we'd happily use the shadowed demand signature at the call site inside the
lambda. Of course, that's wrong and solution is simply to remove the demand
signature from the `AnalEnv` when we enter the lambda.
This patch does so for all binding constructs Core.
In #22718 the issue was caused by LetUp not shadowing away the existing demand
signature for the let binder in the let body. The resulting absent error is
fickle to reproduce; hence no reproduction test case. #17478 would help.
Fixes #22718.
It appears that TcPlugin_Rewrite regresses by ~40% on Darwin. It is likely that
DmdAnal was exploiting ill-scoped analysis results.
Metric increase ['bytes allocated'] (test_env=x86_64-darwin-validate):
TcPlugin_Rewrite
- - - - -
d53f6f4d by Oleg Grenrus at 2023-01-09T21:11:02-05:00
Add safe list indexing operator: !?
With Joachim's amendments.
Implements https://github.com/haskell/core-libraries-committee/issues/110
- - - - -
cfaf1ad7 by Nicolas Trangez at 2023-01-09T21:11:03-05:00
rts, tests: limit thread name length to 15 bytes
On Linux, `pthread_setname_np` (or rather, the kernel) only allows for
thread names up to 16 bytes, including the terminating null byte.
This commit adds a note pointing this out in `createOSThread`, and fixes
up two instances where a thread name of more than 15 characters long was
used (in the RTS, and in a test-case).
Fixes: #22366
Fixes: https://gitlab.haskell.org/ghc/ghc/-/issues/22366
See: https://gitlab.haskell.org/ghc/ghc/-/issues/22366#note_460796
- - - - -
64286132 by Matthew Pickering at 2023-01-09T21:11:03-05:00
Store bootstrap_llvm_target and use it to set LlvmTarget in bindists
This mirrors some existing logic for the bootstrap_target which
influences how TargetPlatform is set.
As described on #21970 not storing this led to `LlvmTarget` being set incorrectly
and hence the wrong `--target` flag being passed to the C compiler.
Towards #21970
- - - - -
4724e8d1 by Matthew Pickering at 2023-01-09T21:11:04-05:00
Check for FP_LD_NO_FIXUP_CHAINS in installation configure script
Otherwise, when installing from a bindist the C flag isn't passed to the
C compiler.
This completes the fix for #22429
- - - - -
2e926b88 by Georgi Lyubenov at 2023-01-09T21:11:07-05:00
Fix outdated link to Happy section on sequences
- - - - -
146a1458 by Matthew Pickering at 2023-01-09T21:11:07-05:00
Revert "NCG(x86): Compile add+shift as lea if possible."
This reverts commit 20457d775885d6c3df020d204da9a7acfb3c2e5a.
See #22666 and #21777
- - - - -
6e6adbe3 by Jade Lovelace at 2023-01-11T00:55:30-05:00
Fix tcPluginRewrite example
- - - - -
faa57138 by Jade Lovelace at 2023-01-11T00:55:31-05:00
fix missing haddock pipe
- - - - -
0470ea7c by Florian Weimer at 2023-01-11T00:56:10-05:00
m4/fp_leading_underscore.m4: Avoid implicit exit function declaration
And switch to a new-style function definition.
Fixes build issues with compilers that do not accept implicit function
declarations.
- - - - -
b2857df4 by HaskellMouse at 2023-01-11T00:56:52-05:00
Added a new warning about compatibility with RequiredTypeArguments
This commit introduces a new warning
that indicates code incompatible with
future extension: RequiredTypeArguments.
Enabling this extension may break some code and the warning
will help to make it compatible in advance.
- - - - -
5f17e21a by Ben Gamari at 2023-01-11T00:57:27-05:00
testsuite: Drop testheapalloced.c
As noted in #22414, this file (which appears to be a benchmark for
characterising the one-step allocator's MBlock cache) is currently
unreferenced. Remove it.
Closes #22414.
- - - - -
bc125775 by Vladislav Zavialov at 2023-01-11T00:58:03-05:00
Introduce the TypeAbstractions language flag
GHC Proposals #448 "Modern scoped type variables"
and #425 "Invisible binders in type declarations"
introduce a new language extension flag: TypeAbstractions.
Part of the functionality guarded by this flag has already been
implemented, namely type abstractions in constructor patterns, but it
was guarded by a combination of TypeApplications and ScopedTypeVariables
instead of a dedicated language extension flag.
This patch does the following:
* introduces a new language extension flag TypeAbstractions
* requires TypeAbstractions for @a-syntax in constructor patterns
instead of TypeApplications and ScopedTypeVariables
* creates a User's Guide page for TypeAbstractions and
moves the "Type Applications in Patterns" section there
To avoid a breaking change, the new flag is implied by
ScopedTypeVariables and is retroactively added to GHC2021.
Metric Decrease:
MultiLayerModulesTH_OneShot
- - - - -
083f7015 by Krzysztof Gogolewski at 2023-01-11T00:58:38-05:00
Misc cleanup
- 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
- - - - -
aed1974e by Richard Eisenberg at 2023-01-11T08:30:42+00:00
Refactor the treatment of loopy superclass dicts
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.
- - - - -
300bcc15 by HaskellMouse at 2023-01-11T13:43:36-05:00
Parse qualified terms in type signatures
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
- - - - -
964284fc by Simon Peyton Jones at 2023-01-11T13:44:12-05:00
Fix void-arg-adding mechanism for worker/wrapper
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.
- - - - -
f7ceafc9 by Krzysztof Gogolewski at 2023-01-11T22:36:59-05:00
Add 'docWithStyle' to improve codegen
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
- - - - -
b3be0d18 by Simon Peyton Jones at 2023-01-11T22:37:35-05:00
Fix finaliseArgBoxities for OPAQUE function
We never do worker wrapper for OPAQUE functions, so we must
zap the unboxing info during strictness analysis.
This patch fixes #22502
- - - - -
db11f358 by Ben Gamari at 2023-01-12T07:49:04-05:00
Revert "rts: Drop racy assertion"
The logic here was inverted. Reverting the commit to avoid confusion
when examining the commit history.
This reverts commit b3eacd64fb36724ed6c5d2d24a81211a161abef1.
- - - - -
3242139f by Ben Gamari at 2023-01-12T07:49:04-05:00
rts: Drop racy assertion
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.
- - - - -
9ffd5d57 by Ben Gamari at 2023-01-12T07:49:41-05:00
configure: Fix escaping of `$tooldir`
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.
- - - - -
905d0b6e by Sebastian Graf at 2023-01-12T15:51:47-05:00
Fix contification with stable unfoldings (#22428)
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
- - - - -
a1491c87 by Andreas Klebinger at 2023-01-12T15:52:23-05:00
Only gc sparks locally when we can ensure marking is done.
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.
- - - - -
8acfe930 by Cheng Shao at 2023-01-12T15:53:00-05:00
Change MSYSTEM to CLANG64 uniformly
- - - - -
73bc162b by M Farkas-Dyck at 2023-01-12T15:53:42-05:00
Make `GHC.Tc.Errors.Reporter` take `NonEmpty ErrorItem` rather than `[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.
- - - - -
1b812b69 by Oleg Grenrus at 2023-01-12T15:54:21-05:00
Fix #22728: Not all diagnostics in safe check are fatal
Also add tests for the issue and -Winferred-safe-imports in general
- - - - -
c79b2b65 by Matthew Pickering at 2023-01-12T15:54:58-05:00
Don't run hadrian-multi on fast-ci label
Fixes #22667
- - - - -
9a3d6add by Bodigrim at 2023-01-13T00:46:36-05:00
Bump submodule bytestring to 0.11.4.0
Metric Decrease:
T21839c
T21839r
- - - - -
df33c13c by Ben Gamari at 2023-01-13T00:47:12-05:00
gitlab-ci: Bump Darwin bootstrap toolchain
This updates the bootstrap compiler on Darwin from 8.10.7 to 9.2.5,
ensuring that we have the fix for #21964.
- - - - -
756a66ec by Ben Gamari at 2023-01-13T00:47:12-05:00
gitlab-ci: Pass -w to cabal update
Due to cabal#8447, cabal-install 3.8.1.0 requires a compiler to run
`cabal update`.
- - - - -
1142f858 by Cheng Shao at 2023-01-13T11:04:00+00:00
Bump hsc2hs submodule
- - - - -
d4686729 by Cheng Shao at 2023-01-13T11:04:00+00:00
Bump process submodule
- - - - -
84ae6573 by Cheng Shao at 2023-01-13T11:06:58+00:00
ci: Bump DOCKER_REV
- - - - -
d53598c5 by Cheng Shao at 2023-01-13T11:06:58+00:00
ci: enable xz parallel compression for x64 jobs
- - - - -
d31fcbca by Cheng Shao at 2023-01-13T11:06:58+00:00
ci: use in-image emsdk for js jobs
- - - - -
93b9bbc1 by Cheng Shao at 2023-01-13T11:47:17+00:00
ci: improve nix-shell for gen_ci.hs and fix some ghc/hlint warnings
- 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.
- - - - -
8acc56c7 by Cheng Shao at 2023-01-13T11:47:17+00:00
ci: source the toolchain env file in wasm jobs
- - - - -
87194df0 by Cheng Shao at 2023-01-13T11:47:17+00:00
ci: add wasm ci jobs via gen_ci.hs
- 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.
- - - - -
b6eb9bcc by Matthew Pickering at 2023-01-13T11:52:16+00:00
wasm ci: Remove wasm release jobs
This removes the wasm release jobs, as we do not yet intend to
distribute these binaries.
- - - - -
496607fd by Simon Peyton Jones at 2023-01-13T16:52:07-05:00
Add a missing checkEscapingKind
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.
- - - - -
7a9a1042 by Andreas Klebinger at 2023-01-16T20:48:19-05:00
Separate core inlining logic from `Unfolding` type.
This seems like a good idea either way, but is mostly motivated by a
patch where this avoids a module loop.
- - - - -
33b58f77 by sheaf at 2023-01-16T20:48:57-05:00
Hadrian: generalise &%> to avoid warnings
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
- - - - -
8c7a991c by Andreas Klebinger at 2023-01-16T20:49:34-05:00
Add regression test for #22611.
A case were a function used to fail to specialize, but now does.
- - - - -
6abea760 by Andreas Klebinger at 2023-01-16T20:50:10-05:00
Mark maximumBy/minimumBy as INLINE.
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
- - - - -
99d151bb by Matthew Pickering at 2023-01-16T20:50:50-05:00
ci: Bump CACHE_REV so that ghc-9.6 branch and HEAD have different caches
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.
- - - - -
6a5845fb by Matthew Pickering at 2023-01-16T20:51:25-05:00
ci: Change owner of files in source-tarball job
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
```
- - - - -
4afb952c by Matthew Pickering at 2023-01-16T20:51:25-05:00
ci: Don't build aarch64-deb10-llvm job on release pipelines
Closes #22721
- - - - -
8039feb9 by Matthew Pickering at 2023-01-16T20:51:25-05:00
ci: Change owner of files in test-bootstrap job
- - - - -
0b358d0c by Matthew Pickering at 2023-01-16T20:51:25-05:00
rel_eng: Add release engineering scripts into ghc tree
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.
- - - - -
28cb2ed0 by Matthew Pickering at 2023-01-16T20:51:25-05:00
ci: Don't use complicated image or clone in not-interruptible job
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.
- - - - -
eeea59bb by Matthew Pickering at 2023-01-16T20:51:26-05:00
Add scripts to generate ghcup metadata on nightly and release pipelines
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.
- - - - -
97bd4d8c by Bodigrim at 2023-01-16T20:52:04-05:00
Bump submodule parsec to 3.1.16.1
- - - - -
97ac8230 by Alan Zimmerman at 2023-01-16T20:52:39-05:00
EPA: Add annotation for 'type' in DataDecl
Closes #22765
- - - - -
dbbab95d by Ben Gamari at 2023-01-17T06:36:06-05:00
compiler: Small optimisation of assertM
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.
- - - - -
fc02f3bb by Viktor Dukhovni at 2023-01-17T06:36:47-05:00
Avoid unnecessary printf warnings in EventLog.c
Fixes #22778
- - - - -
003b6d44 by Simon Peyton Jones at 2023-01-17T16:33:05-05:00
Document the semantics of pattern bindings a bit better
This MR is in response to the discussion on #22719
- - - - -
f4d50baf by Vladislav Zavialov at 2023-01-17T16:33:41-05:00
Hadrian: fix warnings (#22783)
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]
- - - - -
06036d93 by Sylvain Henry at 2023-01-18T01:55:10-05:00
testsuite: req_smp --> req_target_smp, req_ghc_smp
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
- - - - -
ee9b78aa by Krzysztof Gogolewski at 2023-01-18T01:55:45-05:00
Use -Wdefault when running Python testdriver (#22727)
- - - - -
e9c0537c by Vladislav Zavialov at 2023-01-18T01:56:22-05:00
Enable -Wstar-is-type by default (#22759)
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.
- - - - -
4efee43d by Ryan Scott at 2023-01-18T01:56:59-05:00
Add missing parenthesizeHsType in cvtSigTypeKind
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.
- - - - -
f891a442 by Ben Gamari at 2023-01-18T07:28:00-05:00
Bump ghc-tarballs to fix #22497
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.
- - - - -
b13c6ea5 by Ben Gamari at 2023-01-18T07:28:00-05:00
Bump gmp-tarballs submodule
This backports the upstream fix for CVE-2021-43618, fixing #22789.
- - - - -
c45a5fff by Cheng Shao at 2023-01-18T07:28:37-05:00
Fix typo in recent darwin tests fix
Corrects a typo in !9647. Otherwise T18623 will still fail on darwin
and stall other people's work.
- - - - -
b4c14c4b by Luite Stegeman at 2023-01-18T14:21:42-05:00
Add PrimCallConv support to GHCi
This adds support for calling Cmm code from bytecode using the native
calling convention, allowing modules that use `foreign import prim`
to be loaded and debugged in GHCi.
This patch introduces a new `PRIMCALL` bytecode instruction and
a helper stack frame `stg_primcall`. The code is based on the
existing functionality for dealing with unboxed tuples in bytecode,
which has been generalised to handle arbitrary calls.
Fixes #22051
- - - - -
d0a63ef8 by Adam Gundry at 2023-01-18T14:22:26-05:00
Refactor warning flag parsing to add missing flags
This adds `-Werror=<group>` and `-fwarn-<group>` flags for warning
groups as well as individual warnings. Previously these were defined
on an ad hoc basis so for example we had `-Werror=compat` but not
`-Werror=unused-binds`, whereas we had `-fwarn-unused-binds` but not
`-fwarn-compat`. Fixes #22182.
- - - - -
7ed1b8ef by Adam Gundry at 2023-01-18T14:22:26-05:00
Minor corrections to comments
- - - - -
5389681e by Adam Gundry at 2023-01-18T14:22:26-05:00
Revise warnings documentation in user's guide
- - - - -
ab0d5cda by Adam Gundry at 2023-01-18T14:22:26-05:00
Move documentation of deferred type error flags out of warnings section
- - - - -
eb5a6b91 by John Ericson at 2023-01-18T22:24:10-05:00
Give the RTS it's own configure script
Currently it doesn't do much anything, we are just trying to introduce
it without breaking the build. Later, we will move functionality from
the top-level configure script over to it.
We need to bump Cabal for https://github.com/haskell/cabal/pull/8649; to
facilitate and existing hack of skipping some configure checks for the
RTS we now need to skip just *part* not *all* of the "post configure"
hook, as running the configure script (which we definitely want to do)
is also implemented as part of the "post configure" hook. But doing this
requires exposing functionality that wasn't exposed before.
- - - - -
32ab07bf by Bodigrim at 2023-01-18T22:24:51-05:00
ghc package does not have to depend on terminfo
- - - - -
981ff7c4 by Bodigrim at 2023-01-18T22:24:51-05:00
ghc-pkg does not have to depend on terminfo
- - - - -
f058e367 by Ben Gamari at 2023-01-18T22:25:27-05:00
nativeGen/X86: MFENCE is unnecessary for release semantics
In #22764 a user noticed that a program implementing a simple atomic
counter via an STRef regressed significantly due to the introduction of
necessary atomic operations in the MutVar# primops (#22468). This
regression was caused by a bug in the NCG, which emitted an unnecessary
MFENCE instruction for a release-ordered atomic write. MFENCE is rather
only needed to achieve sequentially consistent ordering.
Fixes #22764.
- - - - -
154889db by Ryan Scott at 2023-01-18T22:26:03-05:00
Add regression test for #22151
Issue #22151 was coincidentally fixed in commit
aed1974e92366ab8e117734f308505684f70cddf (`Refactor the treatment of loopy
superclass dicts`). This adds a regression test to ensure that the issue
remains fixed.
Fixes #22151.
- - - - -
14b5982a by Andrei Borzenkov at 2023-01-18T22:26:43-05:00
Fix printing of promoted MkSolo datacon (#22785)
Problem: In 2463df2f, the Solo data constructor was renamed to MkSolo,
and Solo was turned into a pattern synonym for backwards compatibility.
Since pattern synonyms can not be promoted, the old code that pretty-printed
promoted single-element tuples started producing ill-typed code:
t :: Proxy ('Solo Int)
This fails with "Pattern synonym ‘Solo’ used as a type"
The solution is to track the distinction between type constructors and data
constructors more carefully when printing single-element tuples.
- - - - -
1fe806d3 by Cheng Shao at 2023-01-23T04:48:47-05:00
hadrian: add hi_core flavour transformer
The hi_core flavour transformer enables -fwrite-if-simplified-core for
stage1 libraries, which emit core into interface files to make it
possible to restart code generation. Building boot libs with it makes
it easier to use GHC API to prototype experimental backends that needs
core/stg at link time.
- - - - -
317cad26 by Cheng Shao at 2023-01-23T04:48:47-05:00
hadrian: add missing docs for recently added flavour transformers
- - - - -
658f4446 by Ben Gamari at 2023-01-23T04:49:23-05:00
gitlab-ci: Add Rocky8 jobs
Addresses #22268.
- - - - -
a83ec778 by Vladislav Zavialov at 2023-01-23T04:49:58-05:00
Set "since: 9.8" for TypeAbstractions and -Wterm-variable-capture
These flags did not make it into the 9.6 release series,
so the "since" annotations must be corrected.
- - - - -
fec7c2ea by Alan Zimmerman at 2023-01-23T04:50:33-05:00
EPA: Add SourceText to HsOverLabel
To be able to capture string literals with possible escape codes as labels.
Close #22771
- - - - -
3efd1e99 by Ben Gamari at 2023-01-23T04:51:08-05:00
template-haskell: Bump version to 2.20.0.0
Updates `text` and `exceptions` submodules for bounds bumps.
Addresses #22767.
- - - - -
0900b584 by Cheng Shao at 2023-01-23T04:51:45-05:00
hadrian: disable alloca for in-tree GMP on wasm32
When building in-tree GMP for wasm32, disable its alloca usage, since
it may potentially cause stack overflow (e.g. #22602).
- - - - -
db0f1bfd by Cheng Shao at 2023-01-23T04:52:21-05:00
Bump process submodule
Includes a critical fix for wasm32, see
https://github.com/haskell/process/pull/272 for details. Also changes
the existing cross test to include process stuff and avoid future
regression here.
- - - - -
9222b167 by Matthew Pickering at 2023-01-23T04:52:57-05:00
ghcup metadata: Fix subdir for windows bindist
- - - - -
9a9bec57 by Matthew Pickering at 2023-01-23T04:52:57-05:00
ghcup metadata: Remove viPostRemove field from generated metadata
This has been removed from the downstream metadata.
- - - - -
82884ce0 by Simon Peyton Jones at 2023-01-23T04:53:32-05:00
Fix #22742
runtimeRepLevity_maybe was panicing unnecessarily; and
the error printing code made use of the case when it should
return Nothing rather than panicing.
For some bizarre reason perf/compiler/T21839r shows a 10% bump in runtime
peak-megagbytes-used, on a single architecture (alpine). See !9753 for
commentary, but I'm going to accept it.
Metric Increase:
T21839r
- - - - -
2c6deb18 by Bryan Richter at 2023-01-23T14:12:22+02:00
codeowners: Add Ben, Matt, and Bryan to CI
- - - - -
eee3bf05 by Matthew Craven at 2023-01-23T21:46:41-05:00
Do not collect compile-time metrics for T21839r
...the testsuite doesn't handle this properly since it
also collects run-time metrics. Compile-time metrics
for this test are already tracked via T21839c.
Metric Decrease:
T21839r
- - - - -
1d1dd3fb by Matthew Pickering at 2023-01-24T05:37:52-05:00
Fix recompilation checking for multiple home units
The key part of this change is to store a UnitId in the
`UsageHomeModule` and `UsageHomeModuleInterface`.
* Fine-grained dependency tracking is used if the dependency comes from
any home unit.
* We actually look up the right module when checking whether we need to
recompile in the `UsageHomeModuleInterface` case.
These scenarios are both checked by the new tests (
multipleHomeUnits_recomp and multipleHomeUnits_recomp_th )
Fixes #22675
- - - - -
7bfb30f9 by Matthew Pickering at 2023-01-24T05:37:52-05:00
Augment target filepath by working directory when checking if module satisfies target
This fixes a spurious warning in -Wmissing-home-modules.
This is a simple oversight where when looking for the target in the
first place we augment the search by the -working-directory flag but
then fail to do so when checking this warning.
Fixes #22676
- - - - -
69500dd4 by Matthew Pickering at 2023-01-24T05:37:52-05:00
Use NodeKey rather than ModuleName in pruneCache
The `pruneCache` function assumes that the list of `CachedInfo` all have unique `ModuleName`, this is not true:
* In normal compilation, the same module name can appear for a file and it's boot file.
* In multiple home unit compilation the same ModuleName can appear in different units
The fix is to use a `NodeKey` as the actual key for the interfaces which includes `ModuleName`, `IsBoot` and `UnitId`.
Fixes #22677
- - - - -
336b2b1c by Matthew Pickering at 2023-01-24T05:37:52-05:00
Recompilation checking: Don't try to find artefacts for Interactive & hs-boot combo
In interactive mode we don't produce any linkables for hs-boot files. So
we also need to not going looking for them when we check to see if we
have all the right objects needed for recompilation.
Ticket #22669
- - - - -
6469fea7 by Matthew Pickering at 2023-01-24T05:37:52-05:00
Don't write o-boot files in Interactive mode
We should not be producing object files when in interactive mode but we
still produced the dummy o-boot files. These never made it into a
`Linkable` but then confused the recompilation checker.
Fixes #22669
- - - - -
06cc0a95 by Matthew Pickering at 2023-01-24T05:37:52-05:00
Improve driver diagnostic messages by including UnitId in message
Currently the driver diagnostics don't give any indication about which unit they correspond to.
For example `-Wmissing-home-modules` can fire multiple times for each different home unit and gives no indication about which unit it's actually reporting about.
Perhaps a longer term fix is to generalise the providence information away from a SrcSpan so that these kind of whole project errors can be reported with an accurate provenance. For now we can just include the `UnitId` in the error message.
Fixes #22678
- - - - -
4fe9eaff by Matthew Pickering at 2023-01-24T05:37:52-05:00
Key ModSummary cache by UnitId as well as FilePath
Multiple units can refer to the same files without any problem. Just
another assumption which needs to be updated when we may have multiple
home units.
However, there is the invariant that within each unit each file only
maps to one module, so as long as we also key the cache by UnitId then
we are all good.
This led to some confusing behaviour in GHCi when reloading,
multipleHomeUnits_shared distils the essence of what can go wrong.
Fixes #22679
- - - - -
ada29f5c by Matthew Pickering at 2023-01-24T05:37:52-05:00
Finder: Look in current unit before looking in any home package dependencies
In order to preserve existing behaviour it's important to look within the current component before consideirng a module might come from an external component.
This already happened by accident in `downsweep`, (because roots are used to repopulated the cache) but in the `Finder` the logic was the wrong way around.
Fixes #22680
-------------------------
Metric Decrease:
MultiComponentModules
MultiComponentModulesRecomp
-------------------------p
- - - - -
be701cc6 by Matthew Pickering at 2023-01-24T05:37:52-05:00
Debug: Print full NodeKey when pretty printing ModuleGraphNode
This is helpful when debugging multiple component issues.
- - - - -
34d2d463 by Krzysztof Gogolewski at 2023-01-24T05:38:32-05:00
Fix Lint check for duplicate external names
Lint was checking for duplicate external names by calling removeDups,
which needs a comparison function that is passed to Data.List.sortBy.
But the comparison was not a valid ordering - it returned LT
if one of the names was not external.
For example, the previous implementation won't find a duplicate in
[M.x, y, M.x].
Instead, we filter out non-external names before looking for duplicates.
- - - - -
1c050ed2 by Matthew Pickering at 2023-01-24T05:39:08-05:00
Add test for T22671
This was fixed by b13c6ea5
Closes #22671
- - - - -
05e6a2d9 by Tom Ellis at 2023-01-24T12:10:52-05:00
Clarify where `f` is defined
- - - - -
d151546e by Cheng Shao at 2023-01-24T12:11:29-05:00
CmmToC: fix CmmRegOff for 64-bit register on a 32-bit target
We used to print the offset value to a platform word sized integer.
This is incorrect when the offset is negative (e.g. output of cmm
constant folding) and the register is 64-bit but on a 32-bit target,
and may lead to incorrect runtime result (e.g. #22607).
The fix is simple: just treat it as a proper MO_Add, with the correct
width info inferred from the register itself.
Metric Increase:
T12707
T13379
T4801
T5321FD
T5321Fun
- - - - -
e5383a29 by Wander Hillen at 2023-01-24T20:02:26-05:00
Allow waiting for timerfd to be interrupted during rts shutdown
- - - - -
1957eda1 by Ryan Scott at 2023-01-24T20:03:01-05:00
Restore Compose's Read/Show behavior to match Read1/Show1 instances
Fixes #22816.
- - - - -
30972827 by Matthew Pickering at 2023-01-25T03:54:14-05:00
docs: Update INSTALL.md
Removes references to make.
Fixes #22480
- - - - -
bc038c3b by Cheng Shao at 2023-01-25T03:54:50-05:00
compiler: fix handling of MO_F_Neg in wasm NCG
In the wasm NCG, we used to compile MO_F_Neg to 0.0-x. It was an
oversight, there actually exists f32.neg/f64.neg opcodes in the wasm
spec and those should be used instead! The old behavior almost works,
expect when GHC compiles the -0.0 literal, which will incorrectly
become 0.0.
- - - - -
e987e345 by Sylvain Henry at 2023-01-25T14:47:41-05:00
Hadrian: correctly detect AR at-file support
Stage0's ar may not support at-files. Take it into account.
Found while cross-compiling from Darwin to Windows.
- - - - -
48131ee2 by Sylvain Henry at 2023-01-25T14:47:41-05:00
Hadrian: fix Windows cross-compilation
Decision to build either unix or Win32 package must be stage specific
for cross-compilation to be supported.
- - - - -
288fa017 by Sylvain Henry at 2023-01-25T14:47:41-05:00
Fix RTS build on Windows
This change fixes a cross-compilation issue from ArchLinux to Windows
because these symbols weren't found.
- - - - -
2fdf22ae by Sylvain Henry at 2023-01-25T14:47:41-05:00
configure: support "windows" as an OS
- - - - -
13a0566b by Simon Peyton Jones at 2023-01-25T14:48:16-05:00
Fix in-scope set in specImports
Nothing deep here; I had failed to bring some
floated dictionary binders into scope.
Exposed by -fspecialise-aggressively
Fixes #22715.
- - - - -
b7efdb24 by Matthew Pickering at 2023-01-25T14:48:51-05:00
ci: Disable HLint job due to excessive runtime
The HLint jobs takes much longer to run (20 minutes) after "Give the RTS it's own configure script" eb5a6b91
Now the CI job will build the stage0 compiler before it generates the necessary RTS headers.
We either need to:
* Fix the linting rules so they take much less time
* Revert the commit
* Remove the linting of base from the hlint job
* Remove the hlint job
This is highest priority as it is affecting all CI pipelines.
For now I am just disabling the job because there are many more pressing
matters at hand.
Ticket #22830
- - - - -
1bd32a35 by Sylvain Henry at 2023-01-26T12:34:21-05:00
Factorize hptModulesBelow
Create and use moduleGraphModulesBelow in GHC.Unit.Module.Graph that
doesn't need anything from the driver to be used.
- - - - -
1262d3f8 by Matthew Pickering at 2023-01-26T12:34:56-05:00
Store dehydrated data structures in CgModBreaks
This fixes a tricky leak in GHCi where we were retaining old copies of
HscEnvs when reloading. If not all modules were recompiled then these
hydrated fields in break points would retain a reference to the old
HscEnv which could double memory usage.
Fixes #22530
- - - - -
e27eb80c by Matthew Pickering at 2023-01-26T12:34:56-05:00
Force more in NFData Name instance
Doesn't force the lazy `OccName` field (#19619) which is already known
as a really bad source of leaks.
When we slam the hammer storing Names on disk (in interface files or the
like), all this should be forced as otherwise a `Name` can easily retain
an `Id` and hence the entire world.
Fixes #22833
- - - - -
3d004d5a by Matthew Pickering at 2023-01-26T12:34:56-05:00
Force OccName in tidyTopName
This occname has just been derived from an `Id`, so need to force it
promptly so we can release the Id back to the world.
Another symptom of the bug caused by #19619
- - - - -
f2a0fea0 by Matthew Pickering at 2023-01-26T12:34:56-05:00
Strict fields in ModNodeKey (otherwise retains HomeModInfo)
Towards #22530
- - - - -
5640cb1d by Sylvain Henry at 2023-01-26T12:35:36-05:00
Hadrian: fix doc generation
Was missing dependencies on files generated by templates (e.g.
ghc.cabal)
- - - - -
3e827c3f by Richard Eisenberg at 2023-01-26T20:06:53-05:00
Do newtype unwrapping in the canonicaliser and rewriter
See Note [Unwrap newtypes first], which has the details.
Close #22519.
- - - - -
b3ef5c89 by doyougnu at 2023-01-26T20:07:48-05:00
tryFillBuffer: strictify
more speculative bangs
- - - - -
d0d7ba0f by Vladislav Zavialov at 2023-01-26T20:08:25-05:00
base: NoImplicitPrelude in Data.Void and Data.Kind
This change removes an unnecessary dependency on Prelude
from two modules in the base package.
- - - - -
fa1db923 by Matthew Pickering at 2023-01-26T20:09:00-05:00
ci: Add ubuntu18_04 nightly and release jobs
This adds release jobs for ubuntu18_04 which uses glibc 2.27 which is
older than the 2.28 which is used by Rocky8 bindists.
Ticket #22268
- - - - -
807310a1 by Matthew Pickering at 2023-01-26T20:09:00-05:00
rel-eng: Add missing rocky8 bindist
We intend to release rocky8 bindist so the fetching script needs to know
about them.
- - - - -
c7116b10 by Ben Gamari at 2023-01-26T20:09:35-05:00
base: Make changelog proposal references more consistent
Addresses #22773.
- - - - -
6932cfc7 by Sylvain Henry at 2023-01-26T20:10:27-05:00
Fix spurious change from !9568
- - - - -
e480fbc2 by Ben Gamari at 2023-01-27T05:01:24-05:00
rts: Use C11-compliant static assertion syntax
Previously we used `static_assert` which is only available in C23. By
contrast, C11 only provides `_Static_assert`.
Fixes #22777
- - - - -
2648c09c by Andrei Borzenkov at 2023-01-27T05:02:07-05:00
Replace errors from badOrigBinding with new one (#22839)
Problem: in 02279a9c the type-level [] syntax was changed from a built-in name
to an alias for the GHC.Types.List constructor. badOrigBinding assumes that if
a name is not built-in then it must have come from TH quotation, but this is
not necessarily the case with [].
The outdated assumption in badOrigBinding leads to incorrect error messages.
This code:
data []
Fails with "Cannot redefine a Name retrieved by a Template Haskell quote: []"
Unfortunately, there is not enough information in RdrName to directly determine
if the name was constructed via TH or by the parser, so this patch changes the
error message instead.
It unifies TcRnIllegalBindingOfBuiltIn and TcRnNameByTemplateHaskellQuote
into a new error TcRnBindingOfExistingName and changes its wording to avoid
guessing the origin of the name.
- - - - -
545bf8cf by Matthew Pickering at 2023-01-27T14:58:53+00:00
Revert "base: NoImplicitPrelude in Data.Void and Data.Kind"
Fixes CI errors of the form.
```
===> Command failed with error code: 1
ghc: panic! (the 'impossible' happened)
GHC version 9.7.20230127:
lookupGlobal
Failed to load interface for ‘GHC.Num.BigNat’
There are files missing in the ‘ghc-bignum’ package,
try running 'ghc-pkg check'.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/GHC/Utils/Panic.hs:189:37 in ghc:GHC.Utils.Panic
pprPanic, called at compiler/GHC/Tc/Utils/Env.hs:154:32 in ghc:GHC.Tc.Utils.Env
CallStack (from HasCallStack):
panic, called at compiler/GHC/Utils/Error.hs:454:29 in ghc:GHC.Utils.Error
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
```
This reverts commit d0d7ba0fb053ebe7f919a5932066fbc776301ccd.
The module now lacks a dependency on GHC.Num.BigNat which it implicitly
depends on. It is causing all CI jobs to fail so we revert without haste
whilst the patch can be fixed.
Fixes #22848
- - - - -
638277ba by Simon Peyton Jones at 2023-01-27T23:54:55-05:00
Detect family instance orphans correctly
We were treating a type-family instance as a non-orphan if there
was a type constructor on its /right-hand side/ that was local. Boo!
Utterly wrong. With this patch, we correctly check the /left-hand side/
instead!
Fixes #22717
- - - - -
46a53bb2 by Simon Peyton Jones at 2023-01-27T23:54:55-05:00
Report family instance orphans correctly
This fixes the fact that we were not reporting orphan family instances
at all. The fix here is easy, but touches a bit of code. I refactored
the code to be much more similar to the way that class instances are done:
- Add a fi_orphan field to FamInst, like the is_orphan field in ClsInst
- Make newFamInst initialise this field, just like newClsInst
- And make newFamInst report a warning for an orphan, just like newClsInst
- I moved newFamInst from GHC.Tc.Instance.Family to GHC.Tc.Utils.Instantiate,
just like newClsInst.
- I added mkLocalFamInst to FamInstEnv, just like mkLocalClsInst in InstEnv
- TcRnOrphanInstance and SuggestFixOrphanInstance are now parametrised
over class instances vs type/data family instances.
Fixes #19773
- - - - -
faa300fb by Simon Peyton Jones at 2023-01-27T23:54:55-05:00
Avoid orphans in STG
This patch removes some orphan instances in the STG namespace
by introducing the GHC.Stg.Lift.Types module, which allows various
type family instances to be moved to GHC.Stg.Syntax, avoiding orphan
instances.
- - - - -
0f25a13b by Simon Peyton Jones at 2023-01-27T23:54:55-05:00
Avoid orphans in the parser
This moves Anno instances for PatBuilder from GHC.Parser.PostProcess
to GHC.Parser.Types to avoid orphans.
- - - - -
15750d33 by Simon Peyton Jones at 2023-01-27T23:54:55-05:00
Accept an orphan declaration (sadly)
This accepts the orphan type family instance
type instance DsForeignHook = ...
in GHC.HsToCore.Types.
See Note [The Decoupling Abstract Data Hack] in GHC.Driver.Hooks
- - - - -
c9967d13 by Zubin Duggal at 2023-01-27T23:55:31-05:00
bindist configure: Fail if find not found (#22691)
- - - - -
ad8cfed4 by John Ericson at 2023-01-27T23:56:06-05:00
Put hadrian bootstrap plans through `jq`
This makes it possible to review changes with conventional diffing
tools.
- - - - -
d0ddc01b by Ben Gamari at 2023-01-27T23:56:42-05:00
testsuite: Introduce threaded2_sanity way
Incredibly, we previously did not have a single way which would test the
threaded RTS with multiple capabilities and the sanity-checker enabled.
- - - - -
38ad8351 by Ben Gamari at 2023-01-27T23:56:42-05:00
rts: Relax Messages assertion
`doneWithMsgThrowTo` was previously too strict in asserting that the
`Message` is locked. Specifically, it failed to consider that the
`Message` may not be locked if we are deleting all threads during RTS
shutdown.
- - - - -
a9fe81af by Ben Gamari at 2023-01-27T23:56:42-05:00
testsuite: Fix race in UnliftedTVar2
Previously UnliftedTVar2 would fail when run with multiple capabilities
(and possibly even with one capability) as it would assume that
`killThread#` would immediately kill the "increment" thread.
Also, refactor the the executable to now succeed with no output and
fails with an exit code.
- - - - -
8519af60 by Ben Gamari at 2023-01-27T23:56:42-05:00
testsuite: Make listThreads more robust
Previously it was sensitive to the labels of threads which it did not
create (e.g. the IO manager event loop threads). Fix this.
- - - - -
55a81995 by Ben Gamari at 2023-01-27T23:56:43-05:00
rts: Fix non-atomic mutation of enabled_capabilities
- - - - -
b5c75f1d by Ben Gamari at 2023-01-27T23:56:43-05:00
rts: Fix C++ compilation issues
Make the RTS compilable with a C++ compiler by inserting necessary
casts.
- - - - -
c261b62f by Ben Gamari at 2023-01-27T23:56:43-05:00
rts: Fix typo
"tracingAddCapabilities" was mis-named
- - - - -
77fdbd3f by Ben Gamari at 2023-01-27T23:56:43-05:00
rts: Drop long-dead fallback definitions for INFINITY & NAN
These are no longer necessary since we now compile as C99.
- - - - -
56c1bd98 by Ben Gamari at 2023-01-28T02:57:59-05:00
Revert "CApiFFI: add ConstPtr for encoding const-qualified pointer return types (#22043)"
This reverts commit 99aca26b652603bc62953157a48e419f737d352d.
- - - - -
b3a3534b by nineonine at 2023-01-28T02:57:59-05:00
CApiFFI: add ConstPtr for encoding const-qualified pointer return types
Previously, when using `capi` calling convention in foreign declarations,
code generator failed to handle const-cualified pointer return types.
This resulted in CC toolchain throwing `-Wincompatible-pointer-types-discards-qualifiers`
warning.
`Foreign.C.Types.ConstPtr` newtype was introduced to handle these cases -
special treatment was put in place to generate appropritetly qualified C
wrapper that no longer triggers the above mentioned warning.
Fixes #22043.
- - - - -
082b7d43 by Oleg Grenrus at 2023-01-28T02:58:38-05:00
Add Foldable1 Solo instance
- - - - -
50b1e2e8 by Andrei Borzenkov at 2023-01-28T02:59:18-05:00
Convert diagnostics in GHC.Rename.Bind to proper TcRnMessage (#20115)
I removed all occurrences of TcRnUnknownMessage in GHC.Rename.Bind
module. Instead, these TcRnMessage messages were introduced:
TcRnMultipleFixityDecls
TcRnIllegalPatternSynonymDecl
TcRnIllegalClassBiding
TcRnOrphanCompletePragma
TcRnEmptyCase
TcRnNonStdGuards
TcRnDuplicateSigDecl
TcRnMisplacedSigDecl
TcRnUnexpectedDefaultSig
TcRnBindInBootFile
TcRnDuplicateMinimalSig
- - - - -
3330b819 by Matthew Pickering at 2023-01-28T02:59:54-05:00
hadrian: Fix library-dirs, dynamic-library-dirs and static-library-dirs in inplace .conf files
Previously we were just throwing away the contents of the library-dirs
fields but really we have to do the same thing as for include-dirs,
relativise the paths into the current working directory and maintain any
extra libraries the user has specified.
Now the relevant section of the rts.conf file looks like:
```
library-dirs:
${pkgroot}/../rts/build
${pkgroot}/../../..//_build/stage1/rts/build
/nix/store/av4c0fib4rkmb6sa1074z0rb1ciria5b-gperftools-2.10/lib
/nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib
library-dirs-static:
${pkgroot}/../rts/build
${pkgroot}/../../..//_build/stage1/rts/build
/nix/store/av4c0fib4rkmb6sa1074z0rb1ciria5b-gperftools-2.10/lib
/nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib
dynamic-library-dirs:
${pkgroot}/../rts/build
${pkgroot}/../../..//_build/stage1/rts/build
/nix/store/av4c0fib4rkmb6sa1074z0rb1ciria5b-gperftools-2.10/lib
/nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib
```
Fixes #22209
- - - - -
c9ad8852 by Bodigrim at 2023-01-28T03:00:33-05:00
Document differences between Data.{Monoid,Semigroup}.{First,Last}
- - - - -
7e11c6dc by Cheng Shao at 2023-01-28T03:01:09-05:00
compiler: fix subword literal narrowing logic in the wasm NCG
This patch fixes the W8/W16 literal narrowing logic in the wasm NCG,
which used to lower it to something like i32.const -1, without
properly zeroing-out the unused higher bits. Fixes #22608.
- - - - -
6ea2aa02 by Cheng Shao at 2023-01-28T03:01:46-05:00
compiler: fix lowering of CmmBlock in the wasm NCG
The CmmBlock datacon was not handled in lower_CmmLit, since I thought
it would have been eliminated after proc-point splitting. Turns out it
still occurs in very rare occasions, and this patch is needed to fix
T9329 for wasm.
- - - - -
2b62739d by Bodigrim at 2023-01-28T17:16:11-05:00
Assorted changes to avoid Data.List.{head,tail}
- - - - -
78c07219 by Cheng Shao at 2023-01-28T17:16:48-05:00
compiler: properly handle ForeignHints in the wasm NCG
Properly handle ForeignHints of ccall arguments/return value, insert
sign extends and truncations when handling signed subwords. Fixes #22852.
- - - - -
8bed166b by Ben Gamari at 2023-01-30T05:06:26-05:00
nativeGen: Disable asm-shortcutting on Darwin
Asm-shortcutting may produce relative references to symbols defined in
other compilation units. This is not something that MachO relocations
support (see #21972). For this reason we disable the optimisation on
Darwin. We do so without a warning since this flag is enabled by `-O2`.
Another way to address this issue would be to rather implement a
PLT-relocatable jump-table strategy. However, this would only benefit
Darwin and does not seem worth the effort.
Closes #21972.
- - - - -
da468391 by Cheng Shao at 2023-01-30T05:07:03-05:00
compiler: fix data section alignment in the wasm NCG
Previously we tried to lower the alignment requirement as far as
possible, based on the section kind inferred from the CLabel. For info
tables, .p2align 1 was applied given the GC should only need the
lowest bit to tag forwarding pointers. But this would lead to
unaligned loads/stores, which has a performance penalty even if the
wasm spec permits it. Furthermore, the test suite has shown memory
corruption in a few cases when compacting gc is used.
This patch takes a more conservative approach: all data sections
except C strings align to word size.
- - - - -
08ba8720 by Andreas Klebinger at 2023-01-30T21:18:45-05:00
ghc-the-library: Retain cafs in both static in dynamic builds.
We use keepCAFsForGHCi.c to force -fkeep-cafs behaviour by using a
__attribute__((constructor)) function.
This broke for static builds where the linker discarded the object file
since it was not reverenced from any exported code. We fix this by
asserting that the flag is enabled using a function in the same module
as the constructor. Which causes the object file to be retained by the
linker, which in turn causes the constructor the be run in static builds.
This changes nothing for dynamic builds using the ghc library. But causes
static to also retain CAFs (as we expect them to).
Fixes #22417.
-------------------------
Metric Decrease:
T21839r
-------------------------
- - - - -
20598ef6 by Ryan Scott at 2023-01-30T21:19:20-05:00
Handle `type data` properly in tyThingParent_maybe
Unlike most other data constructors, data constructors declared with `type data`
are represented in `TyThing`s as `ATyCon` rather than `ADataCon`. The `ATyCon`
case in `tyThingParent_maybe` previously did not consider the possibility of
the underlying `TyCon` being a promoted data constructor, which led to the
oddities observed in #22817. This patch adds a dedicated special case in
`tyThingParent_maybe`'s `ATyCon` case for `type data` data constructors to fix
these oddities.
Fixes #22817.
- - - - -
2f145052 by Ryan Scott at 2023-01-30T21:19:56-05:00
Fix two bugs in TypeData TH reification
This patch fixes two issues in the way that `type data` declarations were
reified with Template Haskell:
* `type data` data constructors are now properly reified using `DataConI`.
This is accomplished with a special case in `reifyTyCon`. Fixes #22818.
* `type data` type constructors are now reified in `reifyTyCon` using
`TypeDataD` instead of `DataD`. Fixes #22819.
- - - - -
d0f34f25 by Simon Peyton Jones at 2023-01-30T21:20:35-05:00
Take account of loop breakers in specLookupRule
The key change is that in GHC.Core.Opt.Specialise.specLookupRule
we were using realIdUnfolding, which ignores the loop-breaker
flag. When given a loop breaker, rule matching therefore
looped infinitely -- #22802.
In fixing this I refactored a bit.
* Define GHC.Core.InScopeEnv as a data type, and use it.
(Previously it was a pair: hard to grep for.)
* Put several functions returning an IdUnfoldingFun into
GHC.Types.Id, namely
idUnfolding
alwaysActiveUnfoldingFun,
whenActiveUnfoldingFun,
noUnfoldingFun
and use them. (The are all loop-breaker aware.)
- - - - -
de963cb6 by Matthew Pickering at 2023-01-30T21:21:11-05:00
ci: Remove FreeBSD job from release pipelines
We no longer attempt to build or distribute this release
- - - - -
f26d27ec by Matthew Pickering at 2023-01-30T21:21:11-05:00
rel_eng: Add check to make sure that release jobs are downloaded by fetch-gitlab
This check makes sure that if a job is a prefixed by "release-" then the
script downloads it and understands how to map the job name to the
platform.
- - - - -
7619c0b4 by Matthew Pickering at 2023-01-30T21:21:11-05:00
rel_eng: Fix the name of the ubuntu-* jobs
These were not uploaded for alpha1
Fixes #22844
- - - - -
68eb8877 by Matthew Pickering at 2023-01-30T21:21:11-05:00
gen_ci: Only consider release jobs for job metadata
In particular we do not have a release job for FreeBSD so the generation
of the platform mapping was failing.
- - - - -
b69461a0 by Jason Shipman at 2023-01-30T21:21:50-05:00
User's guide: Clarify overlapping instance candidate elimination
This commit updates the user's guide section on overlapping instance candidate
elimination to use "or" verbiage instead of "either/or" in regards to the
current pair of candidates' being overlappable or overlapping. "Either IX is
overlappable, or IY is overlapping" can cause confusion as it suggests "Either
IX is overlappable, or IY is overlapping, but not both".
This was initially discussed on this Discourse topic:
https://discourse.haskell.org/t/clarification-on-overlapping-instance-candidate-elimination/5677
- - - - -
7cbdaad0 by Matthew Pickering at 2023-01-31T07:53:53-05:00
Fixes for cabal-reinstall CI job
* Allow filepath to be reinstalled
* Bump some version bounds to allow newer versions of libraries
* Rework testing logic to avoid "install --lib" and package env files
Fixes #22344
- - - - -
fd8f32bf by Cheng Shao at 2023-01-31T07:54:29-05:00
rts: prevent potential divide-by-zero when tickInterval=0
This patch fixes a few places in RtsFlags.c that may result in
divide-by-zero error when tickInterval=0, which is the default on
wasm. Fixes #22603.
- - - - -
085a6db6 by Joachim Breitner at 2023-01-31T07:55:05-05:00
Update note at beginning of GHC.Builtin.NAmes
some things have been renamed since it was written, it seems.
- - - - -
7716cbe6 by Cheng Shao at 2023-01-31T07:55:41-05:00
testsuite: use tgamma for cg007
gamma is a glibc-only deprecated function, use tgamma instead. It's
required for fixing cg007 when testing the wasm unregisterised
codegen.
- - - - -
19c1fbcd by doyougnu at 2023-01-31T13:08:03-05:00
InfoTableProv: ShortText --> ShortByteString
- - - - -
765fab98 by doyougnu at 2023-01-31T13:08:03-05:00
FastString: add fastStringToShorText
- - - - -
a83c810d by Simon Peyton Jones at 2023-01-31T13:08:38-05:00
Improve exprOkForSpeculation for classops
This patch fixes #22745 and #15205, which are about GHC's
failure to discard unnecessary superclass selections that
yield coercions. See
GHC.Core.Utils Note [exprOkForSpeculation and type classes]
The main changes are:
* Write new Note [NON-BOTTOM_DICTS invariant] in GHC.Core, and
refer to it
* Define new function isTerminatingType, to identify those
guaranteed-terminating dictionary types.
* exprOkForSpeculation has a new (very simple) case for ClassOpId
* ClassOpId has a new field that says if the return type is
an unlifted type, or a terminating type.
This was surprisingly tricky to get right. In particular note
that unlifted types are not terminating types; you can write an
expression of unlifted type, that diverges. Not so for dictionaries
(or, more precisely, for the dictionaries that GHC constructs).
Metric Decrease:
LargeRecord
- - - - -
f83374f8 by Krzysztof Gogolewski at 2023-01-31T13:09:14-05:00
Support "unusable UNPACK pragma" warning with -O0
Fixes #11270
- - - - -
a2d814dc by Ben Gamari at 2023-01-31T13:09:50-05:00
configure: Always create the VERSION file
Teach the `configure` script to create the `VERSION` file.
This will serve as the stable interface to allow the user to determine
the version number of a working tree.
Fixes #22322.
- - - - -
5618fc21 by sheaf at 2023-01-31T15:51:06-05:00
Cmm: track the type of global registers
This patch tracks the type of Cmm global registers. This is needed
in order to lint uses of polymorphic registers, such as SIMD vector
registers that can be used both for floating-point and integer values.
This changes allows us to refactor VanillaReg to not store VGcPtr,
as that information is instead stored in the type of the usage of the
register.
Fixes #22297
- - - - -
78b99430 by sheaf at 2023-01-31T15:51:06-05:00
Revert "Cmm Lint: relax SIMD register assignment check"
This reverts commit 3be48877, which weakened a Cmm Lint check involving
SIMD vectors. Now that we keep track of the type a global register is
used at, we can restore the original stronger check.
- - - - -
be417a47 by Ben Gamari at 2023-01-31T15:51:45-05:00
nativeGen/AArch64: Fix debugging output
Previously various panics would rely on a half-written Show
instance, leading to very unhelpful errors. Fix this.
See #22798.
- - - - -
30989d13 by Ben Gamari at 2023-01-31T15:51:45-05:00
nativeGen: Teach graph-colouring allocator that x18 is unusable
Previously trivColourable for AArch64 claimed that at 18 registers were
trivially-colourable. This is incorrect as x18 is reserved by the platform on
AArch64/Darwin.
See #22798.
- - - - -
7566fd9d by Ben Gamari at 2023-01-31T15:51:45-05:00
nativeGen/AArch64: Fix graph-colouring allocator
Previously various `Instr` queries used by the graph-colouring allocator
failed to handle a few pseudo-instructions. This manifested in compiler
panicks while compiling `SHA`, which uses `-fregs-graph`.
Fixes #22798.
- - - - -
2cb500a5 by Ben Gamari at 2023-01-31T15:51:45-05:00
testsuite: Add regression test for #22798
- - - - -
03d693b2 by Ben Gamari at 2023-01-31T15:52:32-05:00
Revert "Hadrian: fix doc generation"
This is too large of a hammer.
This reverts commit 5640cb1d84d3cce4ce0a9e90d29b2b20d2b38c2f.
- - - - -
f838815c by Ben Gamari at 2023-01-31T15:52:32-05:00
hadrian: Sphinx docs require templated cabal files
The package-version discovery logic in
`doc/users_guide/package_versions.py` uses packages' cabal files to
determine package versions. Teach Sphinx about these dependencies in
cases where the cabal files are generated by templates.
- - - - -
2e48c19a by Ben Gamari at 2023-01-31T15:52:32-05:00
hadrian: Refactor templating logic
This refactors Hadrian's autoconf-style templating logic to be explicit
about which interpolation variables should be substituted in which
files. This clears the way to fix #22714 without incurring rule cycles.
- - - - -
93f0e3c4 by Ben Gamari at 2023-01-31T15:52:33-05:00
hadrian: Substitute LIBRARY_*_VERSION variables
This teaches Hadrian to substitute the `LIBRARY_*_VERSION` variables
in `libraries/prologue.txt`, fixing #22714.
Fixes #22714.
- - - - -
22089f69 by Ben Gamari at 2023-01-31T20:46:27-05:00
Bump transformers submodule to 0.6.0.6
Fixes #22862.
- - - - -
f0eefa3c by Cheng Shao at 2023-01-31T20:47:03-05:00
compiler: properly handle non-word-sized CmmSwitch scrutinees in the wasm NCG
Currently, the wasm NCG has an implicit assumption: all CmmSwitch
scrutinees are 32-bit integers. This is not always true; #22864 is one
counter-example with a 64-bit scrutinee. This patch fixes the logic by
explicitly converting the scrutinee to a word that can be used as a
br_table operand. Fixes #22871. Also includes a regression test.
- - - - -
9f95db54 by Simon Peyton Jones at 2023-02-01T08:55:08+00:00
Improve treatment of type applications in patterns
This patch fixes a subtle bug in the typechecking of type
applications in patterns, e.g.
f (MkT @Int @a x y) = ...
See Note [Type applications in patterns] in GHC.Tc.Gen.Pat.
This fixes #19847, #22383, #19577, #21501
- - - - -
955a99ea by Simon Peyton Jones at 2023-02-01T12:31:23-05:00
Treat existentials correctly in dubiousDataConInstArgTys
Consider (#22849)
data T a where
MkT :: forall k (t::k->*) (ix::k). t ix -> T @k a
Then dubiousDataConInstArgTys MkT [Type, Foo] should return
[Foo (ix::Type)]
NOT [Foo (ix::k)]
A bit of an obscure case, but it's an outright bug, and the fix is easy.
- - - - -
0cc16aaf by Matthew Pickering at 2023-02-01T12:31:58-05:00
Bump supported LLVM range from 10 through 15 to 11 through 16
LLVM 15 turns on the new pass manager by default, which we have yet to
migrate to so for new we pass the `-enable-new-pm-0` flag in our
llvm-passes flag.
LLVM 11 was the first version to support the `-enable-new-pm` flag so we
bump the lowest supported version to 11.
Our CI jobs are using LLVM 12 so they should continue to work despite
this bump to the lower bound.
Fixes #21936
- - - - -
f94f1450 by Matthew Pickering at 2023-02-01T12:31:58-05:00
Bump DOCKER_REV to use alpine image without LLVM installed
alpine_3_12 only supports LLVM 10, which is now outside the supported
version range.
- - - - -
083e26ed by Matthew Pickering at 2023-02-01T17:43:21-05:00
Remove tracing OPTIONS_GHC
These were accidentally left over from !9542
- - - - -
354aa47d by Teo Camarasu at 2023-02-01T17:44:00-05:00
doc: fix gcdetails_block_fragmentation_bytes since annotation
- - - - -
61ce5bf6 by Jaro Reinders at 2023-02-02T00:15:30-05:00
compiler: Implement higher order patterns in the rule matcher
This implements proposal 555 and closes ticket #22465.
See the proposal and ticket for motivation.
The core changes of this patch are in the GHC.Core.Rules.match function
and they are explained in the Note [Matching higher order patterns].
- - - - -
394b91ce by doyougnu at 2023-02-02T00:16:10-05:00
CI: JavaScript backend runs testsuite
This MR runs the testsuite for the JS backend. Note that this is a
temporary solution until !9515 is merged.
Key point: The CI runs hadrian on the built cross compiler _but not_ on
the bindist.
Other Highlights:
- stm submodule gets a bump to mark tests as broken
- several tests are marked as broken or are fixed by adding more
- conditions to their test runner instance.
List of working commit messages:
CI: test cross target _and_ emulator
CI: JS: Try run testsuite with hadrian
JS.CI: cleanup and simplify hadrian invocation
use single bracket, print info
JS CI: remove call to test_compiler from hadrian
don't build haddock
JS: mark more tests as broken
Tracked in https://gitlab.haskell.org/ghc/ghc/-/issues/22576
JS testsuite: don't skip sum_mod test
Its expected to fail, yet we skipped it which automatically makes it
succeed leading to an unexpected success,
JS testsuite: don't mark T12035j as skip
leads to an unexpected pass
JS testsuite: remove broken on T14075
leads to unexpected pass
JS testsuite: mark more tests as broken
JS testsuite: mark T11760 in base as broken
JS testsuite: mark ManyUnbSums broken
submodules: bump process and hpc for JS tests
Both submodules has needed tests skipped or marked broken for th JS
backend. This commit now adds these changes to GHC.
See:
HPC: https://gitlab.haskell.org/hpc/hpc/-/merge_requests/21
Process: https://github.com/haskell/process/pull/268
remove js_broken on now passing tests
separate wasm and js backend ci
test: T11760: add threaded, non-moving only_ways
test: T10296a add req_c
T13894: skip for JS backend
tests: jspace, T22333: mark as js_broken(22573)
test: T22513i mark as req_th
stm submodule: mark stm055, T16707 broken for JS
tests: js_broken(22374) on unpack_sums_6, T12010
dont run diff on JS CI, cleanup
fixup: More CI cleanup
fix: align text to master
fix: align exceptions submodule to master
CI: Bump DOCKER_REV
Bump to ci-images commit that has a deb11 build with node. Required for
!9552
testsuite: mark T22669 as js_skip
See #22669
This test tests that .o-boot files aren't created when run in using the
interpreter backend. Thus this is not relevant for the JS backend.
testsuite: mark T22671 as broken on JS
See #22835
base.testsuite: mark Chan002 fragile for JS
see #22836
revert: submodule process bump
bump stm submodule
New hash includes skips for the JS backend.
testsuite: mark RnPatternSynonymFail broken on JS
Requires TH:
- see !9779
- and #22261
compiler: GHC.hs ifdef import Utils.Panic.Plain
- - - - -
1ffe770c by Cheng Shao at 2023-02-02T09:40:38+00:00
docs: 9.6 release notes for wasm backend
- - - - -
0ada4547 by Matthew Pickering at 2023-02-02T11:39:44-05:00
Disable unfolding sharing for interface files with core definitions
Ticket #22807 pointed out that the RHS sharing was not compatible with
-fignore-interface-pragmas because the flag would remove unfoldings from
identifiers before the `extra-decls` field was populated.
For the 9.6 timescale the only solution is to disable this sharing,
which will make interface files bigger but this is acceptable for the
first release of `-fwrite-if-simplified-core`.
For 9.8 it would be good to fix this by implementing #20056 due to the
large number of other bugs that would fix.
I also improved the error message in tc_iface_binding to avoid the "no match
in record selector" error but it should never happen now as the entire
sharing logic is disabled.
Also added the currently broken test for #22807 which could be fixed by
!6080
Fixes #22807
- - - - -
7e2d3eb5 by lrzlin at 2023-02-03T05:23:27-05:00
Enable tables next to code for LoongArch64
- - - - -
2931712a by Wander Hillen at 2023-02-03T05:24:06-05:00
Move pthread and timerfd ticker implementations to separate files
- - - - -
41c4baf8 by Ben Gamari at 2023-02-03T05:24:44-05:00
base: Fix Note references in GHC.IO.Handle.Types
- - - - -
31358198 by Bodigrim at 2023-02-03T05:25:22-05:00
Bump submodule containers to 0.6.7
Metric Decrease:
ManyConstructors
T10421
T12425
T12707
T13035
T13379
T15164
T1969
T783
T9198
T9961
WWRec
- - - - -
8feb9301 by Ben Gamari at 2023-02-03T05:25:59-05:00
gitlab-ci: Eliminate redundant ghc --info output
Previously ci.sh would emit the output of `ghc --info` every time it ran
when using the nix toolchain. This produced a significant amount of
noise.
See #22861.
- - - - -
de1d1512 by Ryan Scott at 2023-02-03T14:07:30-05:00
Windows: Remove mingwex dependency
The clang based toolchain uses ucrt as its math library
and so mingwex is no longer needed. In fact using mingwex
will cause incompatibilities as the default routines in both
have differing ULPs and string formatting modifiers.
```
$ LIBRARY_PATH=/mingw64/lib ghc/_build/stage1/bin/ghc Bug.hs -fforce-recomp && ./Bug.exe
[1 of 2] Compiling Main ( Bug.hs, Bug.o )
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `__imp___p__environ'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `__hscore_get_errno'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_ForeignziCziError_errnoToIOError_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziWindows_failIf2_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziEncodingziCodePageziAPI_mkCodePageEncoding_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziEncodingziCodePage_currentCodePage_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziEncoding_getForeignEncoding_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_ForeignziCziString_withCStringLen1_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziHandleziInternals_zdwflushCharReadBuffer_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziHandleziText_hGetBuf1_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziFingerprint_fingerprintString_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_DataziTypeableziInternal_mkTrCon_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziException_errorCallWithCallStackException_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziErr_error_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\template-haskell-2.19.0.0\libHStemplate-haskell-2.19.0.0.a: unknown symbol `base_DataziMaybe_fromJust1_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\template-haskell-2.19.0.0\libHStemplate-haskell-2.19.0.0.a: unknown symbol `templatezmhaskell_LanguageziHaskellziTHziSyntax_IntPrimL_con_info'
ghc.exe: ^^ Could not load 'templatezmhaskell_LanguageziHaskellziTHziLibziInternal_stringL_closure', dependency unresolved. See top entry above.
<no location info>: error:
GHC.ByteCode.Linker.lookupCE
During interactive linking, GHCi couldn't find the following symbol:
templatezmhaskell_LanguageziHaskellziTHziLibziInternal_stringL_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please report this as a GHC bug:
https://www.haskell.org/ghc/reportabug
```
- - - - -
48e39195 by Tamar Christina at 2023-02-03T14:07:30-05:00
linker: Fix BFD import libraries
This commit fixes the BFD style import library support in the runtime
linker. This was accidentally broken during the refactoring to clang
and went unnoticed because clang itself is unable to generate the BFD
style import libraries.
With this change we can not link against both GCC or Clang produced
libraries again and intermix code produced by both compilers.
- - - - -
b2bb3e62 by Ben Gamari at 2023-02-03T14:07:30-05:00
Bump Windows toolchain
Updates to LLVM 14, hopefully fixing #21964.
- - - - -
bf3f88a1 by Andreas Klebinger at 2023-02-03T14:08:07-05:00
Fix CallerCC potentially shadowing other cost centres.
Add a CallerCC cost centre flavour for cost centres added by the
CallerCC pass. This avoids potential accidental shadowing between
CCs added by user annotations and ones added by CallerCC.
- - - - -
faea4bcd by j at 2023-02-03T14:08:47-05:00
Disable several ignore-warning flags in genapply.
- - - - -
25537dfd by Ben Gamari at 2023-02-04T04:12:57-05:00
Revert "Use fix-sized bit-fiddling primops for fixed size boxed types"
This reverts commit 4512ad2d6a8e65ea43c86c816411cb13b822f674.
This was never applied to master/9.6 originally.
(cherry picked from commit a44bdc2720015c03d57f470b759ece7fab29a57a)
- - - - -
7612dc71 by Krzysztof Gogolewski at 2023-02-04T04:13:34-05:00
Minor refactor
* Introduce refactorDupsOn f = refactorDups (comparing f)
* Make mkBigTupleCase and coreCaseTuple monadic.
Every call to those functions was preceded by calling newUniqueSupply.
* Use mkUserLocalOrCoVar, which is equivalent to combining
mkLocalIdOrCoVar with mkInternalName.
- - - - -
5a54ac0b by Bodigrim at 2023-02-04T18:48:32-05:00
Fix colors in emacs terminal
- - - - -
3c0f0c6d by Bodigrim at 2023-02-04T18:49:11-05:00
base changelog: move entries which were not backported to ghc-9.6 to base-4.19 section
- - - - -
b18fbf52 by Josh Meredith at 2023-02-06T07:47:57+00:00
Update JavaScript fileStat to match Emscripten layout
- - - - -
6636b670 by Sylvain Henry at 2023-02-06T09:43:21-05:00
JS: replace "js" architecture with "javascript"
Despite Cabal supporting any architecture name, `cabal --check` only
supports a few built-in ones. Sadly `cabal --check` is used by Hackage
hence using any non built-in name in a package (e.g. `arch(js)`) is
rejected and the package is prevented from being uploaded on Hackage.
Luckily built-in support for the `javascript` architecture was added for
GHCJS a while ago. In order to allow newer `base` to be uploaded on
Hackage we make the switch from `js` to `javascript` architecture.
Fixes #22740.
Co-authored-by: Ben Gamari <ben at smart-cactus.org>
- - - - -
77a8234c by Luite Stegeman at 2023-02-06T09:43:59-05:00
Fix marking async exceptions in the JS backend
Async exceptions are posted as a pair of the exception and
the thread object. This fixes the marking pass to correctly
follow the two elements of the pair.
Potentially fixes #22836
- - - - -
3e09cf82 by Jan Hrček at 2023-02-06T09:44:38-05:00
Remove extraneous word in Roles user guide
- - - - -
b17fb3d9 by sheaf at 2023-02-07T10:51:33-05:00
Don't allow . in overloaded labels
This patch removes . from the list of allowed characters in a non-quoted
overloaded label, as it was realised this steals syntax, e.g. (#.).
Users who want this functionality will have to add quotes around the
label, e.g. `#"17.28"`.
Fixes #22821
- - - - -
5dce04ee by romes at 2023-02-07T10:52:10-05:00
Update kinds in comments in GHC.Core.TyCon
Use `Type` instead of star kind (*)
Fix comment with incorrect kind * to have kind `Constraint`
- - - - -
92916194 by Ben Gamari at 2023-02-07T10:52:48-05:00
Revert "Use fix-sized equality primops for fixed size boxed types"
This reverts commit 024020c38126f3ce326ff56906d53525bc71690c.
This was never applied to master/9.6 originally.
See #20405 for why using these primops is a bad idea.
(cherry picked from commit b1d109ad542e4c37ae5af6ace71baf2cb509d865)
- - - - -
c1670c6b by Sylvain Henry at 2023-02-07T21:25:18-05:00
JS: avoid head/tail and unpackFS
- - - - -
a9912de7 by Krzysztof Gogolewski at 2023-02-07T21:25:53-05:00
testsuite: Fix Python warnings (#22856)
- - - - -
9ee761bf by sheaf at 2023-02-08T14:40:40-05:00
Fix tyvar scoping within class SPECIALISE pragmas
Type variables from class/instance headers scope over class/instance
method type signatures, but DO NOT scope over the type signatures in
SPECIALISE and SPECIALISE instance pragmas.
The logic in GHC.Rename.Bind.rnMethodBinds correctly accounted for
SPECIALISE inline pragmas, but forgot to apply the same treatment
to method SPECIALISE pragmas, which lead to a Core Lint failure with
an out-of-scope type variable. This patch makes sure we apply the same
logic for both cases.
Fixes #22913
- - - - -
7eac2468 by Matthew Pickering at 2023-02-08T14:41:17-05:00
Revert "Don't keep exit join points so much"
This reverts commit caced75765472a1a94453f2e5a439dba0d04a265.
It seems the patch "Don't keep exit join points so much" is causing
wide-spread regressions in the bytestring library benchmarks. If I
revert it then the 9.6 numbers are better on average than 9.4.
See https://gitlab.haskell.org/ghc/ghc/-/issues/22893#note_479525
-------------------------
Metric Decrease:
MultiComponentModules
MultiComponentModulesRecomp
MultiLayerModules
MultiLayerModulesRecomp
MultiLayerModulesTH_Make
T12150
T13386
T13719
T21839c
T3294
parsing001
-------------------------
- - - - -
633f2799 by Cheng Shao at 2023-02-08T18:42:16-05:00
testsuite: remove config.use_threads
This patch simplifies the testsuite driver by removing the use_threads
config field. It's just a degenerate case of threads=1.
- - - - -
ca6673e3 by Cheng Shao at 2023-02-08T18:42:16-05:00
testsuite: use concurrent.futures.ThreadPoolExecutor in the driver
The testsuite driver used to create one thread per test case, and
explicitly use semaphore and locks for rate limiting and
synchronization. This is a bad practice in any language, and
occasionally may result in livelock conditions (e.g. #22889). This
patch uses concurrent.futures.ThreadPoolExecutor for scheduling test
case runs, which is simpler and more robust.
- - - - -
f22cce70 by Alan Zimmerman at 2023-02-08T18:42:51-05:00
EPA: Comment between module and where should be in header comments
Do not apply the heuristic to associate a comment with a prior
declaration for the first declaration in the file.
Closes #22919
- - - - -
d69ecac2 by Josh Meredith at 2023-02-09T03:24:05-05:00
JS generated refs: update testsuite conditions
- - - - -
2ea1a6bc by sheaf at 2023-02-09T03:24:44-05:00
Bump transformers to 0.6.1.0
This allows us to avoid orphans for Foldable1 instances,
fixing #22898.
Updates transformers submodule.
- - - - -
d9d0c28d by konsumlamm at 2023-02-09T14:07:48-05:00
Update `Data.List.singleton` doc comment
- - - - -
fe9cd6ef by Ben Gamari at 2023-02-09T14:08:23-05:00
gitlab-template: Emphasize `user facing` label
My sense is that the current mention of the ~"user facing" label is
overlooked by many MR authors.
Let's move this point up in the list to make it more likely that it is
seen. Also rephrase some of the points.
- - - - -
e45eb828 by Simon Peyton Jones at 2023-02-10T06:51:28-05:00
Refactor the simplifier a bit to fix #22761
The core change in this commit, which fixes #22761, is that
* In a Core rule, ru_rhs is always occ-analysed.
This means adding a couple of calls to occurAnalyseExpr when
building a Rule, in
* GHC.Core.Rules.mkRule
* GHC.Core.Opt.Simplify.Iteration.simplRules
But diagosing the bug made me stare carefully at the code of the
Simplifier, and I ended up doing some only-loosely-related refactoring.
* I think that RULES could be lost because not every code path
did addBndrRules
* The code around lambdas was very convoluted
It's mainly moving deck chairs around, but I like it more now.
- - - - -
11e0cacb by Rebecca Turner at 2023-02-10T06:52:09-05:00
Detect the `mold` linker
Enables support for the `mold` linker by rui314.
- - - - -
59556235 by parsonsmatt at 2023-02-10T09:53:11-05:00
Add Lift instance for Fixed
- - - - -
c44e5f30 by Sylvain Henry at 2023-02-10T09:53:51-05:00
Testsuite: decrease length001 timeout for JS (#22921)
- - - - -
133516af by Zubin Duggal at 2023-02-10T09:54:27-05:00
compiler: Use NamedFieldPuns for `ModIface_` and `ModIfaceBackend` `NFData`
instances
This is a minor refactor that makes it easy to add and remove fields from
`ModIface_` and `ModIfaceBackend`.
Also change the formatting to make it clear exactly which fields are
fully forced with `rnf`
- - - - -
1e9eac1c by Matthew Pickering at 2023-02-13T11:36:41+01:00
Refresh profiling docs
I went through the whole of the profiling docs and tried to amend them
to reflect current best practices and tooling. In particular I removed
some old references to tools such as hp2any and replaced them with
references to eventlog2html.
- - - - -
da208b9a by Matthew Pickering at 2023-02-13T11:36:41+01:00
docs: Add section about profiling and foreign calls
Previously there was no documentation for how foreign calls interacted
with the profiler. This can be quite confusing for users so getting it
into the user guide is the first step to a potentially better solution.
See the ticket for more insightful discussion.
Fixes #21764
- - - - -
081640f1 by Bodigrim at 2023-02-13T12:51:52-05:00
Document that -fproc-alignment was introduced only in GHC 8.6
- - - - -
16adc349 by Sven Tennie at 2023-02-14T11:26:31-05:00
Add clangd flag to include generated header files
This enables clangd to correctly check C files that import Rts.h.
(The added include directory contains ghcautoconf.h et. al.)
- - - - -
c399ccd9 by amesgen at 2023-02-14T11:27:14-05:00
Mention new `Foreign.Marshal.Pool` implementation in User's Guide
- - - - -
b9282cf7 by Ben Gamari at 2023-02-14T11:27:50-05:00
upload_ghc_libs: More control over which packages to operate on
Here we add a `--skip` flag to `upload_ghc_libs`, making it easier to
limit which packages to upload. This is often necessary when one package
is not uploadable (e.g. see #22740).
- - - - -
aa3a262d by PHO at 2023-02-14T11:28:29-05:00
Assume platforms support rpaths if they use either ELF or Mach-O
Not only Linux, Darwin, and FreeBSD support rpaths. Determine the usability
of rpaths based on the object format, not on OS.
- - - - -
47716024 by PHO at 2023-02-14T11:29:09-05:00
RTS linker: Improve compatibility with NetBSD
1. Hint address to NetBSD mmap(2) has a different semantics from that of
Linux. When a hint address is provided, mmap(2) searches for a free
region at or below the hint but *never* above it. This means we can't
reliably search for free regions incrementally on the userland,
especially when ASLR is enabled. Let the kernel do it for us if we don't
care where the mapped address is going to be.
2. NetBSD not only hates to map pages as rwx, but also disallows to switch
pages from rw- to r-x unless the intention is declared when pages are
initially requested. This means we need a new MemoryAccess mode for
pages that are going to be changed to r-x.
- - - - -
11de324a by Li-yao Xia at 2023-02-14T11:29:49-05:00
base: Move changelog entry to its place
- - - - -
75930424 by Ben Gamari at 2023-02-14T11:30:27-05:00
nativeGen/AArch64: Emit Atomic{Read,Write} inline
Previously the AtomicRead and AtomicWrite operations were emitted as
out-of-line calls. However, these tend to be very important for
performance, especially the RELAXED case (which only exists for
ThreadSanitizer checking).
Fixes #22115.
- - - - -
d6411d6c by Andreas Klebinger at 2023-02-14T11:31:04-05:00
Fix some correctness issues around tag inference when targeting the bytecode generator.
* Let binders are now always assumed untagged for bytecode.
* Imported referenced are now always assumed to be untagged for bytecode.
Fixes #22840
- - - - -
9fb4ca89 by sheaf at 2023-02-14T11:31:49-05:00
Introduce warning for loopy superclass solve
Commit aed1974e completely re-engineered the treatment of loopy
superclass dictionaries in instance declarations. Unfortunately,
it has the potential to break (albeit in a rather minor way) user code.
To alleviate migration concerns, this commit re-introduces the old
behaviour. Any reliance on this old behaviour triggers a warning,
controlled by `-Wloopy-superclass-solve`. The warning text explains
that GHC might produce bottoming evidence, and provides a migration
strategy.
This allows us to provide a graceful migration period, alerting users
when they are relying on this unsound behaviour.
Fixes #22912 #22891 #20666 #22894 #22905
- - - - -
1928c7f3 by Cheng Shao at 2023-02-14T11:32:26-05:00
rts: make it possible to change mblock size on 32-bit targets
The MBLOCK_SHIFT macro must be the single source of truth for defining
the mblock size, and changing it should only affect performance, not
correctness. This patch makes it truly possible to reconfigure mblock
size, at least on 32-bit targets, by fixing places which implicitly
relied on the previous MBLOCK_SHIFT constant. Fixes #22901.
- - - - -
78aa3b39 by Simon Hengel at 2023-02-14T11:33:06-05:00
Update outdated references to notes
- - - - -
e8baecd2 by meooow25 at 2023-02-14T11:33:49-05:00
Documentation: Improve Foldable1 documentation
* Explain foldrMap1, foldlMap1, foldlMap1', and foldrMap1' in greater
detail, the text is mostly adapted from documentation of Foldable.
* Describe foldr1, foldl1, foldl1' and foldr1' in terms of the above
functions instead of redoing the full explanation.
* Small updates to documentation of fold1, foldMap1 and toNonEmpty,
again adapting from Foldable.
* Update the foldMap1 example to lists instead of Sum since this is
recommended for lazy right-associative folds.
Fixes #22847
- - - - -
85a1a575 by romes at 2023-02-14T11:34:25-05:00
fix: Mark ghci Prelude import as implicit
Fixes #22829
In GHCi, we were creating an import declaration for Prelude but we were
not setting it as an implicit declaration. Therefore, ghci's import of
Prelude triggered -Wmissing-import-lists.
Adds regression test T22829 to testsuite
- - - - -
3b019a7a by Cheng Shao at 2023-02-14T11:35:03-05:00
compiler: fix generateCgIPEStub for no-tables-next-to-code builds
generateCgIPEStub already correctly implements the CmmTick finding
logic for when tables-next-to-code is on/off, but it used the wrong
predicate to decide when to switch between the two. Previously it
switches based on whether the codegen is unregisterised, but there do
exist registerised builds that disable tables-next-to-code! This patch
corrects that problem. Fixes #22896.
- - - - -
08c0822c by doyougnu at 2023-02-15T00:16:39-05:00
docs: release notes, user guide: add js backend
Follow up from #21078
- - - - -
79d8fd65 by Bryan Richter at 2023-02-15T00:17:15-05:00
Allow failure in nightly-x86_64-linux-deb10-no_tntc-validate
See #22343
- - - - -
9ca51f9e by Cheng Shao at 2023-02-15T00:17:53-05:00
rts: add the rts_clearMemory function
This patch adds the rts_clearMemory function that does its best to
zero out unused RTS memory for a wasm backend use case. See the
comment above rts_clearMemory() prototype declaration for more
detailed explanation. Closes #22920.
- - - - -
26df73fb by Oleg Grenrus at 2023-02-15T22:20:57-05:00
Add -single-threaded flag to force single threaded rts
This is the small part of implementing
https://github.com/ghc-proposals/ghc-proposals/pull/240
- - - - -
631c6c72 by Cheng Shao at 2023-02-16T06:43:09-05:00
docs: add a section for the wasm backend
Fixes #22658
- - - - -
1878e0bd by Bryan Richter at 2023-02-16T06:43:47-05:00
tests: Mark T12903 fragile everywhere
See #21184
- - - - -
b9420eac by Bryan Richter at 2023-02-16T06:43:47-05:00
Mark all T5435 variants as fragile
See #22970.
- - - - -
df3d94bd by Sylvain Henry at 2023-02-16T06:44:33-05:00
Testsuite: mark T13167 as fragile for JS (#22921)
- - - - -
324e925b by Sylvain Henry at 2023-02-16T06:45:15-05:00
JS: disable debugging info for heap objects
- - - - -
518af814 by Josh Meredith at 2023-02-16T10:16:32-05:00
Factor JS Rts generation for h$c{_,0,1,2} into h$c{n} and improve name caching
- - - - -
34cd308e by Ben Gamari at 2023-02-16T10:17:08-05:00
base: Note move of GHC.Stack.CCS.whereFrom to GHC.InfoProv in changelog
Fixes #22883.
- - - - -
12965aba by Simon Peyton Jones at 2023-02-16T10:17:46-05:00
Narrow the dont-decompose-newtype test
Following #22924 this patch narrows the test that stops
us decomposing newtypes. The key change is the use of
noGivenNewtypeReprEqs in GHC.Tc.Solver.Canonical.canTyConApp.
We went to and fro on the solution, as you can see in #22924.
The result is carefully documented in
Note [Decomoposing newtype equalities]
On the way I had revert most of
commit 3e827c3f74ef76d90d79ab6c4e71aa954a1a6b90
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date: Mon Dec 5 10:14:02 2022 -0500
Do newtype unwrapping in the canonicaliser and rewriter
See Note [Unwrap newtypes first], which has the details.
It turns out that
(a) 3e827c3f makes GHC behave worse on some recursive newtypes
(see one of the tests on this commit)
(b) the finer-grained test (namely noGivenNewtypeReprEqs) renders
3e827c3f unnecessary
- - - - -
5b038888 by Bodigrim at 2023-02-16T10:18:24-05:00
Documentation: add an example of SPEC usage
- - - - -
681e0e8c by sheaf at 2023-02-16T14:09:56-05:00
No default finalizer exception handler
Commit cfc8e2e2 introduced a mechanism for handling of exceptions
that occur during Handle finalization, and 372cf730 set the default
handler to print out the error to stderr.
However, #21680 pointed out we might not want to set this by default,
as it might pollute users' terminals with unwanted information.
So, for the time being, the default handler discards the exception.
Fixes #21680
- - - - -
b3ac17ad by Matthew Pickering at 2023-02-16T14:10:31-05:00
unicode: Don't inline bitmap in generalCategory
generalCategory contains a huge literal string but is marked INLINE,
this will duplicate the string into any use site of generalCategory. In
particular generalCategory is used in functions like isSpace and the
literal gets inlined into this function which makes it massive.
https://github.com/haskell/core-libraries-committee/issues/130
Fixes #22949
-------------------------
Metric Decrease:
T4029
T18304
-------------------------
- - - - -
8988eeef by sheaf at 2023-02-16T20:32:27-05:00
Expand synonyms in RoughMap
We were failing to expand type synonyms in the function
GHC.Core.RoughMap.typeToRoughMatchLookupTc, even though the
RoughMap infrastructure crucially relies on type synonym expansion
to work.
This patch adds the missing type-synonym expansion.
Fixes #22985
- - - - -
3dd50e2f by Matthew Pickering at 2023-02-16T20:33:03-05:00
ghcup-metadata: Add test artifact
Add the released testsuite tarball to the generated ghcup metadata.
- - - - -
c6a967d9 by Matthew Pickering at 2023-02-16T20:33:03-05:00
ghcup-metadata: Use Ubuntu and Rocky bindists
Prefer to use the Ubuntu 20.04 and 18.04 binary distributions on Ubuntu
and Linux Mint. Prefer to use the Rocky 8 binary distribution on
unknown distributions.
- - - - -
be0b7209 by Matthew Pickering at 2023-02-17T09:37:16+00:00
Add INLINABLE pragmas to `generic*` functions in Data.OldList
These functions are
* recursive
* overloaded
So it's important to add an `INLINABLE` pragma to each so that they can be
specialised at the use site when the specific numeric type is known.
Adding these pragmas improves the LazyText replicate benchmark (see https://gitlab.haskell.org/ghc/ghc/-/issues/22886#note_481020)
https://github.com/haskell/core-libraries-committee/issues/129
- - - - -
a203ad85 by Sylvain Henry at 2023-02-17T15:59:16-05:00
Merge libiserv with ghci
`libiserv` serves no purpose. As it depends on `ghci` and doesn't have
more dependencies than the `ghci` package, its code could live in the
`ghci` package too.
This commit also moves most of the code from the `iserv` program into
the `ghci` package as well so that it can be reused. This is especially
useful for the implementation of TH for the JS backend (#22261, !9779).
- - - - -
7080a93f by Simon Peyton Jones at 2023-02-20T12:06:32+01:00
Improve GHC.Tc.Gen.App.tcInstFun
It wasn't behaving right when inst_final=False, and the
function had no type variables
f :: Foo => Int
Rather a corner case, but we might as well do it right.
Fixes #22908
Unexpectedly, three test cases (all using :type in GHCi) got
slightly better output as a result:
T17403, T14796, T12447
- - - - -
2592ab69 by Cheng Shao at 2023-02-20T10:35:30-05:00
compiler: fix cost centre profiling breakage in wasm NCG due to incorrect register mapping
The wasm NCG used to map CCCS to a wasm global, based on the
observation that CCCS is a transient register that's already handled
by thread state load/store logic, so it doesn't need to be backed by
the rCCCS field in the register table.
Unfortunately, this is wrong, since even when Cmm execution hasn't
yielded back to the scheduler, the Cmm code may call enterFunCCS,
which does use rCCCS.
This breaks cost centre profiling in a subtle way, resulting in
inaccurate stack traces in some test cases. The fix is simple though:
just remove the CCCS mapping.
- - - - -
26243de1 by Alexis King at 2023-02-20T15:27:17-05:00
Handle top-level Addr# literals in the bytecode compiler
Fixes #22376.
- - - - -
0196cc2b by romes at 2023-02-20T15:27:52-05:00
fix: Explicitly flush stdout on plugin
Because of #20791, the plugins tests often fail. This is a temporary
fix to stop the tests from failing due to unflushed outputs on windows
and the explicit flush should be removed when #20791 is fixed.
- - - - -
4327d635 by Ryan Scott at 2023-02-20T20:44:34-05:00
Don't generate datacon wrappers for `type data` declarations
Data constructor wrappers only make sense for _value_-level data constructors,
but data constructors for `type data` declarations only exist at the _type_
level. This patch does the following:
* The criteria in `GHC.Types.Id.Make.mkDataConRep` for whether a data
constructor receives a wrapper now consider whether or not its parent data
type was declared with `type data`, omitting a wrapper if this is the case.
* Now that `type data` data constructors no longer receive wrappers, there is a
spot of code in `refineDefaultAlt` that panics when it encounters a value
headed by a `type data` type constructor. I've fixed this with a special case
in `refineDefaultAlt` and expanded `Note [Refine DEFAULT case alternatives]`
to explain why we do this.
Fixes #22948.
- - - - -
96dc58b9 by Ryan Scott at 2023-02-20T20:44:35-05:00
Treat type data declarations as empty when checking pattern-matching coverage
The data constructors for a `type data` declaration don't exist at the value
level, so we don't want GHC to warn users to match on them.
Fixes #22964.
- - - - -
ff8e99f6 by Ryan Scott at 2023-02-20T20:44:35-05:00
Disallow `tagToEnum#` on `type data` types
We don't want to allow users to conjure up values of a `type data` type using
`tagToEnum#`, as these simply don't exist at the value level.
- - - - -
8e765aff by Bodigrim at 2023-02-21T12:03:24-05:00
Bump submodule text to 2.0.2
- - - - -
172ff88f by Georgi Lyubenov at 2023-02-21T18:35:56-05:00
GHC proposal 496 - Nullary record wildcards
This patch implements GHC proposal 496, which allows record wildcards
to be used for nullary constructors, e.g.
data A = MkA1 | MkA2 { fld1 :: Int }
f :: A -> Int
f (MkA1 {..}) = 0
f (MkA2 {..}) = fld1
To achieve this, we add arity information to the record field
environment, so that we can accept a constructor which has no fields
while continuing to reject non-record constructors with more than 1
field. See Note [Nullary constructors and empty record wildcards],
as well as the more general overview in Note [Local constructor info in the renamer],
both in the newly introduced GHC.Types.ConInfo module.
Fixes #22161
- - - - -
f70a0239 by sheaf at 2023-02-21T18:36:35-05:00
ghc-prim: levity-polymorphic array equality ops
This patch changes the pointer-equality comparison operations in
GHC.Prim.PtrEq to work with arrays of unlifted values, e.g.
sameArray# :: forall {l} (a :: TYPE (BoxedRep l)). Array# a -> Array# a -> Int#
Fixes #22976
- - - - -
9296660b by Andreas Klebinger at 2023-02-21T23:58:05-05:00
base: Correct @since annotation for FP<->Integral bit cast operations.
Fixes #22708
- - - - -
f11d9c27 by romes at 2023-02-21T23:58:42-05:00
fix: Update documentation links
Closes #23008
Additionally batches some fixes to pointers to the Note [Wired-in units],
and a typo in said note.
- - - - -
fb60339f by Bryan Richter at 2023-02-23T14:45:17+02:00
Propagate failure if unable to push notes
- - - - -
8e170f86 by Alexis King at 2023-02-23T16:59:22-05:00
rts: Fix `prompt#` when profiling is enabled
This commit also adds a new -Dk RTS option to the debug RTS to assist
debugging continuation captures. Currently, the printed information is
quite minimal, but more can be added in the future if it proves to be
useful when debugging future issues.
fixes #23001
- - - - -
e9e7a00d by sheaf at 2023-02-23T17:00:01-05:00
Explicit migration timeline for loopy SC solving
This patch updates the warning message introduced in commit
9fb4ca89bff9873e5f6a6849fa22a349c94deaae to specify an explicit
migration timeline: GHC will no longer support this constraint solving
mechanism starting from GHC 9.10.
Fixes #22912
- - - - -
4eb9c234 by Sylvain Henry at 2023-02-24T17:27:45-05:00
JS: make some arithmetic primops faster (#22835)
Don't use BigInt for wordAdd2, mulWord32, and timesInt32.
Co-authored-by: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org>
- - - - -
92e76483 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump terminfo submodule to 0.4.1.6
- - - - -
f229db14 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump unix submodule to 2.8.1.0
- - - - -
47bd48c1 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump deepseq submodule to 1.4.8.1
- - - - -
d2012594 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump directory submodule to 1.3.8.1
- - - - -
df6f70d1 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump process submodule to v1.6.17.0
- - - - -
4c869e48 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump hsc2hs submodule to 0.68.8
- - - - -
81d96642 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump array submodule to 0.5.4.0
- - - - -
6361f771 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump Cabal submodule to 3.9 pre-release
- - - - -
4085fb6c by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump filepath submodule to 1.4.100.1
- - - - -
2bfad50f by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump haskeline submodule to 0.8.2.1
- - - - -
fdc89a8d by Ben Gamari at 2023-02-24T21:29:32-05:00
gitlab-ci: Run nix-build with -v0
This significantly cuts down on the amount of
noise in the job log.
Addresses #22861.
- - - - -
69fb0b13 by Aaron Allen at 2023-02-24T21:30:10-05:00
Fix ParallelListComp out of scope suggestion
This patch makes it so vars from one block of a parallel list
comprehension are not in scope in a subsequent block during type
checking. This was causing GHC to emit a faulty suggestion when an out
of scope variable shared the occ name of a var from a different block.
Fixes #22940
- - - - -
ece092d0 by Simon Peyton Jones at 2023-02-24T21:30:45-05:00
Fix shadowing bug in prepareAlts
As #23012 showed, GHC.Core.Opt.Simplify.Utils.prepareAlts was
using an OutType to construct an InAlt. When shadowing is in play,
this is outright wrong.
See Note [Shadowing in prepareAlts].
- - - - -
7825fef9 by Sylvain Henry at 2023-02-24T21:31:25-05:00
JS: Store CI perf results (fix #22923)
- - - - -
b56025f4 by Gergő Érdi at 2023-02-27T13:34:22+00:00
Don't specialise incoherent instance applications
Using incoherent instances, there can be situations where two
occurrences of the same overloaded function at the same type use two
different instances (see #22448). For incoherently resolved instances,
we must mark them with `nospec` to avoid the specialiser rewriting one
to the other. This marking is done during the desugaring of the
`WpEvApp` wrapper.
Fixes #22448
Metric Increase:
T15304
- - - - -
d0c7bbed by Tom Ellis at 2023-02-27T20:04:07-05:00
Fix SCC grouping example
- - - - -
f84a8cd4 by Bryan Richter at 2023-02-28T05:58:37-05:00
Mark setnumcapabilities001 fragile
- - - - -
29a04d6e by Bryan Richter at 2023-02-28T05:58:37-05:00
Allow nightly-x86_64-linux-deb10-validate+thread_sanitizer to fail
See #22520
- - - - -
9fa54572 by Cheng Shao at 2023-02-28T05:59:15-05:00
ghc-prim: fix hs_cmpxchg64 function prototype
hs_cmpxchg64 must return a StgWord64, otherwise incorrect runtime
results of 64-bit MO_Cmpxchg will appear in 32-bit unregisterised
builds, which go unnoticed at compile-time due to C implicit casting
in .hc files.
- - - - -
0c200ab7 by Simon Peyton Jones at 2023-02-28T11:10:31-05:00
Account for local rules in specImports
As #23024 showed, in GHC.Core.Opt.Specialise.specImports, we were
generating specialisations (a locally-define function) for imported
functions; and then generating specialisations for those
locally-defined functions. The RULE for the latter should be
attached to the local Id, not put in the rules-for-imported-ids
set.
Fix is easy; similar to what happens in GHC.HsToCore.addExportFlagsAndRules
- - - - -
8b77f9bf by Sylvain Henry at 2023-02-28T11:11:21-05:00
JS: fix for overlap with copyMutableByteArray# (#23033)
The code wasn't taking into account some kind of overlap.
cgrun070 has been extended to test the missing case.
- - - - -
239202a2 by Sylvain Henry at 2023-02-28T11:12:03-05:00
Testsuite: replace some js_skip with req_cmm
req_cmm is more informative than js_skip
- - - - -
7192ef91 by Simon Peyton Jones at 2023-02-28T18:54:59-05:00
Take more care with unlifted bindings in the specialiser
As #22998 showed, we were floating an unlifted binding to top
level, which breaks a Core invariant.
The fix is easy, albeit a little bit conservative. See
Note [Care with unlifted bindings] in GHC.Core.Opt.Specialise
- - - - -
bb500e2a by Simon Peyton Jones at 2023-02-28T18:55:35-05:00
Account for TYPE vs CONSTRAINT in mkSelCo
As #23018 showed, in mkRuntimeRepCo we need to account for coercions
between TYPE and COERCION.
See Note [mkRuntimeRepCo] in GHC.Core.Coercion.
- - - - -
79ffa170 by Ben Gamari at 2023-03-01T04:17:20-05:00
hadrian: Add dependency from lib/settings to mk/config.mk
In 81975ef375de07a0ea5a69596b2077d7f5959182 we attempted to fix #20253
by adding logic to the bindist Makefile to regenerate the `settings`
file from information gleaned by the bindist `configure` script.
However, this fix had no effect as `lib/settings` is shipped in the
binary distribution (to allow in-place use of the binary distribution).
As `lib/settings` already existed and its rule declared no dependencies,
`make` would fail to use the added rule to regenerate it.
Fix this by explicitly declaring a dependency from `lib/settings` on
`mk/config.mk`.
Fixes #22982.
- - - - -
a2a1a1c0 by Sebastian Graf at 2023-03-01T04:17:56-05:00
Revert the main payload of "Make `drop` and `dropWhile` fuse (#18964)"
This reverts the bits affecting fusion of `drop` and `dropWhile` of commit
0f7588b5df1fc7a58d8202761bf1501447e48914 and keeps just the small refactoring
unifying `flipSeqTake` and `flipSeqScanl'` into `flipSeq`.
It also adds a new test for #23021 (which was the reason for reverting) as
well as adds a clarifying comment to T18964.
Fixes #23021, unfixes #18964.
Metric Increase:
T18964
Metric Decrease:
T18964
- - - - -
cf118e2f by Simon Peyton Jones at 2023-03-01T04:18:33-05:00
Refine the test for naughty record selectors
The test for naughtiness in record selectors is surprisingly subtle.
See the revised Note [Naughty record selectors] in GHC.Tc.TyCl.Utils.
Fixes #23038.
- - - - -
86f240ca by romes at 2023-03-01T04:19:10-05:00
fix: Consider strictness annotation in rep_bind
Fixes #23036
- - - - -
1ed573a5 by Richard Eisenberg at 2023-03-02T22:42:06-05:00
Don't suppress *all* Wanteds
Code in GHC.Tc.Errors.reportWanteds suppresses a Wanted if its
rewriters have unfilled coercion holes; see
Note [Wanteds rewrite Wanteds] in GHC.Tc.Types.Constraint.
But if we thereby suppress *all* errors that's really confusing,
and as #22707 shows, GHC goes on without even realising that the
program is broken. Disaster.
This MR arranges to un-suppress them all if they all get suppressed.
Close #22707
- - - - -
8919f341 by Luite Stegeman at 2023-03-02T22:42:45-05:00
Check for platform support for JavaScript foreign imports
GHC was accepting `foreign import javascript` declarations
on non-JavaScript platforms. This adds a check so that these
are only supported on an platform that supports the JavaScript
calling convention.
Fixes #22774
- - - - -
db83f8bb by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Statically assert alignment of Capability
In #22965 we noticed that changes in the size of `Capability` can result
in unsound behavior due to the `align` pragma claiming an alignment
which we don't in practice observe. Avoid this by statically asserting
that the size is a multiple of the alignment.
- - - - -
5f7a4a6d by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Introduce stgMallocAlignedBytes
- - - - -
8a6f745d by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Correctly align Capability allocations
Previously we failed to tell the C allocator that `Capability`s needed
to be aligned, resulting in #22965.
Fixes #22965.
Fixes #22975.
- - - - -
5464c73f by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Drop no-alignment special case for Windows
For reasons that aren't clear, we were previously not giving Capability
the same favorable alignment on Windows that we provided on other
platforms. Fix this.
- - - - -
a86aae8b by Matthew Pickering at 2023-03-02T22:43:59-05:00
constant folding: Correct type of decodeDouble_Int64 rule
The first argument is Int64# unconditionally, so we better produce
something of that type. This fixes a core lint error found in the ad
package.
Fixes #23019
- - - - -
68dd64ff by Zubin Duggal at 2023-03-02T22:44:35-05:00
ncg/aarch64: Handle MULTILINE_COMMENT identically as COMMENTs
Commit 7566fd9de38c67360c090f828923d41587af519c with the fix for #22798 was
incomplete as it failed to handle MULTILINE_COMMENT pseudo-instructions, and
didn't completly fix the compiler panics when compiling with `-fregs-graph`.
Fixes #23002
- - - - -
2f97c861 by Simon Peyton Jones at 2023-03-02T22:45:11-05:00
Get the right in-scope set in etaBodyForJoinPoint
Fixes #23026
- - - - -
45af8482 by David Feuer at 2023-03-03T11:40:47-05:00
Export getSolo from Data.Tuple
Proposed in
[CLC proposal #113](https://github.com/haskell/core-libraries-committee/issues/113)
and
[approved by the CLC](https://github.com/haskell/core-libraries-committee/issues/113#issuecomment-1452452191)
- - - - -
0c694895 by David Feuer at 2023-03-03T11:40:47-05:00
Document getSolo
- - - - -
bd0536af by Simon Peyton Jones at 2023-03-03T11:41:23-05:00
More fixes for `type data` declarations
This MR fixes #23022 and #23023. Specifically
* Beef up Note [Type data declarations] in GHC.Rename.Module,
to make invariant (I1) explicit, and to name the several
wrinkles.
And add references to these specific wrinkles.
* Add a Lint check for invariant (I1) above.
See GHC.Core.Lint.checkTypeDataConOcc
* Disable the `caseRules` for dataToTag# for `type data` values.
See Wrinkle (W2c) in the Note above. Fixes #23023.
* Refine the assertion in dataConRepArgTys, so that it does not
complain about the absence of a wrapper for a `type data` constructor
Fixes #23022.
Acked-by: Simon Peyton Jones <simon.peytonjones at gmail.com>
- - - - -
858f34d5 by Oleg Grenrus at 2023-03-04T01:13:55+02:00
Add decideSymbol, decideChar, decideNat, decTypeRep, decT and hdecT
These all type-level equality decision procedures.
Implementes a CLC proposal https://github.com/haskell/core-libraries-committee/issues/98
- - - - -
bf43ba92 by Simon Peyton Jones at 2023-03-04T01:18:23-05:00
Add test for T22793
- - - - -
c6e1f3cd by Chris Wendt at 2023-03-04T03:35:18-07:00
Fix typo in docs referring to threadLabel
- - - - -
232cfc24 by Simon Peyton Jones at 2023-03-05T19:57:30-05:00
Add regression test for #22328
- - - - -
5ed77deb by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Enable response files for linker if supported
- - - - -
1e0f6c89 by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Synchronize `configure.ac` and `distrib/configure.ac.in`
- - - - -
70560952 by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Fix `hadrian/bindist/config.mk.in`
… as suggested by @bgamari
- - - - -
b042b125 by sheaf at 2023-03-06T17:06:50-05:00
Apply 1 suggestion(s) to 1 file(s)
- - - - -
674b6b81 by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Try to create somewhat portable `ld` command
I cannot figure out a good way to generate an `ld` command
that works on both Linux and macOS. Normally you'd use something
like `AC_LINK_IFELSE` for this purpose (I think), but that won't
let us test response file support.
- - - - -
83b0177e by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Quote variables
… as suggested by @bgamari
- - - - -
845f404d by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Fix configure failure on alpine linux
- - - - -
c56a3ae6 by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Small fixes to configure script
- - - - -
cad5c576 by Andrei Borzenkov at 2023-03-06T17:07:33-05:00
Convert diagnostics in GHC.Rename.Module to proper TcRnMessage (#20115)
I've turned almost all occurrences of TcRnUnknownMessage in GHC.Rename.Module
module into a proper TcRnMessage.
Instead, these TcRnMessage messages were introduced:
TcRnIllegalInstanceHeadDecl
TcRnUnexpectedStandaloneDerivingDecl
TcRnUnusedVariableInRuleDecl
TcRnUnexpectedStandaloneKindSig
TcRnIllegalRuleLhs
TcRnBadAssocRhs
TcRnDuplicateRoleAnnot
TcRnDuplicateKindSig
TcRnIllegalDerivStrategy
TcRnIllegalMultipleDerivClauses
TcRnNoDerivStratSpecified
TcRnStupidThetaInGadt
TcRnBadImplicitSplice
TcRnShadowedTyVarNameInFamResult
TcRnIncorrectTyVarOnLhsOfInjCond
TcRnUnknownTyVarsOnRhsOfInjCond
Was introduced one helper type:
RuleLhsErrReason
- - - - -
c6432eac by Apoorv Ingle at 2023-03-06T23:26:12+00:00
Constraint simplification loop now depends on `ExpansionFuel`
instead of a boolean flag for `CDictCan.cc_pend_sc`.
Pending givens get a fuel of 3 while Wanted and quantified constraints get a fuel of 1.
This helps pending given constraints to keep up with pending wanted constraints in case of
`UndecidableSuperClasses` and superclass expansions while simplifying the infered type.
Adds 3 dynamic flags for controlling the fuels for each type of constraints
`-fgivens-expansion-fuel` for givens `-fwanteds-expansion-fuel` for wanteds and `-fqcs-expansion-fuel` for quantified constraints
Fixes #21909
Added Tests T21909, T21909b
Added Note [Expanding Recursive Superclasses and ExpansionFuel]
- - - - -
a5afc8ab by Bodigrim at 2023-03-06T22:51:01-05:00
Documentation: describe laziness of several function from Data.List
- - - - -
fa559c28 by Ollie Charles at 2023-03-07T20:56:21+00:00
Add `Data.Functor.unzip`
This function is currently present in `Data.List.NonEmpty`, but `Data.Functor`
is a better home for it. This change was discussed and approved by the CLC
at https://github.com/haskell/core-libraries-committee/issues/88.
- - - - -
2aa07708 by MorrowM at 2023-03-07T21:22:22-05:00
Fix documentation for traceWith and friends
- - - - -
f3ff7cb1 by David Binder at 2023-03-08T01:24:17-05:00
Remove utils/hpc subdirectory and its contents
- - - - -
cf98e286 by David Binder at 2023-03-08T01:24:17-05:00
Add git submodule for utils/hpc
- - - - -
605fbbb2 by David Binder at 2023-03-08T01:24:18-05:00
Update commit for utils/hpc git submodule
- - - - -
606793d4 by David Binder at 2023-03-08T01:24:18-05:00
Update commit for utils/hpc git submodule
- - - - -
4158722a by Sylvain Henry at 2023-03-08T01:24:58-05:00
linker: fix linking with aligned sections (#23066)
Take section alignment into account instead of assuming 16 bytes (which
is wrong when the section requires 32 bytes, cf #23066).
- - - - -
1e0d8fdb by Greg Steuck at 2023-03-08T08:59:05-05:00
Change hostSupportsRPaths to report False on OpenBSD
OpenBSD does support -rpath but ghc build process relies on some
related features that don't work there. See ghc/ghc#23011
- - - - -
bed3a292 by Alexis King at 2023-03-08T08:59:53-05:00
bytecode: Fix bitmaps for BCOs used to tag tuples and prim call args
fixes #23068
- - - - -
321d46d9 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts: Drop redundant prototype
- - - - -
abb6070f by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Fix style
- - - - -
be278901 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Deduplicate assertion
- - - - -
b9034639 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts: Fix type issues in Sparks.h
Adds explicit casts to satisfy a C++ compiler.
- - - - -
da7b2b94 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts: Use release ordering when storing thread labels
Since this makes the ByteArray# visible from other cores.
- - - - -
5b7f6576 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts/BlockAlloc: Allow disabling of internal assertions
These can be quite expensive and it is sometimes useful to compile a
DEBUG RTS without them.
- - - - -
6283144f by Ben Gamari at 2023-03-08T15:02:30-05:00
rts/Sanity: Mark pinned_object_blocks
- - - - -
9b528404 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts/Sanity: Look at nonmoving saved_filled lists
- - - - -
0edc5438 by Ben Gamari at 2023-03-08T15:02:30-05:00
Evac: Squash data race in eval_selector_chain
- - - - -
7eab831a by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Clarify implementation
This makes the intent of this implementation a bit clearer.
- - - - -
532262b9 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Clarify comment
- - - - -
bd9cd84b by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Add missing no-op in busy-wait loop
- - - - -
c4e6bfc8 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Don't push empty arrays to update remembered set
Previously the write barrier of resizeSmallArray# incorrectly handled
resizing of zero-sized arrays, pushing an invalid pointer to the update
remembered set.
Fixes #22931.
- - - - -
92227b60 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Fix handling of weak pointers
This fixes an interaction between aging and weak pointer handling which
prevented the finalization of some weak pointers. In particular, weak
pointers could have their keys incorrectly marked by the preparatory
collector, preventing their finalization by the subsequent concurrent
collection.
While in the area, we also significantly improve the assertions
regarding weak pointers.
Fixes #22327.
- - - - -
ba7e7972 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Sanity check nonmoving large objects and compacts
- - - - -
71b038a1 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Sanity check mutable list
Assert that entries in the nonmoving generation's generational
remembered set (a.k.a. mutable list) live in nonmoving generation.
- - - - -
99d144d5 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Don't show occupancy if we didn't collect live words
- - - - -
81d6cc55 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Fix tracking of FILLED_SWEEPING segments
Previously we only updated the state of the segment at the head of each
allocator's filled list.
- - - - -
58e53bc4 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Assert state of swept segments
- - - - -
2db92e01 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Handle new closures in nonmovingIsNowAlive
We must conservatively assume that new closures are reachable since we
are not guaranteed to mark such blocks.
- - - - -
e4c3249f by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Don't clobber update rem sets of old capabilities
Previously `storageAddCapabilities` (called by `setNumCapabilities`) would
clobber the update remembered sets of existing capabilities when
increasing the capability count. Fix this by only initializing the
update remembered sets of the newly-created capabilities.
Fixes #22927.
- - - - -
1b069671 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Add missing write barriers in selector optimisation
This fixes the selector optimisation, adding a few write barriers which
are necessary for soundness. See the inline comments for details.
Fixes #22930.
- - - - -
d4032690 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Post-sweep sanity checking
- - - - -
0baa8752 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Avoid n_caps race
- - - - -
5d3232ba by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Don't push if nonmoving collector isn't enabled
- - - - -
0a7eb0aa by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Be more paranoid in segment tracking
Previously we left various segment link pointers dangling. None of this
wrong per se, but it did make it harder than necessary to debug.
- - - - -
7c817c0a by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Sync-phase mark budgeting
Here we significantly improve the bound on sync phase pause times by
imposing a limit on the amount of work that we can perform during the
sync. If we find that we have exceeded our marking budget then we allow
the mutators to resume, return to concurrent marking, and try
synchronizing again later.
Fixes #22929.
- - - - -
ce22a3e2 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Allow pinned gen0 objects to be WEAK keys
- - - - -
78746906 by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Reenable assertion
- - - - -
b500867a by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Move current segment array into Capability
The current segments are conceptually owned by the mutator, not the
collector. Consequently, it was quite tricky to prove that the mutator
would not race with the collect due to this shared state. It turns out
that such races are possible: when resizing the current segment array
we may concurrently try to take a heap census. This will attempt to walk
the current segment array, causing a data race.
Fix this by moving the current segment array into `Capability`, where it
belongs.
Fixes #22926.
- - - - -
56e669c1 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Fix Note references
Some references to Note [Deadlock detection under the non-moving
collector] were missing an article.
- - - - -
4a7650d7 by Ben Gamari at 2023-03-08T15:02:31-05:00
rts/Sanity: Fix block count assertion with non-moving collector
The nonmoving collector does not use `oldest_gen->blocks` to track its
block list. However, it nevertheless updates `oldest_gen->n_blocks` to
ensure that its size is accounted for by the storage manager.
Consequently, we must not attempt to assert consistency between the two.
- - - - -
96a5aaed by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Don't call prepareUnloadCheck
When the nonmoving GC is in use we do not call `checkUnload` (since we
don't unload code) and therefore should not call `prepareUnloadCheck`,
lest we run into assertions.
- - - - -
6c6674ca by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Encapsulate block allocator spinlock
This makes it a bit easier to add instrumentation on this spinlock
while debugging.
- - - - -
e84f7167 by Ben Gamari at 2023-03-08T15:02:31-05:00
testsuite: Skip some tests when sanity checking is enabled
- - - - -
3ae0f368 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Fix unregisterised build
- - - - -
4eb9d06b by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Ensure that sanity checker accounts for saved_filled segments
- - - - -
f0cf384d by Ben Gamari at 2023-03-08T15:02:31-05:00
hadrian: Add +boot_nonmoving_gc flavour transformer
For using GHC bootstrapping to validate the non-moving GC.
- - - - -
581e58ac by Ben Gamari at 2023-03-08T15:02:31-05:00
gitlab-ci: Add job bootstrapping with nonmoving GC
- - - - -
487a8b58 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Move allocator into new source file
- - - - -
8f374139 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Split out nonmovingAllocateGC
- - - - -
662b6166 by Ben Gamari at 2023-03-08T15:02:31-05:00
testsuite: Only run T22795* in the normal way
It doesn't make sense to run these in multiple ways as they merely test
whether `-threaded`/`-single-threaded` flags.
- - - - -
0af21dfa by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Rename clear_segment(_free_blocks)?
To reflect the fact that these are to do with the nonmoving collector,
now since they are exposed no longer static.
- - - - -
7bcb192b by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Fix incorrect STATIC_INLINE
This should be INLINE_HEADER lest we get unused declaration warnings.
- - - - -
f1fd3ffb by Ben Gamari at 2023-03-08T15:02:31-05:00
testsuite: Mark ffi023 as broken due to #23089
- - - - -
a57f12b3 by Ben Gamari at 2023-03-08T15:02:31-05:00
testsuite: Skip T7160 in the nonmoving way
Finalization order is different under the nonmoving collector.
- - - - -
f6f12a36 by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Capture GC configuration in a struct
The number of distinct arguments passed to GarbageCollect was getting a
bit out of hand.
- - - - -
ba73a807 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Non-concurrent collection
- - - - -
7c813d06 by Alexis King at 2023-03-08T15:03:10-05:00
hadrian: Fix flavour compiler stage options off-by-one error
!9193 pointed out that ghcDebugAssertions was supposed to be a predicate
on the stage of the built compiler, but in practice it was a predicate
on the stage of the compiler used to build. Unfortunately, while it
fixed that issue for ghcDebugAssertions, it documented every other
similar option as behaving the same way when in fact they all used the
old behavior.
The new behavior of ghcDebugAssertions seems more intuitive, so this
commit changes the interpretation of every other option to match. It
also improves the enableProfiledGhc and debugGhc flavour transformers by
making them more selective about which stages in which they build
additional library/RTS ways.
- - - - -
f97c7f6d by Luite Stegeman at 2023-03-09T09:52:09-05:00
Delete created temporary subdirectories at end of session.
This patch adds temporary subdirectories to the list of
paths do clean up at the end of the GHC session. This
fixes warnings about non-empty temporary directories.
Fixes #22952
- - - - -
9ea719f2 by Apoorv Ingle at 2023-03-09T09:52:45-05:00
Fixes #19627.
Previously the solver failed with an unhelpful "solver reached too may iterations" error.
With the fix for #21909 in place we no longer have the possibility of generating such an error if we have `-fconstraint-solver-iteration` > `-fgivens-fuel > `-fwanteds-fuel`. This is true by default, and the said fix also gives programmers a knob to control how hard the solver should try before giving up.
This commit adds:
* Reference to ticket #19627 in the Note [Expanding Recursive Superclasses and ExpansionFuel]
* Test `typecheck/should_fail/T19627.hs` for regression purposes
- - - - -
ec2d93eb by Sebastian Graf at 2023-03-10T10:18:54-05:00
DmdAnal: Fix a panic on OPAQUE and trivial/PAP RHS (#22997)
We should not panic in `add_demands` (now `set_lam_dmds`), because that code
path is legimitely taken for OPAQUE PAP bindings, as in T22997.
Fixes #22997.
- - - - -
5b4628ae by Sylvain Henry at 2023-03-10T10:19:34-05:00
JS: remove dead code for old integer-gmp
- - - - -
bab23279 by Josh Meredith at 2023-03-10T23:24:49-05:00
JS: Fix implementation of MK_JSVAL
- - - - -
ec263a59 by Sebastian Graf at 2023-03-10T23:25:25-05:00
Simplify: Move `wantEtaExpansion` before expensive `do_eta_expand` check
There is no need to run arity analysis and what not if we are not in a
Simplifier phase that eta-expands or if we don't want to eta-expand the
expression in the first place.
Purely a refactoring with the goal of improving compiler perf.
- - - - -
047e9d4f by Josh Meredith at 2023-03-13T03:56:03+00:00
JS: fix implementation of forceBool to use JS backend syntax
- - - - -
559a4804 by Sebastian Graf at 2023-03-13T07:31:23-04:00
Simplifier: `countValArgs` should not count Type args (#23102)
I observed miscompilations while working on !10088 caused by this.
Fixes #23102.
Metric Decrease:
T10421
- - - - -
536d1f90 by Matthew Pickering at 2023-03-13T14:04:49+00:00
Bump Win32 to 2.13.4.0
Updates Win32 submodule
- - - - -
ee17001e by Ben Gamari at 2023-03-13T21:18:24-04:00
ghc-bignum: Drop redundant include-dirs field
- - - - -
c9c26cd6 by Teo Camarasu at 2023-03-16T12:17:50-04:00
Fix BCO creation setting caps when -j > -N
* Remove calls to 'setNumCapabilities' in 'createBCOs'
These calls exist to ensure that 'createBCOs' can benefit from
parallelism. But this is not the right place to call
`setNumCapabilities`. Furthermore the logic differs from that in the
driver causing the capability count to be raised and lowered at each TH
call if -j > -N.
* Remove 'BCOOpts'
No longer needed as it was only used to thread the job count down to `createBCOs`
Resolves #23049
- - - - -
5ddbf5ed by Teo Camarasu at 2023-03-16T12:17:50-04:00
Add changelog entry for #23049
- - - - -
6e3ce9a4 by Ben Gamari at 2023-03-16T12:18:26-04:00
configure: Fix FIND_CXX_STD_LIB test on Darwin
Annoyingly, Darwin's <cstddef> includes <version> and APFS is
case-insensitive. Consequently, it will end up #including the
`VERSION` file generated by the `configure` script on the second
and subsequent runs of the `configure` script.
See #23116.
- - - - -
19d6d039 by sheaf at 2023-03-16T21:31:22+01:00
ghci: only keep the GlobalRdrEnv in ModInfo
The datatype GHC.UI.Info.ModInfo used to store a ModuleInfo,
which includes a TypeEnv. This can easily cause space leaks as we
have no way of forcing everything in a type environment.
In GHC, we only use the GlobalRdrEnv, which we can force completely.
So we only store that instead of a fully-fledged ModuleInfo.
- - - - -
73d07c6e by Torsten Schmits at 2023-03-17T14:36:49-04:00
Add structured error messages for GHC.Tc.Utils.Backpack
Tracking ticket: #20119
MR: !10127
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
One occurrence, when handing a nested error from the interface loading
machinery, was omitted. It will be handled by a subsequent changeset
that addresses interface errors.
- - - - -
a13affce by Andrei Borzenkov at 2023-03-21T11:17:17-04:00
Rename () into Unit, (,,...,,) into Tuple<n> (#21294)
This patch implements a part of GHC Proposal #475.
The key change is in GHC.Tuple.Prim:
- data () = ()
- data (a,b) = (a,b)
- data (a,b,c) = (a,b,c)
...
+ data Unit = ()
+ data Tuple2 a b = (a,b)
+ data Tuple3 a b c = (a,b,c)
...
And the rest of the patch makes sure that Unit and Tuple<n>
are pretty-printed as () and (,,...,,) in various contexts.
Updates the haddock submodule.
Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com>
- - - - -
23642bf6 by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: fix some wrongs in the eventlog format documentation
- - - - -
90159773 by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: explain the BLOCK_MARKER event
- - - - -
ab1c25e8 by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: add BlockedOnMVarRead thread status in eventlog encodings
- - - - -
898afaef by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: add TASK_DELETE event in eventlog encodings
- - - - -
bb05b4cc by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: add WALL_CLOCK_TIME event in eventlog encodings
- - - - -
eeea0343 by Torsten Schmits at 2023-03-21T11:18:34-04:00
Add structured error messages for GHC.Tc.Utils.Env
Tracking ticket: #20119
MR: !10129
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
be1d4be8 by Bodigrim at 2023-03-21T11:19:13-04:00
Document pdep / pext primops
- - - - -
e8b4aac4 by Alex Mason at 2023-03-21T18:11:04-04:00
Allow LLVM backend to use HDoc for faster file generation.
Also remove the MetaStmt constructor from LlvmStatement and places the annotations into the Store statement.
Includes “Implement a workaround for -no-asm-shortcutting bug“ (https://gitlab.haskell.org/ghc/ghc/-/commit/2fda9e0df886cc551e2cd6b9c2a384192bdc3045)
- - - - -
ea24360d by Luite Stegeman at 2023-03-21T18:11:44-04:00
Compute LambdaFormInfo when using JavaScript backend.
CmmCgInfos is needed to write interface files, but the
JavaScript backend does not generate it, causing
"Name without LFInfo" warnings.
This patch adds a conservative but always correct
CmmCgInfos when the JavaScript backend is used.
Fixes #23053
- - - - -
926ad6de by Simon Peyton Jones at 2023-03-22T01:03:08-04:00
Be more careful about quantification
This MR is driven by #23051. It does several things:
* It is guided by the generalisation plan described in #20686.
But it is still far from a complete implementation of that plan.
* Add Note [Inferred type with escaping kind] to GHC.Tc.Gen.Bind.
This explains that we don't (yet, pending #20686) directly
prevent generalising over escaping kinds.
* In `GHC.Tc.Utils.TcMType.defaultTyVar` we default RuntimeRep
and Multiplicity variables, beause we don't want to quantify over
them. We want to do the same for a Concrete tyvar, but there is
nothing sensible to default it to (unless it has kind RuntimeRep,
in which case it'll be caught by an earlier case). So we promote
instead.
* Pure refactoring in GHC.Tc.Solver:
* Rename decideMonoTyVars to decidePromotedTyVars, since that's
what it does.
* Move the actual promotion of the tyvars-to-promote from
`defaultTyVarsAndSimplify` to `decidePromotedTyVars`. This is a
no-op; just tidies up the code. E.g then we don't need to
return the promoted tyvars from `decidePromotedTyVars`.
* A little refactoring in `defaultTyVarsAndSimplify`, but no
change in behaviour.
* When making a TauTv unification variable into a ConcreteTv
(in GHC.Tc.Utils.Concrete.makeTypeConcrete), preserve the occ-name
of the type variable. This just improves error messages.
* Kill off dead code: GHC.Tc.Utils.TcMType.newConcreteHole
- - - - -
0ab0cc11 by Sylvain Henry at 2023-03-22T01:03:48-04:00
Testsuite: use appropriate predicate for ManyUbxSums test (#22576)
- - - - -
048c881e by romes at 2023-03-22T01:04:24-04:00
fix: Incorrect @since annotations in GHC.TypeError
Fixes #23128
- - - - -
a1528b68 by Sylvain Henry at 2023-03-22T01:05:04-04:00
Testsuite: use req_interp predicate for T16318 (#22370)
- - - - -
ad765b6f by Sylvain Henry at 2023-03-22T01:05:04-04:00
Testsuite: use req_interp predicate for T20214
- - - - -
e0b8eaf3 by Simon Peyton Jones at 2023-03-22T09:50:13+00:00
Refactor the constraint solver pipeline
The big change is to put the entire type-equality solver into
GHC.Tc.Solver.Equality, rather than scattering it over Canonical
and Interact. Other changes
* EqCt becomes its own data type, a bit like QCInst. This is
great because EqualCtList is then just [EqCt]
* New module GHC.Tc.Solver.Dict has come of the class-contraint
solver. In due course it will be all. One step at a time.
This MR is intended to have zero change in behaviour: it is a
pure refactor. It opens the way to subsequent tidying up, we
believe.
- - - - -
cedf9a3b by Torsten Schmits at 2023-03-22T15:31:18-04:00
Add structured error messages for GHC.Tc.Utils.TcMType
Tracking ticket: #20119
MR: !10138
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
30d45e97 by Sylvain Henry at 2023-03-22T15:32:01-04:00
Testsuite: use js_skip for T2615 (#22374)
- - - - -
8c98deba by Armando Ramirez at 2023-03-23T09:19:32-04:00
Optimized Foldable methods for Data.Functor.Compose
Explicitly define length, elem, etc. in Foldable instance for Data.Functor.Compose
Implementation of https://github.com/haskell/core-libraries-committee/issues/57
- - - - -
bc066108 by Armando Ramirez at 2023-03-23T09:19:32-04:00
Additional optimized versions
- - - - -
80fce576 by Bodigrim at 2023-03-23T09:19:32-04:00
Simplify minimum/maximum in instance Foldable (Compose f g)
- - - - -
8cb88a5a by Bodigrim at 2023-03-23T09:19:32-04:00
Update changelog to mention changes to instance Foldable (Compose f g)
- - - - -
e1c8c41d by Torsten Schmits at 2023-03-23T09:20:13-04:00
Add structured error messages for GHC.Tc.TyCl.PatSyn
Tracking ticket: #20117
MR: !10158
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
f932c589 by Adam Gundry at 2023-03-24T02:36:09-04:00
Allow WARNING pragmas to be controlled with custom categories
Closes #17209. This implements GHC Proposal 541, allowing a WARNING
pragma to be annotated with a category like so:
{-# WARNING in "x-partial" head "This function is undefined on empty lists." #-}
The user can then enable, disable and set the severity of such warnings
using command-line flags `-Wx-partial`, `-Werror=x-partial` and so on. There
is a new warning group `-Wextended-warnings` containing all these warnings.
Warnings without a category are treated as if the category was `deprecations`,
and are (still) controlled by the flags `-Wdeprecations`
and `-Wwarnings-deprecations`.
Updates Haddock submodule.
- - - - -
0426515b by Adam Gundry at 2023-03-24T02:36:09-04:00
Move mention of warning groups change to 9.8.1 release notes
- - - - -
b8d783d2 by Ben Gamari at 2023-03-24T02:36:45-04:00
nativeGen/AArch64: Fix bitmask immediate predicate
Previously the predicate for determining whether a logical instruction
operand could be encoded as a bitmask immediate was far too
conservative. This meant that, e.g., pointer untagged required five
instructions whereas it should only require one.
Fixes #23030.
- - - - -
46120bb6 by Joachim Breitner at 2023-03-24T13:09:43-04:00
User's guide: Improve docs for -Wall
previously it would list the warnings _not_ enabled by -Wall. That’s
unnecessary round-about and was out of date. So let's just name
the relevant warnings (based on `compiler/GHC/Driver/Flags.hs`).
- - - - -
509d1f11 by Ben Gamari at 2023-03-24T13:10:20-04:00
codeGen/tsan: Disable instrumentation of unaligned stores
There is some disagreement regarding the prototype of
`__tsan_unaligned_write` (specifically whether it takes just the written
address, or the address and the value as an argument). Moreover, I have
observed crashes which appear to be due to it. Disable instrumentation
of unaligned stores as a temporary mitigation.
Fixes #23096.
- - - - -
6a73655f by Li-yao Xia at 2023-03-25T00:02:44-04:00
base: Document GHC versions associated with past base versions in the changelog
- - - - -
43bd7694 by Teo Camarasu at 2023-03-25T00:03:24-04:00
Add regression test for #17574
This test currently fails in the nonmoving way
- - - - -
f2d56bf7 by Teo Camarasu at 2023-03-25T00:03:24-04:00
fix: account for large and compact object stats with nonmoving gc
Make sure that we keep track of the size of large and compact objects that have been moved onto the nonmoving heap.
We keep track of their size and add it to the amount of live bytes in nonmoving segments to get the total size of the live nonmoving heap.
Resolves #17574
- - - - -
7131b705 by David Feuer at 2023-03-25T00:04:04-04:00
Modify ThreadId documentation and comments
For a long time, `GHC.Conc.Sync` has said
```haskell
-- ToDo: data ThreadId = ThreadId (Weak ThreadId#)
-- But since ThreadId# is unlifted, the Weak type must use open
-- type variables.
```
We are now actually capable of using `Weak# ThreadId#`, but the
world has moved on. To support the `Show` and `Ord` instances, we'd
need to store the thread ID number in the `ThreadId`. And it seems
very difficult to continue to support `threadStatus` in that regime,
since it needs to be able to explain how threads died. In addition,
garbage collection of weak references can be quite expensive, and it
would be hard to evaluate the cost over he whole ecosystem. As discussed
in
[this CLC issue](https://github.com/haskell/core-libraries-committee/issues/125),
it doesn't seem very likely that we'll actually switch to weak
references here.
- - - - -
c421bbbb by Ben Gamari at 2023-03-25T00:04:41-04:00
rts: Fix barriers of IND and IND_STATIC
Previously IND and IND_STATIC lacked the acquire barriers enjoyed by
BLACKHOLE. As noted in the (now updated) Note [Heap memory barriers],
this barrier is critical to ensure that the indirectee is visible to the
entering core.
Fixes #22872.
- - - - -
62fa7faa by Bodigrim at 2023-03-25T00:05:22-04:00
Improve documentation of atomicModifyMutVar2#
- - - - -
b2d14d0b by Cheng Shao at 2023-03-25T03:46:43-04:00
rts: use performBlockingMajorGC in hs_perform_gc and fix ffi023
This patch does a few things:
- Add the missing RtsSymbols.c entry of performBlockingMajorGC
- Make hs_perform_gc call performBlockingMajorGC, which restores
previous behavior
- Use hs_perform_gc in ffi023
- Remove rts_clearMemory() call in ffi023, it now works again in some
test ways previously marked as broken. Fixes #23089
- - - - -
d9ae24ad by Cheng Shao at 2023-03-25T03:46:44-04:00
testsuite: add the rts_clearMemory test case
This patch adds a standalone test case for rts_clearMemory that mimics
how it's typically used by wasm backend users and ensures this RTS API
isn't broken by future RTS refactorings. Fixes #23901.
- - - - -
80729d96 by Bodigrim at 2023-03-25T03:47:22-04:00
Improve documentation for resizing of byte arrays
- - - - -
c6ec4cd1 by Ben Gamari at 2023-03-25T20:23:47-04:00
rts: Don't rely on EXTERN_INLINE for slop-zeroing logic
Previously we relied on calling EXTERN_INLINE functions defined in
ClosureMacros.h from Cmm to zero slop. However, as far as I can tell,
this is no longer safe to do in C99 as EXTERN_INLINE definitions may be emitted
in each compilation unit.
Fix this by explicitly declaring a new set of non-inline functions in
ZeroSlop.c which can be called from Cmm and marking the ClosureMacros.h
definitions as INLINE_HEADER.
In the future we should try to eliminate EXTERN_INLINE.
- - - - -
c32abd4b by Ben Gamari at 2023-03-25T20:23:48-04:00
rts: Fix capability-count check in zeroSlop
Previously `zeroSlop` examined `RtsFlags` to determine whether the
program was single-threaded. This is wrong; a program may be started
with `+RTS -N1` yet the process may later increase the capability count
with `setNumCapabilities`. This lead to quite subtle and rare crashes.
Fixes #23088.
- - - - -
656d4cb3 by Ryan Scott at 2023-03-25T20:24:23-04:00
Add Eq/Ord instances for SSymbol, SChar, and SNat
This implements [CLC proposal #148](https://github.com/haskell/core-libraries-committee/issues/148).
- - - - -
4f93de88 by David Feuer at 2023-03-26T15:33:02-04:00
Update and expand atomic modification Haddocks
* The documentation for `atomicModifyIORef` and `atomicModifyIORef'`
were incomplete, and the documentation for `atomicModifyIORef` was
out of date. Update and expand.
* Remove a useless lazy pattern match in the definition of
`atomicModifyIORef`. The pair it claims to match lazily
was already forced by `atomicModifyIORef2`.
- - - - -
e1fb56b2 by David Feuer at 2023-03-26T15:33:41-04:00
Document the constructor name for lists
Derived `Data` instances use raw infix constructor names when applicable.
The `Data.Data [a]` instance, if derived, would have a constructor name
of `":"`. However, it actually uses constructor name `"(:)"`. Document this
peculiarity.
See https://github.com/haskell/core-libraries-committee/issues/147
- - - - -
c1f755c4 by Simon Peyton Jones at 2023-03-27T22:09:41+01:00
Make exprIsConApp_maybe a bit cleverer
Addresses #23159.
See Note Note [Exploit occ-info in exprIsConApp_maybe]
in GHC.Core.SimpleOpt.
Compile times go down very slightly, but always go down,
never up. Good!
Metrics: compile_time/bytes allocated
------------------------------------------------
CoOpt_Singletons(normal) -1.8%
T15703(normal) -1.2% GOOD
geo. mean -0.1%
minimum -1.8%
maximum +0.0%
Metric Decrease:
CoOpt_Singletons
T15703
- - - - -
76bb4c58 by Ryan Scott at 2023-03-28T08:12:08-04:00
Add COMPLETE pragmas to TypeRep, SSymbol, SChar, and SNat
This implements
[CLC proposal #149](https://github.com/haskell/core-libraries-committee/issues/149).
- - - - -
3f374399 by sheaf at 2023-03-29T13:57:33+02:00
Handle records in the renamer
This patch moves the field-based logic for disambiguating record updates
to the renamer. The type-directed logic, scheduled for removal, remains
in the typechecker.
To do this properly (and fix the myriad of bugs surrounding the treatment
of duplicate record fields), we took the following main steps:
1. Create GREInfo, a renamer-level equivalent to TyThing which stores
information pertinent to the renamer.
This allows us to uniformly treat imported and local Names in the
renamer, as described in Note [GREInfo].
2. Remove GreName. Instead of a GlobalRdrElt storing GreNames, which
distinguished between normal names and field names, we now store
simple Names in GlobalRdrElt, along with the new GREInfo information
which allows us to recover the FieldLabel for record fields.
3. Add namespacing for record fields, within the OccNames themselves.
This allows us to remove the mangling of duplicate field selectors.
This change ensures we don't print mangled names to the user in
error messages, and allows us to handle duplicate record fields
in Template Haskell.
4. Move record disambiguation to the renamer, and operate on the
level of data constructors instead, to handle #21443.
The error message text for ambiguous record updates has also been
changed to reflect that type-directed disambiguation is on the way
out.
(3) means that OccEnv is now a bit more complex: we first key on the
textual name, which gives an inner map keyed on NameSpace:
OccEnv a ~ FastStringEnv (UniqFM NameSpace a)
Note that this change, along with (2), both increase the memory residency
of GlobalRdrEnv = OccEnv [GlobalRdrElt], which causes a few tests to
regress somewhat in compile-time allocation.
Even though (3) simplified a lot of code (in particular the treatment of
field selectors within Template Haskell and in error messages), it came
with one important wrinkle: in the situation of
-- M.hs-boot
module M where { data A; foo :: A -> Int }
-- M.hs
module M where { data A = MkA { foo :: Int } }
we have that M.hs-boot exports a variable foo, which is supposed to match
with the record field foo that M exports. To solve this issue, we add a
new impedance-matching binding to M
foo{var} = foo{fld}
This mimics the logic that existed already for impedance-binding DFunIds,
but getting it right was a bit tricky.
See Note [Record field impedance matching] in GHC.Tc.Module.
We also needed to be careful to avoid introducing space leaks in GHCi.
So we dehydrate the GlobalRdrEnv before storing it anywhere, e.g. in
ModIface. This means stubbing out all the GREInfo fields, with the
function forceGlobalRdrEnv.
When we read it back in, we rehydrate with rehydrateGlobalRdrEnv.
This robustly avoids any space leaks caused by retaining old type
environments.
Fixes #13352 #14848 #17381 #17551 #19664 #21443 #21444 #21720 #21898 #21946 #21959 #22125 #22160 #23010 #23062 #23063
Updates haddock submodule
-------------------------
Metric Increase:
MultiComponentModules
MultiLayerModules
MultiLayerModulesDefsGhci
MultiLayerModulesNoCode
T13701
T14697
hard_hole_fits
-------------------------
- - - - -
4f1940f0 by sheaf at 2023-03-29T13:57:33+02:00
Avoid repeatedly shadowing in shadowNames
This commit refactors GHC.Type.Name.Reader.shadowNames to first
accumulate all the shadowing arising from the introduction of a new
set of GREs, and then applies all the shadowing to the old GlobalRdrEnv
in one go.
- - - - -
d246049c by sheaf at 2023-03-29T13:57:34+02:00
igre_prompt_env: discard "only-qualified" names
We were unnecessarily carrying around names only available qualified
in igre_prompt_env, violating the icReaderEnv invariant.
We now get rid of these, as they aren't needed for the shadowing
computation that igre_prompt_env exists for.
Fixes #23177
-------------------------
Metric Decrease:
T14052
T14052Type
-------------------------
- - - - -
41a572f6 by Matthew Pickering at 2023-03-29T16:17:21-04:00
hadrian: Fix path to HpcParser.y
The source for this project has been moved into a src/ folder so we also
need to update this path.
Fixes #23187
- - - - -
b159e0e9 by doyougnu at 2023-03-30T01:40:08-04:00
js: split JMacro into JS eDSL and JS syntax
This commit:
Splits JExpr and JStat into two nearly identical DSLs:
- GHC.JS.Syntax is the JMacro based DSL without unsaturation, i.e., a
value cannot be unsaturated, or, a value of this DSL is a witness that a
value of GHC.JS.Unsat has been saturated
- GHC.JS.Unsat is the JMacro DSL from GHCJS with Unsaturation.
Then all binary and outputable instances are changed to use
GHC.JS.Syntax.
This moves us closer to closing out #22736 and #22352. See #22736 for
roadmap.
-------------------------
Metric Increase:
CoOpt_Read
LargeRecord
ManyAlternatives
PmSeriesS
PmSeriesT
PmSeriesV
T10421
T10858
T11195
T11374
T11822
T12227
T12707
T13035
T13253
T13253-spj
T13379
T14683
T15164
T15703
T16577
T17096
T17516
T17836
T18140
T18282
T18304
T18478
T18698a
T18698b
T18923
T1969
T19695
T20049
T21839c
T3064
T4801
T5321FD
T5321Fun
T5631
T5642
T783
T9198
T9233
T9630
TcPlugin_RewritePerf
WWRec
-------------------------
- - - - -
f4f1f14f by Sylvain Henry at 2023-03-30T01:40:49-04:00
ghc-heap: remove wrong Addr# coercion (#23181)
Conversion from Addr# to I# isn't correct with the JS backend.
Also used the opportunity to reenable 64-bit Word/Int tests
- - - - -
a5360490 by Ben Gamari at 2023-03-30T01:41:25-04:00
testsuite: Fix racing prints in T21465
As noted in #23155, we previously failed to add flushes necessary to
ensure predictable output.
Fixes #23155.
- - - - -
98b5cf67 by Matthew Pickering at 2023-03-30T09:58:40+01:00
Revert "ghc-heap: remove wrong Addr# coercion (#23181)"
This reverts commit f4f1f14f8009c3c120b8b963ec130cbbc774ec02.
This fails to build with GHC-9.2 as a boot compiler.
See #23195 for tracking this issue.
- - - - -
61a2dfaa by Bodigrim at 2023-03-30T14:35:57-04:00
Add {-# WARNING #-} to Data.List.{head,tail}
- - - - -
8f15c47c by Bodigrim at 2023-03-30T14:35:57-04:00
Fixes to accomodate Data.List.{head,tail} with {-# WARNING #-}
- - - - -
7c7dbade by Bodigrim at 2023-03-30T14:35:57-04:00
Bump submodules
- - - - -
d2d8251b by Bodigrim at 2023-03-30T14:35:57-04:00
Fix tests
- - - - -
3d38dcb6 by sheaf at 2023-03-30T14:35:57-04:00
Proxies for head and tail: review suggestions
- - - - -
930edcfd by sheaf at 2023-03-30T14:36:33-04:00
docs: move RecordUpd changelog entry to 9.8
This was accidentally included in the 9.6 changelog
instead of the 9.6 changelog.
- - - - -
6f885e65 by sheaf at 2023-03-30T14:37:09-04:00
Add LANGUAGE GADTs to GHC.Rename.Env
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.
- - - - -
6d6a37a8 by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: make lint-ci-config job fast again
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.
- - - - -
ef1548c4 by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: ensure that all non-i386 pipelines do parallel xz compression
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.
- - - - -
20432d16 by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: unset CROSS_EMULATOR for js job
- - - - -
4a24dbbe by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: fix lint-testsuite job
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.
- - - - -
cea56ccc by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: use alpine3_17-wasm image for wasm jobs
Bump the ci-images dependency and use the new alpine3_17-wasm docker
image for wasm jobs.
- - - - -
79d0cb32 by Ben Gamari at 2023-03-30T18:43:53+00:00
testsuite/driver: Add basic support for testing cross-compilers
- - - - -
e7392b4e by Ben Gamari at 2023-03-30T18:43:53+00:00
testsuite/driver: Normalize away differences in ghc executable name
- - - - -
ee160d06 by Ben Gamari at 2023-03-30T18:43:53+00:00
hadrian: Pass CROSS_EMULATOR to runtests.py
- - - - -
30c84511 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: don't add optllvm way for wasm32
- - - - -
f1beee36 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: normalize the .wasm extension
- - - - -
a984a103 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: strip the cross ghc prefix in output and error message
- - - - -
f7478d95 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: handle target executable extension
- - - - -
8fe8b653 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: mypy typing error fixes
This patch fixes some mypy typing errors which weren't caught in
previous linting jobs.
- - - - -
0149f32f by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: use context variable instead of thread-local variable
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.
- - - - -
ea853ff0 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: asyncify the testsuite driver
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.
- - - - -
0077cb22 by Matthew Pickering at 2023-03-31T21:28:28-04:00
Add test for T23184
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 at 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.
- - - - -
62d25071 by mangoiv at 2023-04-01T04:20:01-04:00
[feat] make ($) representation polymorphic
- 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
- - - - -
77c33fb9 by Artem Pelenitsyn at 2023-04-01T04:20:41-04:00
User Guide: update copyright year: 2020->2023
- - - - -
3b5be05a by doyougnu at 2023-04-01T09:42:31-04:00
driver: Unit State Data.Map -> GHC.Unique.UniqMap
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
-------------------------
- - - - -
a84fba6e by Torsten Schmits at 2023-04-01T09:43:12-04:00
Add structured error messages for GHC.Tc.TyCl
Tracking ticket: #20117
MR: !10183
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
6e2eb275 by doyougnu at 2023-04-01T18:27:56-04:00
JS: Linker: use saturated JExpr
Follow on to MR!10142 in pursuit of #22736
- - - - -
3da69346 by sheaf at 2023-04-01T18:28:37-04:00
Improve haddocks of template-haskell Con datatype
This adds a bit more information, in particular about the lists of
constructors in the GadtC and RecGadtC cases.
- - - - -
3b7bbb39 by sheaf at 2023-04-01T18:28:37-04:00
TH: revert changes to GadtC & RecGadtC
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.
- - - - -
f60f6110 by Bodigrim at 2023-04-02T18:59:30-04:00
Rework documentation for data Char
- - - - -
43ebd5dc by Bodigrim at 2023-04-02T19:00:09-04:00
cmm: implement parsing of MO_AtomicRMW from hand-written CMM files
Fixes #23206
- - - - -
ab9cd52d by Sylvain Henry at 2023-04-03T08:15:21-04:00
ghc-heap: remove wrong Addr# coercion (#23181)
Conversion from Addr# to I# isn't correct with the JS backend.
- - - - -
2b2afff3 by Matthew Pickering at 2023-04-03T08:15:58-04:00
hadrian: Update bootstrap plans for 9.2.6, 9.2.7, 9.4.4, 9.4.5, 9.6.1
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.
- - - - -
c2605e25 by Matthew Pickering at 2023-04-03T08:15:58-04:00
ci: Add job to test 9.6 bootstrapping
- - - - -
53e4d513 by Krzysztof Gogolewski at 2023-04-03T08:16:35-04:00
hadrian: Improve option parsing
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.
- - - - -
a8e36892 by Sylvain Henry at 2023-04-03T08:17:16-04:00
JS: fix issues with FD api support
- 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.
- - - - -
8b092910 by Haskell-mouse at 2023-04-03T19:31:26-04:00
Convert diagnostics in GHC.Rename.HsType to proper TcRnMessage
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
- - - - -
220a7a48 by Krzysztof Gogolewski at 2023-04-03T19:32:02-04:00
Fixes around unsafeCoerce#
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.
- - - - -
9095e297 by Matthew Craven at 2023-04-04T01:04:10-04:00
Add a few more memcpy-ish primops
* 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
- - - - -
f7da530c by Matthew Craven at 2023-04-04T01:04:10-04:00
StgToCmm: Upgrade -fcheck-prim-bounds behavior
Fixes #21054. Additionally, we can now check for range overlap
when generating Cmm for primops that use memcpy internally.
- - - - -
cd00e321 by sheaf at 2023-04-04T01:04:50-04:00
Relax assertion in varToRecFieldOcc
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
- - - - -
eed0d930 by Sylvain Henry at 2023-04-04T11:09:15-04:00
GHCi.RemoteTypes: fix doc and avoid unsafeCoerce (#23201)
- - - - -
071139c3 by Ryan Scott at 2023-04-04T11:09:51-04:00
Make INLINE pragmas for pattern synonyms work with TH
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.
- - - - -
7c16f3be by Krzysztof Gogolewski at 2023-04-04T17:13:00-04:00
Fix unification with oversaturated type families
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).
- - - - -
c165f079 by sheaf at 2023-04-04T17:13:40-04:00
Add testcase for #23192
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
- - - - -
d1bb16ed by Ben Gamari at 2023-04-06T03:40:45-04:00
nonmoving: Disable slop-zeroing
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
- - - - -
04b80850 by Brandon Chinn at 2023-04-06T03:41:21-04:00
Fix reverse flag for -Wunsupported-llvm-version
- - - - -
0c990e13 by Pierre Le Marre at 2023-04-06T10:16:29+00:00
Add release note for GHC.Unicode refactor in base-4.18.
Also merge CLC proposal 130 in base-4.19 with CLC proposal 59 in
base-4.18 and add proper release date.
- - - - -
cbbfb283 by Alex Dixon at 2023-04-07T18:27:45-04:00
Improve documentation for ($) (#22963)
- - - - -
5193c2b0 by Alex Dixon at 2023-04-07T18:27:45-04:00
Remove trailing whitespace from ($) commentary
- - - - -
b384523b by Sebastian Graf at 2023-04-07T18:27:45-04:00
Adjust wording wrt representation polymorphism of ($)
- - - - -
6a788f0a by Torsten Schmits at 2023-04-07T22:29:28-04:00
Add structured error messages for GHC.Tc.TyCl.Utils
Tracking ticket: #20117
MR: !10251
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
3ba77b36 by sheaf at 2023-04-07T22:30:07-04:00
Renamer: don't call addUsedGRE on an exact Name
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
- - - - -
bc4795d2 by Krzysztof Gogolewski at 2023-04-11T19:24:54-04:00
Add support for -debug in the testsuite
Confusingly, GhcDebugged referred to GhcDebugAssertions.
- - - - -
b7474b57 by Krzysztof Gogolewski at 2023-04-11T19:24:54-04:00
Add missing cases in -Di prettyprinter
Fixes #23142
- - - - -
6c392616 by Cheng Shao at 2023-04-11T19:25:31-04:00
compiler: make WasmCodeGenM an instance of MonadUnique
- - - - -
05d26a65 by Cheng Shao at 2023-04-11T19:25:31-04:00
compiler: apply cmm node-splitting for wasm backend
This patch applies cmm node-splitting for wasm32 NCG, which is
required when handling irreducible CFGs. Fixes #23237.
- - - - -
f1892cc0 by Bodigrim at 2023-04-11T19:26:09-04:00
Set base 'maintainer' field to CLC
- - - - -
ecf22da3 by Simon Peyton Jones at 2023-04-11T19:26:45-04:00
Clarify a couple of Notes about 'nospec'
- - - - -
ebd8918b by Oleg Grenrus at 2023-04-12T12:32:57-04:00
Allow generation of TTH syntax with TH
In other words allow generation of typed splices and brackets with
Untyped Template Haskell.
That is useful in cases where a library is build with TTH in mind,
but we still want to generate some auxiliary declarations,
where TTH cannot help us, but untyped TH can.
Such example is e.g. `staged-sop` which works with TTH,
but we would like to derive `Generic` declarations with TH.
An alternative approach is to use `unsafeCodeCoerce`, but then the
derived `Generic` instances would be type-checked only at use sites,
i.e. much later. Also `-ddump-splices` output is quite ugly:
user-written instances would use TTH brackets, not `unsafeCodeCoerce`.
This commit doesn't allow generating of untyped template splices
and brackets with untyped TH, as I don't know why one would want to do
that (instead of merging the splices, e.g.)
- - - - -
690d0225 by Rodrigo Mesquita at 2023-04-12T12:33:33-04:00
Add regression test for #23229
- - - - -
59321879 by Sylvain Henry at 2023-04-13T08:50:33-04:00
Add quotRem rules (#22152)
case quotRemInt# x y of
(# q, _ #) -> body
====>
case quotInt# x y of
q -> body
case quotRemInt# x y of
(# _, r #) -> body
====>
case remInt# x y of
r -> body
- - - - -
4dd02122 by Sylvain Henry at 2023-04-13T08:50:33-04:00
Add quot folding rule (#22152)
(x / l1) / l2
l1 and l2 /= 0
l1*l2 doesn't overflow
==> x / (l1 * l2)
- - - - -
1148ac72 by Sylvain Henry at 2023-04-13T08:50:33-04:00
Make Int64/Word64 division ok for speculation too.
Only when the divisor is definitely non-zero.
- - - - -
8af401cc by Sylvain Henry at 2023-04-13T08:50:33-04:00
Make WordQuotRem2Op ok-for-speculation too
- - - - -
27d2978e by Josh Meredith at 2023-04-13T08:51:09-04:00
Base/JS: GHC.JS.Foreign.Callback module (issue 23126)
* 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
- - - - -
a34aa8da by Adam Sandberg Ericsson at 2023-04-14T04:17:52-04:00
rts: improve memory ordering and add some comments in the StablePtr implementation
- - - - -
d7a768a4 by Matthew Pickering at 2023-04-14T04:18:28-04:00
docs: Generate docs/index.html with version number
* Generate docs/index.html to include the version of the ghc library
* This also fixes the packageVersions interpolations which were
- Missing an interpolation for `LIBRARY_ghc_VERSION`
- Double quoting the version so that "9.7" was being inserted.
Fixes #23121
- - - - -
d48fbfea by Simon Peyton Jones at 2023-04-14T04:19:05-04:00
Stop if type constructors have kind errors
Otherwise we get knock-on errors, such as #23252.
This makes GHC fail a bit sooner, and I have not attempted to add
recovery code, to add a fake TyCon place of the erroneous one,
in an attempt to get more type errors in one pass. We could
do that (perhaps) if there was a call for it.
- - - - -
2371d6b2 by Simon Peyton Jones at 2023-04-14T20:01:02+02:00
Major refactor in the handling of equality constraints
This MR substantially refactors the way in which the constraint
solver deals with equality constraints. The big thing is:
* Intead of a pipeline in which we /first/ canonicalise and /then/
interact (the latter including performing unification) the two steps
are more closely integreated into one. That avoids the current
rather indirect communication between the two steps.
The proximate cause for this refactoring is fixing #22194, which involve
solving [W] alpha[2] ~ Maybe (F beta[4])
by doing this:
alpha[2] := Maybe delta[2]
[W] delta[2] ~ F beta[4]
That is, we don't promote beta[4]! This is very like introducing a cycle
breaker, and was very awkward to do before, but now it is all nice.
See GHC.Tc.Utils.Unify Note [Promotion and level-checking] and
Note [Family applications in canonical constraints].
The big change is this:
* Several canonicalisation checks (occurs-check, cycle-breaking,
checking for concreteness) are combined into one new function:
GHC.Tc.Utils.Unify.checkTyEqRhs
This function is controlled by `TyEqFlags`, which says what to do
for foralls, type families etc.
* `canEqCanLHSFinish` now sees if unification is possible, and if so,
actually does it: see `canEqCanLHSFinish_try_unification`.
There are loads of smaller changes:
* The on-the-fly unifier `GHC.Tc.Utils.Unify.unifyType` has a
cheap-and-cheerful version of `checkTyEqRhs`, called
`simpleUnifyCheck`. If `simpleUnifyCheck` succeeds, it can unify,
otherwise it defers by emitting a constraint. This is simpler than
before.
* I simplified the swapping code in `GHC.Tc.Solver.Equality.canEqCanLHS`.
Especially the nasty stuff involving `swap_for_occurs` and
`canEqTyVarFunEq`. Much nicer now. See
Note [Orienting TyVarLHS/TyFamLHS]
Note [Orienting TyFamLHS/TyFamLHS]
* Added `cteSkolemOccurs`, `cteConcrete`, and `cteCoercionHole` to the
problems that can be discovered by `checkTyEqRhs`.
* I fixed #23199 `pickQuantifiablePreds`, which actually allows GHC to
to accept both cases in #22194 rather than rejecting both.
Yet smaller:
* Added a `synIsConcrete` flag to `SynonymTyCon` (alongside `synIsFamFree`)
to reduce the need for synonym expansion when checking concreteness.
Use it in `isConcreteType`.
* Renamed `isConcrete` to `isConcreteType`
* Defined `GHC.Core.TyCo.FVs.isInjectiveInType` as a more efficient
way to find if a particular type variable is used injectively than
finding all the injective variables. It is called in
`GHC.Tc.Utils.Unify.definitely_poly`, which in turn is used quite a
lot.
* Moved `rewriterView` to `GHC.Core.Type`, so we can use it from the
constraint solver.
Fixes #22194, #23199
Compile times decrease by an average of 0.1%; but there is a 7.4%
drop in compiler allocation on T15703.
Metric Decrease:
T15703
- - - - -
99b2734b by Simon Peyton Jones at 2023-04-14T20:01:02+02:00
Add some documentation about redundant constraints
- - - - -
3f2d0eb8 by Simon Peyton Jones at 2023-04-14T20:01:02+02:00
Improve partial signatures
This MR fixes #23223. The changes are in two places:
* GHC.Tc.Bind.checkMonomorphismRestriction
See the new `Note [When the MR applies]`
We now no longer stupidly attempt to apply the MR when the user
specifies a context, e.g. f :: Eq a => _ -> _
* GHC.Tc.Solver.decideQuantification
See rewritten `Note [Constraints in partial type signatures]`
Fixing this bug apparently breaks three tests:
* partial-sigs/should_compile/T11192
* partial-sigs/should_fail/Defaulting1MROff
* partial-sigs/should_fail/T11122
However they are all symptoms of #23232, so I'm marking them as
expect_broken(23232).
I feel happy about this MR. Nice.
- - - - -
23e2a8a0 by Simon Peyton Jones at 2023-04-14T20:01:02+02:00
Make approximateWC a bit cleverer
This MR fixes #23224: making approximateWC more clever
See the long `Note [ApproximateWC]` in GHC.Tc.Solver
All this is delicate and ad-hoc -- but it /has/ to be: we are
talking about inferring a type for a binding in the presence of
GADTs, type families and whatnot: known difficult territory.
We just try as hard as we can.
- - - - -
2c040246 by Matthew Pickering at 2023-04-15T00:57:14-04:00
docs: Update template-haskell docs to use Code Q a rather than Q (TExp a)
Since GHC Proposal #195, the type of [|| ... ||] has been Code Q a
rather than Q (TExp a). The documentation in the `template-haskell`
library wasn't updated to reflect this change.
Fixes #23148
- - - - -
0da18eb7 by Krzysztof Gogolewski at 2023-04-15T14:35:53+02:00
Show an error when we cannot default a concrete tyvar
Fixes #23153
- - - - -
bad2f8b8 by sheaf at 2023-04-15T15:14:36+02:00
Handle ConcreteTvs in inferResultToType
inferResultToType was discarding the ir_frr information, which meant
some metavariables ended up being MetaTvs instead of ConcreteTvs.
This function now creates new ConcreteTvs as necessary, instead of
always creating MetaTvs.
Fixes #23154
- - - - -
3b0ea480 by Simon Peyton Jones at 2023-04-16T18:12:20-04:00
Transfer DFunId_ness onto specialised bindings
Whether a binding is a DFunId or not has consequences for the `-fdicts-strict`
flag, essentially if we are doing demand analysis for a DFunId then `-fdicts-strict` does
not apply because the constraint solver can create recursive groups of dictionaries.
In #22549 this was fixed for the "normal" case, see
Note [Do not strictify the argument dictionaries of a dfun].
However the loop still existed if the DFunId was being specialised.
The problem was that the specialiser would specialise a DFunId and
turn it into a VanillaId and so the demand analyser didn't know to
apply special treatment to the binding anymore and the whole recursive
group was optimised to bottom.
The solution is to transfer over the DFunId-ness of the binding in the specialiser so
that the demand analyser knows not to apply the `-fstrict-dicts`.
Fixes #22549
- - - - -
a1371ebb by Oleg Grenrus at 2023-04-16T18:12:59-04:00
Add import lists to few GHC.Driver.Session imports
Related to https://gitlab.haskell.org/ghc/ghc/-/issues/23261.
There are a lot of GHC.Driver.Session which only use DynFlags,
but not the parsing code.
- - - - -
51479ceb by Matthew Pickering at 2023-04-17T08:08:48-04:00
Account for special GHC.Prim import in warnUnusedPackages
The GHC.Prim import is treated quite specially primarily because there
isn't an interface file for GHC.Prim. Therefore we record separately in
the ModSummary if it's imported or not so we don't go looking for it.
This logic hasn't made it's way to `-Wunused-packages` so if you
imported GHC.Prim then the warning would complain you didn't use
`-package ghc-prim`.
Fixes #23212
- - - - -
1532a8b2 by Simon Peyton Jones at 2023-04-17T08:09:24-04:00
Add regression test for #23199
- - - - -
0158c5f1 by Ryan Scott at 2023-04-17T18:43:27-04:00
validDerivPred: Reject exotic constraints in IrredPreds
This brings the `IrredPred` case in sync with the treatment of `ClassPred`s as
described in `Note [Valid 'deriving' predicate]` in `GHC.Tc.Validity`. Namely,
we should reject `IrredPred`s that are inferred from `deriving` clauses whose
arguments contain other type constructors, as described in `(VD2) Reject exotic
constraints` of that Note. This has the nice property that `deriving` clauses
whose inferred instance context mention `TypeError` will now emit the type
error in the resulting error message, which better matches existing intuitions
about how `TypeError` should work.
While I was in town, I noticed that much of `Note [Valid 'deriving' predicate]`
was duplicated in a separate `Note [Exotic derived instance contexts]` in
`GHC.Tc.Deriv.Infer`. I decided to fold the latter Note into the former so that
there is a single authority on describing the conditions under which an
inferred `deriving` constraint can be considered valid.
This changes the behavior of `deriving` in a way that existing code might
break, so I have made a mention of this in the GHC User's Guide. It seems very,
very unlikely that much code is relying on this strange behavior, however, and
even if there is, there is a clear, backwards-compatible migration path using
`StandaloneDeriving`.
Fixes #22696.
- - - - -
10364818 by Krzysztof Gogolewski at 2023-04-17T18:44:03-04:00
Misc cleanup
- Use dedicated list functions
- Make cloneBndrs and cloneRecIdBndrs monadic
- Fix invalid haddock comments in libraries/base
- - - - -
5e1d33d7 by Matthew Pickering at 2023-04-18T10:31:02-04:00
Convert interface file loading errors into proper diagnostics
This patch converts all the errors to do with loading interface files
into proper structured diagnostics.
* DriverMessage: Sometimes in the driver we attempt to load an interface
file so we embed the IfaceMessage into the DriverMessage.
* TcRnMessage: Most the time we are loading interface files during
typechecking, so we embed the IfaceMessage
This patch also removes the TcRnInterfaceLookupError constructor which
is superceded by the IfaceMessage, which is now structured compared to
just storing an SDoc before.
- - - - -
df1a5811 by sheaf at 2023-04-18T10:31:43-04:00
Don't panic in ltPatersonSize
The function GHC.Tc.Utils.TcType.ltPatersonSize would panic when it
encountered a type family on the RHS, as usually these are not allowed
(type families are not allowed on the RHS of class instances or of
quantified constraints). However, it is possible to still encounter
type families on the RHS after doing a bit of constraint solving, as
seen in test case T23171. This could trigger the panic in the call to
ltPatersonSize in GHC.Tc.Solver.Canonical.mk_strict_superclasses, which
is involved in avoiding loopy superclass constraints.
This patch simply changes ltPatersonSize to return "I don't know, because
there's a type family involved" in these cases.
Fixes #23171
- - - - -
d442ac05 by Sylvain Henry at 2023-04-19T20:04:35-04:00
JS: fix thread-related primops
- - - - -
7a96f90b by Bryan Richter at 2023-04-19T20:05:11-04:00
CI: Disable abi-test-nightly
See #23269
- - - - -
ab6c1d29 by Sylvain Henry at 2023-04-19T20:05:50-04:00
Testsuite: don't use obsolescent egrep (#22351)
Recent egrep displays the following message, breaking golden tests:
egrep: warning: egrep is obsolescent; using grep -E
Switch to using "grep -E" instead
- - - - -
f15b0ce5 by Matthew Pickering at 2023-04-20T11:01:06-04:00
hadrian: Pass haddock file arguments in a response file
In !10119 CI was failing on windows because the command line was too
long. We can mitigate this by passing the file arguments to haddock in a
response file.
We can't easily pass all the arguments in a response file because the
`+RTS` arguments can't be placed in the response file.
Fixes #23273
- - - - -
7012ec2f by tocic at 2023-04-20T11:01:42-04:00
Fix doc typo in GHC.Read.readList
- - - - -
5c873124 by sheaf at 2023-04-20T18:33:34-04:00
Implement -jsem: parallelism controlled by semaphores
See https://github.com/ghc-proposals/ghc-proposals/pull/540/ for a
complete description for the motivation for this feature.
The `-jsem` option allows a build tool to pass a semaphore to GHC which
GHC can use in order to control how much parallelism it requests.
GHC itself acts as a client in the GHC jobserver protocol.
```
GHC Jobserver Protocol
~~~~~~~~~~~~~~~~~~~~~~
This proposal introduces the GHC Jobserver Protocol. This protocol allows
a server to dynamically invoke many instances of a client process,
while restricting all of those instances to use no more than <n> capabilities.
This is achieved by coordination over a system semaphore (either a POSIX
semaphore [6]_ in the case of Linux and Darwin, or a Win32 semaphore [7]_
in the case of Windows platforms).
There are two kinds of participants in the GHC Jobserver protocol:
- The *jobserver* creates a system semaphore with a certain number of
available tokens.
Each time the jobserver wants to spawn a new jobclient subprocess, it **must**
first acquire a single token from the semaphore, before spawning
the subprocess. This token **must** be released once the subprocess terminates.
Once work is finished, the jobserver **must** destroy the semaphore it created.
- A *jobclient* is a subprocess spawned by the jobserver or another jobclient.
Each jobclient starts with one available token (its *implicit token*,
which was acquired by the parent which spawned it), and can request more
tokens through the Jobserver Protocol by waiting on the semaphore.
Each time a jobclient wants to spawn a new jobclient subprocess, it **must**
pass on a single token to the child jobclient. This token can either be the
jobclient's implicit token, or another token which the jobclient acquired
from the semaphore.
Each jobclient **must** release exactly as many tokens as it has acquired from
the semaphore (this does not include the implicit tokens).
```
Build tools such as cabal act as jobservers in the protocol and are
responsibile for correctly creating, cleaning up and managing the
semaphore.
Adds a new submodule (semaphore-compat) for managing and interacting
with semaphores in a cross-platform way.
Fixes #19349
- - - - -
52d3e9b4 by Ben Gamari at 2023-04-20T18:34:11-04:00
rts: Initialize Array# header in listThreads#
Previously the implementation of listThreads# failed to initialize the
header of the created array, leading to various nastiness.
Fixes #23071
- - - - -
1db30fe1 by Ben Gamari at 2023-04-20T18:34:11-04:00
testsuite: Add test for #23071
- - - - -
dae514f9 by tocic at 2023-04-21T13:31:21-04:00
Fix doc typos in libraries/base/GHC
- - - - -
113e21d7 by Sylvain Henry at 2023-04-21T13:32:01-04:00
Testsuite: replace some js_broken/js_skip predicates with req_c
Using req_c is more precise.
- - - - -
038bb031 by Krzysztof Gogolewski at 2023-04-21T18:03:04-04:00
Minor doc fixes
- Add docs/index.html to .gitignore.
It is created by ./hadrian/build docs, and it was the only file
in Hadrian's templateRules not present in .gitignore.
- Mention that MultiWayIf supports non-boolean guards
- Remove documentation of optdll - removed in 2007, 763daed95
- Fix markdown syntax
- - - - -
e826cdb2 by amesgen at 2023-04-21T18:03:44-04:00
User's guide: DeepSubsumption is implied by Haskell{98,2010}
- - - - -
499a1c20 by PHO at 2023-04-23T13:39:32-04:00
Implement executablePath for Solaris and make getBaseDir less platform-dependent
Use base-4.17 executablePath when possible, and fall back on
getExecutablePath when it's not available. The sole reason why getBaseDir
had #ifdef's was apparently that getExecutablePath wasn't reliable, and we
could reduce the number of CPP conditionals by making use of
executablePath instead.
Also export executablePath on js_HOST_ARCH.
- - - - -
97a6f7bc by tocic at 2023-04-23T13:40:08-04:00
Fix doc typos in libraries/base
- - - - -
787c6e8c by Ben Gamari at 2023-04-24T12:19:06-04:00
testsuite/T20137: Avoid impl.-defined behavior
Previously we would cast pointers to uint64_t. However, implementations
are allowed to either zero- or sign-extend such casts. Instead cast to
uintptr_t to avoid this.
Fixes #23247.
- - - - -
87095f6a by Cheng Shao at 2023-04-24T12:19:44-04:00
rts: always build 64-bit atomic ops
This patch does a few things:
- Always build 64-bit atomic ops in rts/ghc-prim, even on 32-bit
platforms
- Remove legacy "64bit" cabal flag of rts package
- Fix hs_xchg64 function prototype for 32-bit platforms
- Fix AtomicFetch test for wasm32
- - - - -
2685a12d by Cheng Shao at 2023-04-24T12:20:21-04:00
compiler: don't install signal handlers when the host platform doesn't have signals
Previously, large parts of GHC API will transitively invoke
withSignalHandlers, which doesn't work on host platforms without
signal functionality at all (e.g. wasm32-wasi). By making
withSignalHandlers a no-op on those platforms, we can make more parts
of GHC API work out of the box when signals aren't supported.
- - - - -
1338b7a3 by Cheng Shao at 2023-04-24T16:21:30-04:00
hadrian: fix non-ghc program paths passed to testsuite driver when testing cross GHC
- - - - -
1a10f556 by Bodigrim at 2023-04-24T16:22:09-04:00
Add since pragma to Data.Functor.unzip
- - - - -
0da9e882 by Soham Chowdhury at 2023-04-25T00:15:22-04:00
More informative errors for bad imports (#21826)
- - - - -
ebd5b078 by Josh Meredith at 2023-04-25T00:15:58-04:00
JS/base: provide implementation for mkdir (issue 22374)
- - - - -
8f656188 by Josh Meredith at 2023-04-25T18:12:38-04:00
JS: Fix h$base_access implementation (issue 22576)
- - - - -
74c55712 by Andrei Borzenkov at 2023-04-25T18:13:19-04:00
Give more guarntees about ImplicitParams (#23289)
- Added new section in the GHC user's guide that legends behavior of
nested implicit parameter bindings in these two cases:
let ?f = 1 in let ?f = 2 in ?f
and
data T where MkT :: (?f :: Int) => T
f :: T -> T -> Int
f MkT MkT = ?f
- Added new test case to examine this behavior.
- - - - -
c30ac25f by Sebastian Graf at 2023-04-26T14:50:51-04:00
DmdAnal: Unleash demand signatures of free RULE and unfolding binders (#23208)
In #23208 we observed that the demand signature of a binder occuring in a RULE
wasn't unleashed, leading to a transitively used binder being discarded as
absent. The solution was to use the same code path that we already use for
handling exported bindings.
See the changes to `Note [Absence analysis for stable unfoldings and RULES]`
for more details.
I took the chance to factor out the old notion of a `PlusDmdArg` (a pair of a
`VarEnv Demand` and a `Divergence`) into `DmdEnv`, which fits nicely into our
existing framework. As a result, I had to touch quite a few places in the code.
This refactoring exposed a few small bugs around correct handling of bottoming
demand environments. As a result, some strictness signatures now mention uniques
that weren't there before which caused test output changes to T13143, T19969 and
T22112. But these tests compared whole -ddump-simpl listings which is a very
fragile thing to begin with. I changed what exactly they test for based on the
symptoms in the corresponding issues.
There is a single regression in T18894 because we are more conservative around
stable unfoldings now. Unfortunately it is not easily fixed; let's wait until
there is a concrete motivation before invest more time.
Fixes #23208.
- - - - -
77f506b8 by Josh Meredith at 2023-04-26T14:51:28-04:00
Refactor GenStgRhs to include the Type in both constructors (#23280, #22576, #22364)
Carry the actual type of an expression through the PreStgRhs and into GenStgRhs
for use in later stages. Currently this is used in the JavaScript backend to fix
some tests from the above mentioned issues: EtaExpandLevPoly, RepPolyWrappedVar2,
T13822, T14749.
- - - - -
052e2bb6 by Alan Zimmerman at 2023-04-26T14:52:05-04:00
EPA: Use ExplicitBraces only in HsModule
!9018 brought in exact print annotations in LayoutInfo for open and
close braces at the top level.
But it retained them in the HsModule annotations too.
Remove the originals, so exact printing uses LayoutInfo
- - - - -
d5c4629b by Cheng Shao at 2023-04-27T16:00:35-04:00
ci: update ci.sh to actually run the entire testsuite for wasm backend
For the time being, we still need to use in-tree mode and can't test
the bindist yet.
- - - - -
533d075e by Cheng Shao at 2023-04-27T16:00:35-04:00
ci: additional wasm32 manual jobs in validate pipelines
This patch enables bignum native & unregisterised wasm32 jobs as
manual jobs in validate pipelines, which can be useful to prevent
breakage when working on wasm32 related patches.
- - - - -
b5f00811 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: fix cross prefix stripping
This patch fixes cross prefix stripping in the testsuite driver. The
normalization logic used to only handle prefixes of the triple form
<arch>-<vendor>-<os>, now it's relaxed to allow any number of tokens
in the prefix tuple, so the cross prefix stripping logic would work
when ghc is configured with something like --target=wasm32-wasi.
- - - - -
6f511c36 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: include target exe extension in heap profile filenames
This patch fixes hp2ps related framework failures when testing the
wasm backend by including target exe extension in heap profile
filenames.
- - - - -
e6416b10 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: exclude ghci ways if no rts linker is present
This patch implements logic to automatically exclude ghci ways when
there is no rts linker. It's way better than having to annotate
individual test cases.
- - - - -
791cce64 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: fix permission bits in copy_files
When the testsuite driver copy files instead of symlinking them, it
should also copy the permission bits, otherwise there'll be permission
denied errors. Also, enforce file copying when testing wasm32, since
wasmtime doesn't handle host symlinks quite well
(https://github.com/bytecodealliance/wasmtime/issues/6227).
- - - - -
aa6afe8a by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: add the req_ghc_with_threaded_rts predicate
This patch adds the req_ghc_with_threaded_rts predicate to the
testsuite to assert the platform has threaded RTS, and mark some tests
as req_ghc_with_threaded_rts. Also makes ghc_with_threaded_rts a
config field instead of a global variable.
- - - - -
ce580426 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: add the req_process predicate
This patch adds the req_process predicate to the testsuite to assert
the platform has a process model, also marking tests that involve
spawning processes as req_process. Also bumps hpc & process submodule.
- - - - -
cb933665 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: add the req_host_target_ghc predicate
This patch adds the req_host_target_ghc predicate to the testsuite to
assert the ghc compiler being tested can compile both host/target
code. When testing cross GHCs this is not supported yet, but it may
change in the future.
- - - - -
b174a110 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: add missing annotations for some tests
This patch adds missing annotations (req_th, req_dynamic_lib_support,
req_rts_linker) to some tests. They were discovered when testing
wasm32, though it's better to be explicit about what features they
require, rather than simply adding when(arch('wasm32'), skip).
- - - - -
bd2bfdec by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: wasm32-specific fixes
This patch includes all wasm32-specific testsuite fixes.
- - - - -
4eaf2c2a by Josh Meredith at 2023-04-27T16:01:11-04:00
JS: change GHC.JS.Transform.identsS/E/V to take a saturated IR (#23304)
- - - - -
57277662 by sheaf at 2023-04-29T20:23:06+02:00
Add the Unsatisfiable class
This commit implements GHC proposal #433, adding the Unsatisfiable
class to the GHC.TypeError module. This provides an alternative to
TypeError for which error reporting is more predictable: we report it
when we are reporting unsolved Wanted constraints.
Fixes #14983 #16249 #16906 #18310 #20835
- - - - -
00a8a5ff by Torsten Schmits at 2023-04-30T03:45:09-04:00
Add structured error messages for GHC.Rename.Names
Tracking ticket: #20115
MR: !10336
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
931c8d82 by Ben Orchard at 2023-05-03T20:16:18-04:00
Add sized primitive literal syntax
Adds a new LANGUAGE pragma ExtendedLiterals, which enables defining
unboxed numeric literals such as `0xFF#Word8 :: Word8#`.
Implements GHC proposal 0451:
https://github.com/ghc-proposals/ghc-proposals/blob/b384a538b34f79d18a0201455b7b3c473bc8c936/proposals/0451-sized-literals.rst
Fixes #21422.
Bumps haddock submodule.
Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io>
- - - - -
f3460845 by Bodigrim at 2023-05-03T20:16:57-04:00
Document instances of Double
- - - - -
1e9caa1a by Sylvain Henry at 2023-05-03T20:17:37-04:00
Bump Cabal submodule (#22356)
- - - - -
4eafb52a by sheaf at 2023-05-03T20:18:16-04:00
Don't forget to check the parent in an export list
Commit 3f374399 introduced a bug which caused us to forget to include
the parent of an export item of the form T(..) (that is, IEThingAll)
when checking for duplicate exports.
Fixes #23318
- - - - -
8fde4ac8 by amesgen at 2023-05-03T20:18:57-04:00
Fix unlit path in cross bindists
- - - - -
8cc9a534 by Matthew Pickering at 2023-05-04T14:58:14-04:00
hadrian: Flavour: Change args -> extraArgs
Previously in a flavour definition you could override all the flags
which were passed to GHC. This causes issues when needed to compute a
package hash because we need to know what these extra arguments are
going to be before computing the hash. The solution is to modify flavour
so that the arguments you pass here are just extra ones rather than all
the arguments that you need to compile something.
This makes things work more like how cabal.project files work when you
give extra arguments to a package and also means that flavour
transformers correctly affect the hash.
- - - - -
3fdb18f8 by romes at 2023-05-04T14:58:14-04:00
Hardwire a better unit-id for ghc
Previously, the unit-id of ghc-the-library was fixed as `ghc`.
This was done primarily because the compiler must know the unit-id of
some packages (including ghc) a-priori to define wired-in names.
However, as seen in #20742, a reinstallable `ghc` whose unit-id is fixed
to `ghc` might result in subtle bugs when different ghc's interact.
A good example of this is having GHC_A load a plugin compiled by GHC_B,
where GHC_A and GHC_B are linked to ghc-libraries that are ABI
incompatible. Without a distinction between the unit-id of the ghc library
GHC_A is linked against and the ghc library the plugin it is loading was
compiled against, we can't check compatibility.
This patch gives a slightly better unit-id to ghc (ghc-version) by
(1) Not setting -this-unit-id to ghc, but rather to the new unit-id (modulo stage0)
(2) Adding a definition to `GHC.Settings.Config` whose value is the new unit-id.
(2.1) `GHC.Settings.Config` is generated by Hadrian
(2.2) and also by cabal through `compiler/Setup.hs`
This unit-id definition is imported by `GHC.Unit.Types` and used to
set the wired-in unit-id of "ghc", which was previously fixed to "ghc"
The commits following this one will improve the unit-id with a
cabal-style package hash and check compatibility when loading plugins.
Note that we also ensure that ghc's unit key matches unit id both when
hadrian or cabal builds ghc, and in this way we no longer need to add
`ghc` to the WiringMap.
- - - - -
6689c9c6 by romes at 2023-05-04T14:58:14-04:00
Validate compatibility of ghcs when loading plugins
Ensure, when loading plugins, that the ghc the plugin depends on is the
ghc loading the plugin -- otherwise fail to load the plugin.
Progress towards #20742.
- - - - -
db4be339 by romes at 2023-05-04T14:58:14-04:00
Add hashes to unit-ids created by hadrian
This commit adds support for computing an inputs hash for packages
compiled by hadrian. The result is that ABI incompatible packages should
be given different hashes and therefore be distinct in a cabal store.
Hashing is enabled by the `--flag`, and is off by default as the hash
contains a hash of the source files. We enable it when we produce
release builds so that the artifacts we distribute have the right unit
ids.
- - - - -
944a9b94 by Matthew Pickering at 2023-05-04T14:58:14-04:00
Use hash-unit-ids in release jobs
Includes fix upload_ghc_libs glob
- - - - -
116d7312 by Josh Meredith at 2023-05-04T14:58:51-04:00
JS: fix bounds checking (Issue 23123)
* For ByteArray-based bounds-checking, the JavaScript backend must use the
`len` field, instead of the inbuild JavaScript `length` field.
* Range-based operations must also check both the start and end of the range
for bounds
* All indicies are valid for ranges of size zero, since they are essentially no-ops
* For cases of ByteArray accesses (e.g. read as Int), the end index is
(i * sizeof(type) + sizeof(type) - 1), while the previous implementation
uses (i + sizeof(type) - 1). In the Int32 example, this is (i * 4 + 3)
* IndexByteArrayOp_Word8As* primitives use byte array indicies (unlike
the previous point), but now check both start and end indicies
* Byte array copies now check if the arrays are the same by identity and
then if the ranges overlap.
- - - - -
2d5c1dde by Sylvain Henry at 2023-05-04T14:58:51-04:00
Fix remaining issues with bound checking (#23123)
While fixing these I've also changed the way we store addresses into
ByteArray#. Addr# are composed of two parts: a JavaScript array and an
offset (32-bit number).
Suppose we want to store an Addr# in a ByteArray# foo at offset i.
Before this patch, we were storing both fields as a tuple in the "arr"
array field:
foo.arr[i] = [addr_arr, addr_offset];
Now we only store the array part in the "arr" field and the offset
directly in the array:
foo.dv.setInt32(i, addr_offset):
foo.arr[i] = addr_arr;
It avoids wasting space for the tuple.
- - - - -
98c5ee45 by Luite Stegeman at 2023-05-04T14:59:31-04:00
JavaScript: Correct arguments to h$appendToHsStringA
fixes #23278
- - - - -
ca611447 by Josh Meredith at 2023-05-04T15:00:07-04:00
base/encoding: add an allocations performance test (#22946)
- - - - -
e3ddf58d by Krzysztof Gogolewski at 2023-05-04T15:00:44-04:00
linear types: Don't add external names to the usage env
This has no observable effect, but avoids storing useless data.
- - - - -
b3226616 by Andrei Borzenkov at 2023-05-04T15:01:25-04:00
Improved documentation for the Data.OldList.nub function
There was recomentation to use map head . group . sort instead of nub
function, but containers library has more suitable and efficient
analogue
- - - - -
e8b72ff6 by Ryan Scott at 2023-05-04T15:02:02-04:00
Fix type variable substitution in gen_Newtype_fam_insts
Previously, `gen_Newtype_fam_insts` was substituting the type variable binders
of a type family instance using `substTyVars`, which failed to take type
variable dependencies into account. There is similar code in
`GHC.Tc.TyCl.Class.tcATDefault` that _does_ perform this substitution properly,
so this patch:
1. Factors out this code into a top-level `substATBndrs` function, and
2. Uses `substATBndrs` in `gen_Newtype_fam_insts`.
Fixes #23329.
- - - - -
275836d2 by Torsten Schmits at 2023-05-05T08:43:02+00:00
Add structured error messages for GHC.Rename.Utils
Tracking ticket: #20115
MR: !10350
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
983ce558 by Oleg Grenrus at 2023-05-05T13:11:29-04:00
Use TemplateHaskellQuotes in TH.Syntax to construct Names
- - - - -
a5174a59 by Matthew Pickering at 2023-05-05T18:42:31-04:00
driver: Use hooks from plugin_hsc_env
This fixes a bug in oneshot mode where hooks modified in a plugin
wouldn't be used in oneshot mode because we neglected to use the right
hsc_env. This was observed by @csabahruska.
- - - - -
18a7d03d by Aaron Allen at 2023-05-05T18:42:31-04:00
Rework plugin initialisation points
In general this patch pushes plugin initialisation points to earlier in
the pipeline. As plugins can modify the `HscEnv`, it's imperative that
the plugins are initialised as soon as possible and used thereafter.
For example, there are some new tests which modify hsc_logger and other
hooks which failed to fire before (and now do)
One consequence of this change is that the error for specifying the
usage of a HPT plugin from the command line has changed, because it's
now attempted to be loaded at initialisation rather than causing a
cyclic module import.
Closes #21279
Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com>
- - - - -
6e776ed3 by Matthew Pickering at 2023-05-05T18:42:31-04:00
docs: Add Note [Timing of plugin initialization]
- - - - -
e1df8511 by Matthew Pickering at 2023-05-05T18:43:07-04:00
Incrementally update ghcup metadata in ghc/ghcup-metadata
This job paves the way for distributing nightly builds
* A new repo https://gitlab.haskell.org/ghc/ghcup-metadata stores the
metadata on the "updates" branch.
* Each night this metadata is downloaded and the nightly builds are
appended to the end of the metadata.
* The update job only runs on the scheduled nightly pipeline, not just
when NIGHTLY=1.
Things which are not done yet
* Modify the retention policy for nightly jobs
* Think about building release flavour compilers to distribute nightly.
Fixes #23334
- - - - -
8f303d27 by Rodrigo Mesquita at 2023-05-05T22:04:31-04:00
docs: Remove mentions of ArrayArray# from unlifted FFI section
Fixes #23277
- - - - -
994bda56 by Torsten Schmits at 2023-05-05T22:05:12-04:00
Add structured error messages for GHC.Rename.Module
Tracking ticket: #20115
MR: !10361
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
Only addresses the single warning missing from the previous MR.
- - - - -
3e3a6be4 by Ben Gamari at 2023-05-08T12:15:19+00:00
rts: Fix data-race in hs_init_ghc
As noticed by @Terrorjack, `hs_init_ghc` previously used non-atomic
increment/decrement on the RTS's initialization count. This may go wrong
in a multithreaded program which initializes the runtime multiple times.
Closes #22756.
- - - - -
78c8dc50 by Torsten Schmits at 2023-05-08T21:41:51-04:00
Add structured error messages for GHC.IfaceToCore
Tracking ticket: #20114
MR: !10390
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
0e2df4c9 by Bryan Richter at 2023-05-09T12:03:35+03:00
Fix up rules for ghcup-metadata-nightly-push
- - - - -
b970e64f by Ben Gamari at 2023-05-09T08:41:33-04:00
testsuite: Add test for atomicSwapIORef
- - - - -
81cfefd2 by Ben Gamari at 2023-05-09T08:41:53-04:00
compiler: Implement atomicSwapIORef with xchg
As requested by @treeowl in CLC#139.
- - - - -
6b29154d by Ben Gamari at 2023-05-09T08:41:53-04:00
Make atomicSwapMutVar# an inline primop
- - - - -
64064cfe by doyougnu at 2023-05-09T18:40:01-04:00
JS: add GHC.JS.Optimizer, remove RTS.Printer, add Linker.Opt
This MR changes some simple optimizations and is a first step in re-architecting
the JS backend pipeline to add the optimizer. In particular it:
- removes simple peep hole optimizations from `GHC.StgToJS.Printer` and removes that module
- adds module `GHC.JS.Optimizer`
- defines the same peep hole opts that were removed only now they are `Syntax -> Syntax` transformations rather than `Syntax -> JS code` optimizations
- hooks the optimizer into code gen
- adds FuncStat and ForStat constructors to the backend.
Working Ticket:
- #22736
Related MRs:
- MR !10142
- MR !10000
-------------------------
Metric Decrease:
CoOpt_Read
ManyAlternatives
PmSeriesS
PmSeriesT
PmSeriesV
T10421
T12707
T13253
T13253-spj
T15164
T17516
T18140
T18282
T18698a
T18698b
T18923
T1969
T19695
T20049
T3064
T5321FD
T5321Fun
T783
T9198
T9233
T9630
-------------------------
- - - - -
6738c01d by Krzysztof Gogolewski at 2023-05-09T18:40:38-04:00
Add a regression test for #21050
- - - - -
b2cdb7da by Ben Gamari at 2023-05-09T18:41:14-04:00
nonmoving: Account for mutator allocations in bytes_allocated
Previously we failed to account direct mutator allocations into the
nonmoving heap against the mutator's allocation limit and
`cap->total_allocated`. This only manifests during CAF evaluation (since
we allocate the CAF's blackhole directly into the nonmoving heap).
Fixes #23312.
- - - - -
0657b482 by Sven Tennie at 2023-05-09T22:22:42-04:00
Adjust AArch64 stackFrameHeaderSize
The prologue of each stack frame are the saved LR and FP registers, 8
byte each. I.e. the size of the stack frame header is 2 * 8 byte.
- - - - -
7788c09c by konsumlamm at 2023-05-09T22:23:23-04:00
Make `(&)` representation polymorphic in the return type
- - - - -
b3195922 by Ben Gamari at 2023-05-10T05:06:45-04:00
ghc-prim: Generalize keepAlive#/touch# in state token type
Closes #23163.
- - - - -
1e6861dd by Cheng Shao at 2023-05-10T05:07:25-04:00
Bump hsc2hs submodule
Fixes #22981.
- - - - -
0a513952 by Ben Gamari at 2023-05-11T04:10:17-04:00
base: Export GHC.Conc.Sync.fromThreadId
Closes #22706.
- - - - -
29be39ba by Matthew Pickering at 2023-05-11T04:10:54-04:00
Build vanilla alpine bindists
We currently attempt to build and distribute fully static alpine
bindists (ones which could be used on any linux platform) but most
people who use the alpine bindists want to use alpine to build their own
static applications (for which a fully static bindist is not necessary).
We should build and distribute these bindists for these users whilst the
fully-static bindist is still unusable.
Fixes #23349
- - - - -
40c7daed by Simon Peyton Jones at 2023-05-11T04:11:30-04:00
Look both ways when looking for quantified equalities
When looking up (t1 ~# t2) in the quantified constraints,
check both orientations. Forgetting this led to #23333.
- - - - -
c17bb82f by Rodrigo Mesquita at 2023-05-11T04:12:07-04:00
Move "target has RTS linker" out of settings
We move the "target has RTS linker" information out of configure into a
predicate in GHC, and remove this option from the settings file where it
is unnecessary -- it's information statically known from the platform.
Note that previously we would consider `powerpc`s and `s390x`s other
than `powerpc-ibm-aix*` and `s390x-ibm-linux` to have an RTS linker,
but the RTS linker supports neither platform.
Closes #23361
- - - - -
bd0b056e by Krzysztof Gogolewski at 2023-05-11T04:12:44-04:00
Add a test for #17284
Since !10123 we now reject this program.
- - - - -
630b1fea by Bodigrim at 2023-05-11T04:13:24-04:00
Document unlawfulness of instance Num Fixed
Fixes #22712
- - - - -
87eebf98 by sheaf at 2023-05-11T11:55:22-04:00
Add fused multiply-add instructions
This patch adds eight new primops that fuse a multiplication and an
addition or subtraction:
- `{fmadd,fmsub,fnmadd,fnmsub}{Float,Double}#`
fmadd x y z is x * y + z, computed with a single rounding step.
This patch implements code generation for these primops in the following
backends:
- X86, AArch64 and PowerPC NCG,
- LLVM
- C
WASM uses the C implementation. The primops are unsupported in the
JavaScript backend.
The following constant folding rules are also provided:
- compute a * b + c when a, b, c are all literals,
- x * y + 0 ==> x * y,
- ±1 * y + z ==> z ± y and x * ±1 + z ==> z ± x.
NB: the constant folding rules incorrectly handle signed zero.
This is a known limitation with GHC's floating-point constant folding
rules (#21227), which we hope to resolve in the future.
- - - - -
ad16a066 by Krzysztof Gogolewski at 2023-05-11T11:55:59-04:00
Add a test for #21278
- - - - -
05cea68c by Matthew Pickering at 2023-05-11T11:56:36-04:00
rts: Refine memory retention behaviour to account for pinned/compacted objects
When using the copying collector there is still a lot of data which
isn't copied (such as pinned, compacted, large objects etc). The logic
to decide how much memory to retain didn't take into account that these
wouldn't be copied. Therefore we pessimistically retained 2* the amount
of memory for these blocks even though they wouldn't be copied by the
collector.
The solution is to split up the heap into two parts, the parts which
will be copied and the parts which won't be copied. Then the appropiate
factor is applied to each part individually (2 * for copying and 1.2 *
for not copying).
The T23221 test demonstrates this improvement with a program which first
allocates many unpinned ByteArray# followed by many pinned ByteArray#
and observes the difference in the ultimate memory baseline between the
two.
There are some charts on #23221.
Fixes #23221
- - - - -
1bb24432 by Cheng Shao at 2023-05-11T11:57:15-04:00
hadrian: fix no_dynamic_libs flavour transformer
This patch fixes the no_dynamic_libs flavour transformer and make
fully_static reuse it. Previously building with no_dynamic_libs fails
since ghc program is still dynamic and transitively brings in dyn ways
of rts which are produced by no rules.
- - - - -
0ed493a3 by Josh Meredith at 2023-05-11T23:08:27-04:00
JS: refactor jsSaturate to return a saturated JStat (#23328)
- - - - -
a856d98e by Pierre Le Marre at 2023-05-11T23:09:08-04:00
Doc: Fix out-of-sync using-optimisation page
- Make explicit that default flag values correspond to their -O0 value.
- Fix -fignore-interface-pragmas, -fstg-cse, -fdo-eta-reduction,
-fcross-module-specialise, -fsolve-constant-dicts, -fworker-wrapper.
- - - - -
c176ad18 by sheaf at 2023-05-12T06:10:57-04:00
Don't panic in mkNewTyConRhs
This function could come across invalid newtype constructors, as we
only perform validity checking of newtypes once we are outside the
knot-tied typechecking loop.
This patch changes this function to fake up a stub type in the case of
an invalid newtype, instead of panicking.
This patch also changes "checkNewDataCon" so that it reports as many
errors as possible at once.
Fixes #23308
- - - - -
ab63daac by Krzysztof Gogolewski at 2023-05-12T06:11:38-04:00
Allow Core optimizations when interpreting bytecode
Tracking ticket: #23056
MR: !10399
This adds the flag `-funoptimized-core-for-interpreter`, permitting use
of the `-O` flag to enable optimizations when compiling with the
interpreter backend, like in ghci.
- - - - -
c6cf9433 by Ben Gamari at 2023-05-12T06:12:14-04:00
hadrian: Fix mention of non-existent removeFiles function
Previously Hadrian's bindist Makefile referred to a `removeFiles`
function that was previously defined by the `make` build system. Since
the `make` build system is no longer around, this function is now
undefined. Naturally, make being make, this appears to be silently
ignored instead of producing an error.
Fix this by rewriting it to `rm -f`.
Closes #23373.
- - - - -
eb60ec18 by Bodigrim at 2023-05-12T06:12:54-04:00
Mention new implementation of GHC.IORef.atomicSwapIORef in the changelog
- - - - -
aa84cff4 by Teo Camarasu at 2023-05-12T19:27:23-04:00
rts: Ensure non-moving gc is not running when pausing
- - - - -
5ad776ab by Teo Camarasu at 2023-05-12T19:27:23-04:00
rts: Teach listAllBlocks about nonmoving heap
List all blocks on the non-moving heap.
Resolves #22627
- - - - -
d683b2e5 by Krzysztof Gogolewski at 2023-05-12T19:28:00-04:00
Fix coercion optimisation for SelCo (#23362)
setNominalRole_maybe is supposed to output a nominal coercion.
In the SelCo case, it was not updating the stored role to Nominal,
causing #23362.
- - - - -
59aa4676 by Alexis King at 2023-05-12T19:28:47-04:00
hadrian: Fix linker script flag for MergeObjects builder
This fixes what appears to have been a typo in !9530. The `-t` flag just
enables tracing on all versions of `ld` I’ve looked at, while `-T` is
used to specify a linker script. It seems that this worked anyway for
some reason on some `ld` implementations (perhaps because they
automatically detect linker scripts), but the missing `-T` argument
causes `gold` to complain.
- - - - -
4bf9fa0f by Adam Gundry at 2023-05-12T23:49:49-04:00
Less coercion optimization for non-newtype axioms
See Note [Push transitivity inside newtype axioms only] for an explanation
of the change here. This change substantially improves the performance of
coercion optimization for programs involving transitive type family reductions.
-------------------------
Metric Decrease:
CoOpt_Singletons
LargeRecord
T12227
T12545
T13386
T15703
T5030
T8095
-------------------------
- - - - -
dc0c9574 by Adam Gundry at 2023-05-12T23:49:49-04:00
Move checkAxInstCo to GHC.Core.Lint
A consequence of the previous change is that checkAxInstCo is no longer
called during coercion optimization, so it can be moved back where it belongs.
Also includes some edits to Note [Conflict checking with AxiomInstCo] as
suggested by @simonpj.
- - - - -
8b9b7dbc by Simon Peyton Jones at 2023-05-12T23:50:25-04:00
Use the eager unifier in the constraint solver
This patch continues the refactoring of the constraint solver
described in #23070.
The Big Deal in this patch is to call the regular, eager unifier from the
constraint solver, when we want to create new equalities. This
replaces the existing, unifyWanted which amounted to
yet-another-unifier, so it reduces duplication of a rather subtle
piece of technology. See
* Note [The eager unifier] in GHC.Tc.Utils.Unify
* GHC.Tc.Solver.Monad.wrapUnifierTcS
I did lots of other refactoring along the way
* I simplified the treatment of right hand sides that contain CoercionHoles.
Now, a constraint that contains a hetero-kind CoercionHole is non-canonical,
and cannot be used for rewriting or unification alike. This required me
to add the ch_hertero_kind flag to CoercionHole, with consequent knock-on
effects. See wrinkle (2) of `Note [Equalities with incompatible kinds]` in
GHC.Tc.Solver.Equality.
* I refactored the StopOrContinue type to add StartAgain, so that after a
fundep improvement (for example) we can simply start the pipeline again.
* I got rid of the unpleasant (and inefficient) rewriterSetFromType/Co functions.
With Richard I concluded that they are never needed.
* I discovered Wrinkle (W1) in Note [Wanteds rewrite Wanteds] in
GHC.Tc.Types.Constraint, and therefore now prioritise non-rewritten equalities.
Quite a few error messages change, I think always for the better.
Compiler runtime stays about the same, with one outlier: a 17% improvement in T17836
Metric Decrease:
T17836
T18223
- - - - -
5cad28e7 by Bartłomiej Cieślar at 2023-05-12T23:51:06-04:00
Cleanup of dynflags override in export renaming
The deprecation warnings are normally emitted whenever the name's GRE is being looked up, which calls the GHC.Rename.Env.addUsedGRE function. We do not want those warnings to be emitted when renaming export lists, so they are artificially turned off by removing all warning categories from DynFlags at the beginning of GHC.Tc.Gen.Export.rnExports. This commit removes that dependency by unifying the function used for GRE lookup in lookup_ie to lookupGreAvailRn and disabling the call to addUsedGRE in said function (the warnings are also disabled in a call to lookupSubBndrOcc_helper in lookupChildrenExport), as per #17957. This commit also changes the setting for whether to warn about deprecated names in addUsedGREs to be an explicit enum instead of a boolean.
- - - - -
d85ed900 by Alexis King at 2023-05-13T08:45:18-04:00
Use a uniform return convention in bytecode for unary results
fixes #22958
- - - - -
8a0d45f7 by Bodigrim at 2023-05-13T08:45:58-04:00
Add more instances for Compose: Enum, Bounded, Num, Real, Integral
See https://github.com/haskell/core-libraries-committee/issues/160 for discussion
- - - - -
902f0730 by Simon Peyton Jones at 2023-05-13T14:58:34-04:00
Make GHC.Types.Id.Make.shouldUnpackTy a bit more clever
As #23307, GHC.Types.Id.Make.shouldUnpackTy was leaving money on the
table, failing to unpack arguments that are perfectly unpackable.
The fix is pretty easy; see Note [Recursive unboxing]
- - - - -
a5451438 by sheaf at 2023-05-13T14:59:13-04:00
Fix bad multiplicity role in tyConAppFunCo_maybe
The function tyConAppFunCo_maybe produces a multiplicity coercion
for the multiplicity argument of the function arrow, except that
it could be at the wrong role if asked to produce a representational
coercion. We fix this by using the 'funRole' function, which computes
the right roles for arguments to the function arrow TyCon.
Fixes #23386
- - - - -
5b9e9300 by sheaf at 2023-05-15T11:26:59-04:00
Turn "ambiguous import" error into a panic
This error should never occur, as a lookup of a type or data constructor
should never be ambiguous. This is because a single module cannot export
multiple Names with the same OccName, as per item (1) of
Note [Exporting duplicate declarations] in GHC.Tc.Gen.Export.
This code path was intended to handle duplicate record fields, but the
rest of the code had since been refactored to handle those in a
different way.
We also remove the AmbiguousImport constructor of IELookupError, as
it is no longer used.
Fixes #23302
- - - - -
e305e60c by M Farkas-Dyck at 2023-05-15T11:27:41-04:00
Unbreak some tests with latest GNU grep, which now warns about stray '\'.
Confusingly, the testsuite mangled the error to say "stray /".
We also migrate some tests from grep to grep -E, as it seems the author actually wanted an "POSIX extended" (a.k.a. sane) regex.
Background: POSIX specifies 2 "regex" syntaxen: "basic" and "extended". Of these, only "extended" syntax is actually a regular expression. Furthermore, "basic" syntax is inconsistent in its use of the '\' character — sometimes it escapes a regex metacharacter, but sometimes it unescapes it, i.e. it makes an otherwise normal character become a metacharacter. This baffles me and it seems also the authors of these tests. Also, the regex(7) man page (at least on Linux) says "basic" syntax is obsolete. Nearly all modern tools and libraries are consistent in this use of the '\' character (of which many use "extended" syntax by default).
- - - - -
5ae81842 by sheaf at 2023-05-15T14:49:17-04:00
Improve "ambiguous occurrence" error messages
This error was sometimes a bit confusing, especially when data families
were involved. This commit improves the general presentation of the
"ambiguous occurrence" error, and adds a bit of extra context in the
case of data families.
Fixes #23301
- - - - -
2f571afe by Sylvain Henry at 2023-05-15T14:50:07-04:00
Fix GHCJS OS platform (fix #23346)
- - - - -
86aae570 by Oleg Grenrus at 2023-05-15T14:50:43-04:00
Split DynFlags structure into own module
This will allow to make command line parsing to depend on
diagnostic system (which depends on dynflags)
- - - - -
fbe3fe00 by Josh Meredith at 2023-05-15T18:01:43-04:00
Replace the implementation of CodeBuffers with unboxed types
- - - - -
21f3aae7 by Josh Meredith at 2023-05-15T18:01:43-04:00
Use unboxed codebuffers in base
Metric Decrease:
encodingAllocations
- - - - -
18ea2295 by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Weak pointer cleanups
Various stylistic cleanups. No functional changes.
- - - - -
c343112f by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Don't force debug output to stderr
Previously `+RTS -Dw -l` would emit debug output to the eventlog while
`+RTS -l -Dw` would emit it to stderr. This was because the parser for
`-D` would unconditionally override the debug output target. Now we
instead only do so if no it is currently `TRACE_NONE`.
- - - - -
a5f5f067 by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Forcibly flush eventlog on barf
Previously we would attempt to flush via `endEventLogging` which can
easily deadlock, e.g., if `barf` fails during GC.
Using `flushEventLog` directly may result in slightly less consistent
eventlog output (since we don't take all capabilities before flushing)
but avoids deadlocking.
- - - - -
73b1e87c by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Assert that pointers aren't cleared by -DZ
This turns many segmentation faults into much easier-to-debug assertion
failures by ensuring that LOOKS_LIKE_*_PTR checks recognize bit-patterns
produced by `+RTS -DZ` clearing as invalid pointers.
This is a bit ad-hoc but this is the debug runtime.
- - - - -
37fb61d8 by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Introduce printGlobalThreads
- - - - -
451d65a6 by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Don't sanity-check StgTSO.global_link
See Note [Avoid dangling global_link pointers].
Fixes #19146.
- - - - -
d69cbd78 by sheaf at 2023-05-15T18:03:00-04:00
Split up tyThingToIfaceDecl from GHC.Iface.Make
This commit moves tyThingToIfaceDecl and coAxiomToIfaceDecl
from GHC.Iface.Make into GHC.Iface.Decl.
This avoids GHC.Types.TyThing.Ppr, which needs tyThingToIfaceDecl,
transitively depending on e.g. GHC.Iface.Load and GHC.Tc.Utils.Monad.
- - - - -
4d29ecdf by sheaf at 2023-05-15T18:03:00-04:00
Migrate errors to diagnostics in GHC.Tc.Module
This commit migrates the errors in GHC.Tc.Module to use the new
diagnostic infrastructure.
It required a significant overhaul of the compatibility checks between
an hs-boot or signature module and its implementation; we now use
a Writer monad to accumulate errors; see the BootMismatch datatype
in GHC.Tc.Errors.Types, with its panoply of subtypes.
For the sake of readability, several local functions inside the
'checkBootTyCon' function were split off into top-level functions.
We split off GHC.Types.HscSource into a "boot or sig" vs "normal hs file"
datatype, as this mirrors the logic in several other places where we
want to treat hs-boot and hsig files in a similar fashion.
This commit also refactors the Backpack checks for type synonyms
implementing abstract data, to correctly reject implementations that
contain qualified or quantified types (this fixes #23342 and #23344).
- - - - -
d986c98e by Rodrigo Mesquita at 2023-05-16T00:14:04-04:00
configure: Drop unused AC_PROG_CPP
In configure, we were calling `AC_PROG_CPP` but never making use of the
$CPP variable it sets or reads.
The issue is $CPP will show up in the --help output of configure,
falsely advertising a configuration option that does nothing.
The reason we don't use the $CPP variable is because HS_CPP_CMD is
expected to be a single command (without flags), but AC_PROG_CPP, when
CPP is unset, will set said variable to something like `/usr/bin/gcc -E`.
Instead, we configure HS_CPP_CMD through $CC.
- - - - -
a8f0435f by Cheng Shao at 2023-05-16T00:14:42-04:00
rts: fix --disable-large-address-space
This patch moves
ACQUIRE_ALLOC_BLOCK_SPIN_LOCK/RELEASE_ALLOC_BLOCK_SPIN_LOCK from
Storage.h to HeapAlloc.h. When --disable-large-address-space is passed
to configure, the code in HeapAlloc.h makes use of these two macros.
Fixes #23385.
- - - - -
bdb93cd2 by Oleg Grenrus at 2023-05-16T07:59:21+03:00
Add -Wmissing-role-annotations
Implements #22702
- - - - -
41ecfc34 by Ben Gamari at 2023-05-16T07:28:15-04:00
base: Export {get,set}ExceptionFinalizer from System.Mem.Weak
As proposed in CLC Proposal #126 [1].
[1]: https://github.com/haskell/core-libraries-committee/issues/126
- - - - -
67330303 by Ben Gamari at 2023-05-16T07:28:16-04:00
base: Introduce printToHandleFinalizerExceptionHandler
- - - - -
5e3f9bb5 by Josh Meredith at 2023-05-16T13:59:22-04:00
JS: Implement h$clock_gettime in the JavaScript RTS (#23360)
- - - - -
90e69d5d by Zubin Duggal at 2023-05-16T14:00:00-04:00
compiler: Use compact representation for SourceText
SourceText is serialized along with INLINE pragmas into interface files. Many of
these SourceTexts are identical, for example "{-# INLINE#". When deserialized,
each such SourceText was previously expanded out into a [Char], which is highly
wasteful of memory, and each such instance of the text would allocate an
independent list with its contents as deserializing breaks any sharing that might
have existed.
Instead, we use a `FastString` to represent these, so that each instance unique
text will be interned and stored in a memory efficient manner.
- - - - -
b70bc690 by Zubin Duggal at 2023-05-16T14:00:00-04:00
compiler: Use compact representation/FastStrings for `SourceNote`s
`SourceNote`s should not be stored as [Char] as this is highly wasteful
and in certain scenarios can be highly duplicated.
Metric Decrease:
hard_hole_fits
- - - - -
6231a126 by Zubin Duggal at 2023-05-16T14:00:00-04:00
compiler: Use compact representation for UsageFile (#22744)
Use FastString to store filepaths in interface files, as this data is
highly redundant so we want to share all instances of filepaths in the
compiler session.
- - - - -
47a58150 by Zubin Duggal at 2023-05-16T14:00:00-04:00
testsuite: add test for T22744
This test checks for #22744 by compiling 100 modules which each have
a dependency on 1000 distinct external files.
Previously, when loading these interfaces from disk, each individual instance
of a filepath in the interface will would be allocated as an individual object
on the heap, meaning we have heap objects for 100*1000 files, when there are
only 1000 distinct files we care about.
This test checks this by first compiling the module normally, then measuring
the peak memory usage in a no-op recompile, as the recompilation checking will
force the allocation of all these filepaths.
- - - - -
0451bdc9 by Ben Gamari at 2023-05-16T21:31:40-04:00
users guide: Add glossary
Currently this merely explains the meaning of "technology preview" in
the context of released features.
- - - - -
0ba52e4e by Ben Gamari at 2023-05-16T21:31:40-04:00
Update glossary.rst
- - - - -
3d23060c by Ben Gamari at 2023-05-16T21:31:40-04:00
Use glossary directive
- - - - -
2972fd66 by Sylvain Henry at 2023-05-16T21:32:20-04:00
JS: fix getpid (fix #23399)
- - - - -
5fe1d3e6 by Matthew Pickering at 2023-05-17T21:42:00-04:00
Use setSrcSpan rather than setLclEnv in solveForAll
In subsequent MRs (#23409) we want to remove the TcLclEnv argument from
a CtLoc. This MR prepares us for that by removing the one place where
the entire TcLclEnv is used, by using it more precisely to just set the
contexts source location.
Fixes #23390
- - - - -
385edb65 by Torsten Schmits at 2023-05-17T21:42:40-04:00
Update the users guide paragraph on -O in GHCi
In relation to #23056
- - - - -
87626ef0 by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Add test for #13660
- - - - -
9eef53b1 by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Move implementation of GHC.Foreign to GHC.Internal
- - - - -
174ea2fa by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Introduce {new,with}CStringLen0
These are useful helpers for implementing the internal-NUL code unit
check needed to fix #13660.
- - - - -
a46ced16 by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Clean up documentation
- - - - -
b98d99cc by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Ensure that FilePaths don't contain NULs
POSIX filepaths may not contain the NUL octet but previously we did not
reject such paths. This could be exploited by untrusted input to cause
discrepancies between various `FilePath` queries and the opened
filename. For instance, `readFile "hello.so\x00.txt"` would open the
file `"hello.so"` yet `takeFileExtension` would return `".txt"`.
The same argument applies to Windows FilePaths
Fixes #13660.
- - - - -
7ae45459 by Simon Peyton Jones at 2023-05-18T15:19:29-04:00
Allow the demand analyser to unpack tuple and equality dictionaries
Addresses #23398. The demand analyser usually does not unpack class
dictionaries: see Note [Do not unbox class dictionaries] in
GHC.Core.Opt.DmdAnal.
This patch makes an exception for tuple dictionaries and equality
dictionaries, for reasons explained in wrinkles (DNB1) and (DNB2) of
the above Note.
Compile times fall by 0.1% for some reason (max 0.7% on T18698b).
- - - - -
b53a9086 by Greg Steuck at 2023-05-18T15:20:08-04:00
Use a simpler and more portable construct in ld.ldd check
printf '%q\n' is a bash extension which led to incorrectly
failing an ld.lld test on OpenBSD which uses pdksh as /bin/sh
- - - - -
dd5710af by Torsten Schmits at 2023-05-18T15:20:50-04:00
Update the warning about interpreter optimizations
to reflect that they're not incompatible anymore, but guarded by a flag
- - - - -
4f6dd999 by Matthew Pickering at 2023-05-18T15:21:26-04:00
Remove stray dump flags in GHC.Rename.Names
- - - - -
4bca0486 by Oleg Grenrus at 2023-05-19T11:51:33+03:00
Make Warn = Located DriverMessage
This change makes command line argument parsing use diagnostic
framework for producing warnings.
- - - - -
525ed554 by Simon Peyton Jones at 2023-05-19T10:09:15-04:00
Type inference for data family newtype instances
This patch addresses #23408, a tricky case with data family
newtype instances. Consider
type family TF a where TF Char = Bool
data family DF a
newtype instance DF Bool = MkDF Int
and [W] Int ~R# DF (TF a), with a Given (a ~# Char). We must fully
rewrite the Wanted so the tpye family can fire; that wasn't happening.
- - - - -
c6fb6690 by Peter Trommler at 2023-05-20T03:16:08-04:00
testsuite: fix predicate on rdynamic test
Test rdynamic requires dynamic linking support, which is
orthogonal to RTS linker support. Change the predicate accordingly.
Fixes #23316
- - - - -
735d504e by Matthew Pickering at 2023-05-20T03:16:44-04:00
docs: Use ghc-ticket directive where appropiate in users guide
Using the directive automatically formats and links the ticket
appropiately.
- - - - -
b56d7379 by Sylvain Henry at 2023-05-22T14:21:22-04:00
NCG: remove useless .align directive (#20758)
- - - - -
15b93d2f by Simon Peyton Jones at 2023-05-22T14:21:58-04:00
Add test for #23156
This program had exponential typechecking time in GHC 9.4 and 9.6
- - - - -
2b53f206 by Greg Steuck at 2023-05-22T20:23:11-04:00
Revert "Change hostSupportsRPaths to report False on OpenBSD"
This reverts commit 1e0d8fdb55a38ece34fa6cf214e1d2d46f5f5bf2.
- - - - -
882e43b7 by Greg Steuck at 2023-05-22T20:23:11-04:00
Disable T17414 on OpenBSD
Like on other systems it's not guaranteed that there's sufficient
space in /tmp to write 2G out.
- - - - -
9d531f9a by Greg Steuck at 2023-05-22T20:23:11-04:00
Bring back getExecutablePath to getBaseDir on OpenBSD
Fix #18173
- - - - -
9db0eadd by Krzysztof Gogolewski at 2023-05-22T20:23:47-04:00
Add an error origin for impedance matching (#23427)
- - - - -
33cf4659 by Ben Gamari at 2023-05-23T03:46:20-04:00
testsuite: Add tests for #23146
Both lifted and unlifted variants.
- - - - -
76727617 by Ben Gamari at 2023-05-23T03:46:21-04:00
codeGen: Fix some Haddocks
- - - - -
33a8c348 by Ben Gamari at 2023-05-23T03:46:21-04:00
codeGen: Give proper LFInfo to datacon wrappers
As noted in `Note [Conveying CAF-info and LFInfo between modules]`,
when importing a binding from another module we must ensure that it gets
the appropriate `LambdaFormInfo` if it is in WHNF to ensure that
references to it are tagged correctly.
However, the implementation responsible for doing this,
`GHC.StgToCmm.Closure.mkLFImported`, only dealt with datacon workers and
not wrappers. This lead to the crash of this program in #23146:
module B where
type NP :: [UnliftedType] -> UnliftedType
data NP xs where
UNil :: NP '[]
module A where
import B
fieldsSam :: NP xs -> NP xs -> Bool
fieldsSam UNil UNil = True
x = fieldsSam UNil UNil
Due to its GADT nature, `UNil` produces a trivial wrapper
$WUNil :: NP '[]
$WUNil = UNil @'[] @~(<co:1>)
which is referenced in the RHS of `A.x`. Due to the above-mentioned bug
in `mkLFImported`, the references to `$WUNil` passed to `fieldsSam` were
not tagged. This is problematic as `fieldsSam` expected its arguments to
be tagged as they are unlifted.
The fix is straightforward: extend the logic in `mkLFImported` to cover
(nullary) datacon wrappers as well as workers. This is safe because we
know that the wrapper of a nullary datacon will be in WHNF, even if it
includes equalities evidence (since such equalities are not runtime
relevant).
Thanks to @MangoIV for the great ticket and @alt-romes for his
minimization and help debugging.
Fixes #23146.
- - - - -
2fc18e9e by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
codeGen: Fix LFInfo of imported datacon wrappers
As noted in #23231 and in the previous commit, we were failing to give a
an LFInfo of LFCon to a nullary datacon wrapper from another module,
failing to properly tag pointers which ultimately led to the
segmentation fault in #23146.
On top of the previous commit which now considers wrappers where we
previously only considered workers, we change the order of the guards so
that we check for the arity of the binding before we check whether it is
a constructor. This allows us to
(1) Correctly assign `LFReEntrant` to imported wrappers whose worker was
nullary, which we previously would fail to do
(2) Remove the `isNullaryRepDataCon` predicate:
(a) which was previously wrong, since it considered wrappers whose
workers had zero-width arguments to be non-nullary and would fail to
give `LFCon` to them
(b) is now unnecessary, since arity == 0 guarantees
- that the worker takes no arguments at all
- and the wrapper takes no arguments and its RHS must be an
application of the worker to zero-width-args only.
- we lint these two items with an assertion that the datacon
`hasNoNonZeroWidthArgs`
We also update `isTagged` to use the new logic in determining the
LFInfos of imported Ids.
The creation of LFInfos for imported Ids and this detail are explained
in Note [The LFInfo of Imported Ids].
Note that before the patch to those issues we would already consider these
nullary wrappers to have `LFCon` lambda form info; but failed to re-construct
that information in `mkLFImported`
Closes #23231, #23146
(I've additionally batched some fixes to documentation I found while
investigating this issue)
- - - - -
0598f7f0 by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Make LFInfos for DataCons on construction
As a result of the discussion in !10165, we decided to amend the
previous commit which fixed the logic of `mkLFImported` with regard to
datacon workers and wrappers.
Instead of having the logic for the LFInfo of datacons be in
`mkLFImported`, we now construct an LFInfo for all data constructors on
GHC.Types.Id.Make and store it in the `lfInfo` field.
See the new Note [LFInfo of DataCon workers and wrappers] and
ammendments to Note [The LFInfo of Imported Ids]
- - - - -
12294b22 by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Update Note [Core letrec invariant]
Authored by @simonpj
- - - - -
e93ab972 by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Rename mkLFImported to importedIdLFInfo
The `mkLFImported` sounded too much like a constructor of sorts, when
really it got the `LFInfo` of an imported Id from its `lf_info` field
when this existed, and otherwise returned a conservative estimate of
that imported Id's LFInfo. This in contrast to functions such as
`mkLFReEntrant` which really are about constructing an `LFInfo`.
- - - - -
e54d9259 by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Enforce invariant on typePrimRepArgs in the types
As part of the documentation effort in !10165 I came across this
invariant on 'typePrimRepArgs' which is easily expressed at the
type-level through a NonEmpty list.
It allowed us to remove one panic.
- - - - -
b8fe6a0c by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Merge outdated Note [Data con representation] into Note [Data constructor representation]
Introduce new Note [Constructor applications in STG] to better support
the merge, and reference it from the relevant bits in the STG syntax.
- - - - -
e1590ddc by Simon Peyton Jones at 2023-05-23T03:46:57-04:00
Add the SolverStage monad
This refactoring makes a substantial improvement in the
structure of the type-checker's constraint solver: #23070.
Specifically:
* Introduced the SolverStage monad. See GHC.Tc.Solver.Monad
Note [The SolverStage monad]
* Make each solver pipeline (equalities, dictionaries, irreds etc)
deal with updating the inert set, as a separate SolverStage. There
is sometimes special stuff to do, and it means that each full
pipeline can have type SolverStage Void, indicating that they never
return anything.
* Made GHC.Tc.Solver.Equality.zonkEqTypes into a SolverStage. Much nicer.
* Combined the remnants of GHC.Tc.Solver.Canonical and
GHC.Tc.Solver.Interact into a new module GHC.Tc.Solver.Solve.
(Interact and Canonical are removed.)
* Gave the same treatment to dictionary and irred constraints
as I have already done for equality constraints:
* New types (akin to EqCt): IrredCt and DictCt
* Ct is now just a simple sum type
data Ct
= CDictCan DictCt
| CIrredCan IrredCt
| CEqCan EqCt
| CQuantCan QCInst
| CNonCanonical CtEvidence
* inert_dicts can now have the better type DictMap DictCt, instead of
DictMap Ct; and similarly inert_irreds.
* Significantly simplified the treatment of implicit parameters.
Previously we had a number of special cases
* interactGivenIP, an entire function
* special case in maybeKickOut
* special case in findDict, when looking up dictionaries
But actually it's simpler than that. When adding a new Given, implicit
parameter constraint to the InertSet, we just need to kick out any
existing inert constraints that mention that implicit parameter.
The main work is done in GHC.Tc.Solver.InertSet.delIPDict, along with
its auxiliary GHC.Core.Predicate.mentionsIP.
See Note [Shadowing of implicit parameters] in GHC.Tc.Solver.Dict.
* Add a new fast-path in GHC.Tc.Errors.Hole.tcCheckHoleFit.
See Note [Fast path for tcCheckHoleFit]. This is a big win in some cases:
test hard_hole_fits gets nearly 40% faster (at compile time).
* Add a new fast-path for solving /boxed/ equality constraints
(t1 ~ t2). See Note [Solving equality classes] in GHC.Tc.Solver.Dict.
This makes a big difference too: test T17836 compiles 40% faster.
* Implement the PermissivePlan of #23413, which concerns what happens with
insoluble Givens. Our previous treatment was wildly inconsistent as that
ticket pointed out.
A part of this, I simplified GHC.Tc.Validity.checkAmbiguity: now we simply
don't run the ambiguity check at all if -XAllowAmbiguousTypes is on.
Smaller points:
* In `GHC.Tc.Errors.misMatchOrCND` instead of having a special case for
insoluble /occurs/ checks, broaden in to all insouluble constraints.
Just generally better. See Note [Insoluble mis-match] in that module.
As noted above, compile time perf gets better. Here are the changes
over 0.5% on Fedora. (The figures are slightly larger on Windows for
some reason.)
Metrics: compile_time/bytes allocated
-------------------------------------
LargeRecord(normal) -0.9%
MultiLayerModulesTH_OneShot(normal) +0.5%
T11822(normal) -0.6%
T12227(normal) -1.8% GOOD
T12545(normal) -0.5%
T13035(normal) -0.6%
T15703(normal) -1.4% GOOD
T16875(normal) -0.5%
T17836(normal) -40.7% GOOD
T17836b(normal) -12.3% GOOD
T17977b(normal) -0.5%
T5837(normal) -1.1%
T8095(normal) -2.7% GOOD
T9020(optasm) -1.1%
hard_hole_fits(normal) -37.0% GOOD
geo. mean -1.3%
minimum -40.7%
maximum +0.5%
Metric Decrease:
T12227
T15703
T17836
T17836b
T8095
hard_hole_fits
LargeRecord
T9198
T13035
- - - - -
6abf3648 by Simon Peyton Jones at 2023-05-23T03:46:57-04:00
Avoid an assertion failure in abstractFloats
The function GHC.Core.Opt.Simplify.Utils.abstractFloats
was carelessly calling lookupIdSubst_maybe on a CoVar;
but a precondition of the latter is being given an Id.
In fact it's harmless to call it on a CoVar, but still, the
precondition on lookupIdSubst_maybe makes sense, so I added
a test for CoVars.
This avoids a crash in a DEBUG compiler, but otherwise has
no effect. Fixes #23426.
- - - - -
838aaf4b by hainq at 2023-05-24T12:41:19-04:00
Migrate errors in GHC.Tc.Validity
This patch migrates the error messages in GHC.Tc.Validity to use
the new diagnostic infrastructure.
It adds the constructors:
- TcRnSimplifiableConstraint
- TcRnArityMismatch
- TcRnIllegalInstanceDecl, with sub-datatypes for HasField errors
and fundep coverage condition errors.
- - - - -
8539764b by Krzysztof Gogolewski at 2023-05-24T12:41:56-04:00
linear lint: Add missing processing of DEFAULT
In this correct program
f :: a %1 -> a
f x = case x of x { _DEFAULT -> x }
after checking the alternative we weren't popping the case binder 'x'
from the usage environment, which meant that the lambda-bound 'x'
was counted twice: in the scrutinee and (incorrectly) in the alternative.
In fact, we weren't checking the usage of 'x' at all.
Now the code for handling _DEFAULT is similar to the one handling
data constructors.
Fixes #23025.
- - - - -
ae683454 by Matthew Pickering at 2023-05-24T12:42:32-04:00
Remove outdated "Don't check hs-boot type family instances too early" note
This note was introduced in 25b70a29f623 which delayed performing some
consistency checks for type families. However, the change was reverted
later in 6998772043a7f0b0360116eb5ffcbaa5630b21fb but the note was not
removed.
I found it confusing when reading to code to try and work out what
special behaviour there was for hs-boot files (when in-fact there isn't
any).
- - - - -
44af57de by Matthew Pickering at 2023-05-24T12:43:08-04:00
rts: Define ticky macro stubs
These macros have long been undefined which has meant we were missing
reporting these allocations in ticky profiles.
The most critical missing definition was TICK_ALLOC_HEAP_NOCTR which was
missing all the RTS calls to allocate, this leads to a the overall
ALLOC_RTS_tot number to be severaly underreported.
Of particular interest though is the ALLOC_STACK_ctr and ALLOC_STACK_tot
counters which are useful to tracking stack allocations.
Fixes #23421
- - - - -
b2dabe3a by Matthew Pickering at 2023-05-24T12:43:08-04:00
rts: ticky: Rename TICK_ALLOC_HEAP_NOCTR to TICK_ALLOC_RTS
This macro increments the ALLOC_HEAP_tot and ALLOC_HEAP_ctr so it makes
more sense to name it after that rather than the suffix NOCTR, whose
meaning has been lost to the mists of time.
- - - - -
eac4420a by Ben Gamari at 2023-05-24T12:43:45-04:00
users guide: A few small mark-up fixes
- - - - -
a320ca76 by Rodrigo Mesquita at 2023-05-24T12:44:20-04:00
configure: Fix support check for response files.
In failing to escape the '-o' in '-o\nconftest\nconftest.o\n' argument
to printf, the writing of the arguments response file always failed.
The fix is to pass the arguments after `--` so that they are treated
positional arguments rather than flags to printf.
Closes #23435
- - - - -
f21ce0e4 by mangoiv at 2023-05-24T12:45:00-04:00
[feat] add .direnv to the .gitignore file
- - - - -
36d5944d by Bodigrim at 2023-05-24T20:58:34-04:00
Add Data.List.unsnoc
See https://github.com/haskell/core-libraries-committee/issues/165 for discussion
- - - - -
c0f2f9e3 by Bartłomiej Cieślar at 2023-05-24T20:59:14-04:00
Fix crash in backpack signature merging with -ddump-rn-trace
In some cases, backpack signature merging could crash in addUsedGRE
when -ddump-rn-trace was enabled, as pretty-printing the GREInfo would cause
unavailable interfaces to be loaded.
This commit fixes that issue by not pretty-printing the GREInfo in addUsedGRE
when -ddump-rn-trace is enabled.
Fixes #23424
Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com>
- - - - -
5a07d94a by Krzysztof Gogolewski at 2023-05-25T03:30:20-04:00
Add a regression test for #13981
The panic was fixed by 6998772043a7f0b. Fixes #13981.
- - - - -
182df90e by Krzysztof Gogolewski at 2023-05-25T03:30:57-04:00
Add a test for #23355
It was fixed by !10061, so I'm adding it in the same group.
- - - - -
1b31b039 by uhbif19 at 2023-05-25T12:08:28+02:00
Migrate errors in GHC.Rename.Splice GHC.Rename.Pat
This commit migrates the errors in GHC.Rename.Splice and GHC.Rename.Pat
to use the new diagnostic infrastructure.
- - - - -
56abe494 by sheaf at 2023-05-25T12:09:55+02:00
Common up Template Haskell errors in TcRnMessage
This commit commons up the various Template Haskell errors into a
single constructor, TcRnTHError, of TcRnMessage.
- - - - -
a487ba9e by Krzysztof Gogolewski at 2023-05-25T14:35:56-04:00
Enable ghci tests for unboxed tuples
The tests were originally skipped because ghci used not to support
unboxed tuples/sums.
- - - - -
dc3422d4 by Matthew Pickering at 2023-05-25T18:57:19-04:00
rts: Build ticky GHC with single-threaded RTS
The threaded RTS allows you to use ticky profiling but only for the
counters in the generated code. The counters used in the C portion of
the RTS are disabled. Updating the counters is also racy using the
threaded RTS which can lead to misleading or incorrect ticky results.
Therefore we change the hadrian flavour to build using the
single-threaded RTS (mainly in order to get accurate C code counter
increments)
Fixes #23430
- - - - -
fbc8e04e by sheaf at 2023-05-25T18:58:00-04:00
Propagate long-distance info in generated code
When desugaring generated pattern matches, we skip pattern match checks.
However, this ended up also discarding long-distance information, which
might be needed for user-written sub-expressions.
Example:
```haskell
okay (GADT di) cd =
let sr_field :: ()
sr_field = case getFooBar di of { Foo -> () }
in case cd of { SomeRec _ -> SomeRec sr_field }
```
With sr_field a generated FunBind, we still want to propagate the outer
long-distance information from the GADT pattern match into the checks
for the user-written RHS of sr_field.
Fixes #23445
- - - - -
f8ced241 by Matthew Pickering at 2023-05-26T15:26:21-04:00
Introduce GHCiMessage to wrap GhcMessage
By introducing a wrapped message type we can control how certain
messages are printed in GHCi (to add extra information for example)
- - - - -
58e554c1 by Matthew Pickering at 2023-05-26T15:26:22-04:00
Generalise UnknownDiagnostic to allow embedded diagnostics to access
parent diagnostic options.
* Split default diagnostic options from Diagnostic class into
HasDefaultDiagnosticOpts class.
* Generalise UnknownDiagnostic to allow embedded diagnostics to access
options.
The principle idea here is that when wrapping an error message (such as
GHCMessage to make GHCiMessage) then we need to also be able to lift the
configuration when overriding how messages are printed (see load' for an
example).
- - - - -
b112546a by Matthew Pickering at 2023-05-26T15:26:22-04:00
Allow API users to wrap error messages created during 'load'
This allows API users to configure how messages are rendered when they
are emitted from the load function. For an example see how
'loadWithCache' is used in GHCi.
- - - - -
2e4cf0ee by Matthew Pickering at 2023-05-26T15:26:22-04:00
Abstract cantFindError and turn Opt_BuildingCabal into a print-time option
* cantFindError is abstracted so that the parts which mention specific
things about ghc/ghci are parameters. The intention being that
GHC/GHCi can specify the right values to put here but otherwise
display the same error message.
* The BuildingCabalPackage argument from GenericMissing is removed and
turned into a print-time option. The reason for the error is not
dependent on whether `-fbuilding-cabal-package` is passed, so we don't
want to store that in the error message.
- - - - -
34b44f7d by Matthew Pickering at 2023-05-26T15:26:22-04:00
error messages: Don't display ghci specific hints for missing packages
Tickets like #22884 suggest that it is confusing that GHC used on the
command line can suggest options which only work in GHCi.
This ticket uses the error message infrastructure to override certain
error messages which displayed GHCi specific information so that this
information is only showed when using GHCi.
The main annoyance is that we mostly want to display errors in the same
way as before, but with some additional information. This means that the
error rendering code has to be exported from the Iface/Errors/Ppr.hs
module.
I am unsure about whether the approach taken here is the best or most
maintainable solution.
Fixes #22884
- - - - -
05a1b626 by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Don't override existing metadata if version already exists.
If a nightly pipeline runs twice for some reason for the same version
then we really don't want to override an existing entry with new
bindists. This could cause ABI compatability issues for users or break
ghcup's caching logic.
- - - - -
fcbcb3cc by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Use proper API url for bindist download
Previously we were using links from the web interface, but it's more
robust and future-proof to use the documented links to the artifacts.
https://docs.gitlab.com/ee/api/job_artifacts.html
- - - - -
5b59c8fe by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Set Nightly and LatestNightly tags
The latest nightly release needs the LatestNightly tag, and all other
nightly releases need the Nightly tag. Therefore when the metadata is
updated we need to replace all LatestNightly with Nightly.`
- - - - -
914e1468 by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Download nightly metadata for correct date
The metadata now lives in https://gitlab.haskell.org/ghc/ghcup-metadata
with one metadata file per year. When we update the metadata we download
and update the right file for the current year.
- - - - -
16cf7d2e by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Download metadata and update for correct year
something about pipeline date
- - - - -
14792c4b by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Don't skip CI
On a push we now have a CI job which updates gitlab pages with the
metadata files.
- - - - -
1121bdd8 by Matthew Pickering at 2023-05-26T15:26:59-04:00
ghcup-metadata: Add --date flag to specify the release date
The ghcup-metadata now has a viReleaseDay field which needs to be
populated with the day of the release.
- - - - -
bc478bee by Matthew Pickering at 2023-05-26T15:26:59-04:00
ghcup-metadata: Add dlOutput field
ghcup now requires us to add this field which specifies where it should
download the bindist to. See
https://gitlab.haskell.org/ghc/ghcup-metadata/-/issues/1 for some more
discussion.
- - - - -
2bdbd9da by Josh Meredith at 2023-05-26T15:27:35-04:00
JS: Convert rendering to use HLine instead of SDoc (#22455)
- - - - -
abd9e37c by Norman Ramsey at 2023-05-26T15:28:12-04:00
testsuite: add WasmControlFlow test
This patch adds the WasmControlFlow test to test the wasm backend's
relooper component.
- - - - -
07f858eb by Sylvain Henry at 2023-05-26T15:28:53-04:00
Factorize getLinkDeps
Prepare reuse of getLinkDeps for TH implementation in the JS backend
(cf #22261 and review of !9779).
- - - - -
fad9d092 by Oleg Grenrus at 2023-05-27T13:38:08-04:00
Change GHC.Driver.Session import to .DynFlags
Also move targetPlatform selector
Plenty of GHC needs just DynFlags.
Even more can be made to use .DynFlags if more selectors is migrated.
This is a low hanging fruit.
- - - - -
69fdbece by Alan Zimmerman at 2023-05-27T13:38:45-04:00
EPA: Better fix for #22919
The original fix for #22919 simply removed the ability to match up
prior comments with the first declaration in the file.
Restore it, but add a check that the comment is on a single line, by
ensuring that it comes immediately prior to the next thing (comment or
start of declaration), and that the token preceding it is not on the
same line.
closes #22919
- - - - -
de928cf0 by Andrei Borzenkov at 2023-05-29T19:35:07+04:00
Use LHsToken for module, data, newtype, class, where in HsModule,
DataDecl and ClassDecl types
Updates the haddock submodule.
- - - - -
11 changed files:
- .gitignore
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/darwin/nix/sources.json
- .gitlab/darwin/toolchain.nix
- + .gitlab/gen-ci.cabal
- .gitlab/gen_ci.hs
- + .gitlab/generate_job_metadata
- .gitlab/generate_jobs
- .gitlab/hello.hs
- + .gitlab/hie.yaml
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4915acc018b083bd0c612fb25438ee4e6b0de4f7...de928cf0a1b0cd775b45bb304fe09e679871fb58
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4915acc018b083bd0c612fb25438ee4e6b0de4f7...de928cf0a1b0cd775b45bb304fe09e679871fb58
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230529/95ea5d70/attachment-0001.html>
More information about the ghc-commits
mailing list