[Git][ghc/ghc][wip/T24603] 27 commits: users guide: Fix typo
Serge S. Gulin (@gulin.serge)
gitlab at gitlab.haskell.org
Fri Mar 14 14:33:27 UTC 2025
Serge S. Gulin pushed to branch wip/T24603 at Glasgow Haskell Compiler / GHC
Commits:
cbae3708 by Ben Gamari at 2025-03-11T06:09:58-04:00
users guide: Fix typo
- - - - -
1951eb7a by Ben Gamari at 2025-03-11T06:10:35-04:00
testsuite: Don't count fragile passes as failures in JUnit output
As noted in #25806, the testsuite driver's JUnit output
previously considered passes of fragile tests to be failures. Fix this.
Closes #25806.
- - - - -
589f40b9 by Matthew Pickering at 2025-03-11T06:11:11-04:00
Use panic rather than error in expectJust
Otherwise, we would not get a callstack printed out when the exception
occurs.
Fixes #25829
- - - - -
d450e88e by sheaf at 2025-03-11T06:42:59-04:00
Solve Wanted quantified constraints from Givens
This commit ensures we directly solve Wanted quantified constraints from
matching inert Given quantified constraints,instead of going through the
trouble of emitting an implication constraint and processing that.
This is not just an optimisation; it makes our lives easier when
generating RULEs for specialisation.
See Note [Solving Wanted QCs from Given QCs] for details
Fixes #25758
- - - - -
48daaf53 by Ben Gamari at 2025-03-11T06:42:59-04:00
testsuite: Add testcase for #25577
- - - - -
d2ffb0ce by Ben Gamari at 2025-03-11T06:42:59-04:00
testsuite/ghc-api: Eliminate Makefile usage from various GHC API tests
These tests can be expressed perfectly well using the testsuite driver
itself.
- - - - -
2275b642 by Ben Gamari at 2025-03-11T06:42:59-04:00
rts/linker/MachO: Assert that GOT relocations have GOT entries
In #25577 we found that some GOT relocation types were not being given
relocation entries. Add assertions to catch this sort of failure in the
future.
- - - - -
8c96bcb4 by Ben Gamari at 2025-03-11T06:42:59-04:00
rts/linker/MachO: Account for internal GOT references in GOT construction
Previously we failed to give GOT slots to symbols which were referred to
by GOT relocations in the same module. This lead to #25577.
Fix this by explicitly traversing relocation lists and maintaining a
`needs_got` flag for each symbol.
Fixes #25577.
- - - - -
7b84c588 by Vladislav Zavialov at 2025-03-11T06:43:02-04:00
One list in ConPat (part of #25127)
This patch changes PrefixCon to use one list instead of two:
-data HsConDetails tyarg arg rec
- = PrefixCon [tyarg] [arg]
+data HsConDetails arg rec
+ = PrefixCon [arg]
| RecCon rec
| InfixCon arg arg
The [tyarg] list is now gone. To understand the effect of this change,
recall that there are three instantiations of HsConDetails:
1. type HsConPatDetails p =
HsConDetails (HsConPatTyArg (NoGhcTc p)) -- tyarg
(LPat p) -- arg
(HsRecFields p (LPat p)) -- rec
2. type HsConDeclH98Details pass =
HsConDetails Void -- tyarg
(HsScaled pass (LBangType pass)) -- arg
(XRec pass [LConDeclField pass]) -- rec
3. type HsPatSynDetails pass =
HsConDetails Void -- tyarg
(LIdP pass) -- arg
[RecordPatSynField pass] -- rec
In cases (2) and (3), tyarg was instantiated to Void, so the [tyarg]
list was always empty. Its removal is basically a no-op.
The interesting case is (1), which is used in ConPat to represent
pattern matching of the form (MkE @tp1 @tp2 p1 p2).
With this patch, its representation is changed as follows:
ConPat "MkE" [tp1, tp2] [p1, p2] -- old
ConPat "MkE" [InvisP tp1, InvisP tp2, p1, p2] -- new
The new mixed-list representation is consintent with lambdas, where
InvisP is already used to deal with \ @tp1 @tp2 p1 p2 -> body.
The immediate effect of the new representation is an improvement to
error messages. Consider the pattern (Con x @t y). Previously it
resulted in a parse error because @t could not occur after x. Now it is
reported as [GHC-14964]. Test case: TyAppPat_MisplacedApplication.
In the long term, this is intended as preparation for #18389 and #25127,
which would make (Con x @t y) potentially valid, e.g. if its type is
Con :: forall a -> forall b. (a, b) -> T
The TH AST is left unchanged for the moment to avoid breakage.
- - - - -
cce869ea by Vladislav Zavialov at 2025-03-11T06:43:02-04:00
Error message with EmptyCase and RequiredTypeArguments (#25004)
Fix a panic triggered by a combination of \case{} and forall t ->
ghci> let f :: forall (xs :: Type) -> (); f = \case {}
panic! (the 'impossible' happened)
GHC version 9.10.1:
Util: only
The new error message looks like this:
ghci> let f :: forall (xs :: Type) -> (); f = \case {}
<interactive>:5:41: error: [GHC-48010]
• Empty list of alternatives in \case expression
checked against a forall-type: forall xs -> ...
This is achieved as follows:
* A new data type, BadEmptyCaseReason, is now used to describe
why an empty case has been rejected. Used in TcRnEmptyCase.
* HsMatchContextRn is passed to tcMatches, so that the type checker
can attach the syntactic context to the error message.
* tcMatches now rejects type arguments if the list of alternatives is
empty. This is what fixes the bug.
- - - - -
37d8b50b by sheaf at 2025-03-11T06:43:06-04:00
user's guide: consolidate defaulting documentation
This commit adds a new section on defaulting, which consolidates various
parts of documentation surrounding defaulting into one central place.
It explains type class defaulting in detail, extensions to it with
OverloadedStrings, NamedDefaults and ExtendedDefaultRules, as well
as other defaulting mechanisms (e.g. kind-based defaulting such as
RuntimeRep defaulting, and defaulting of equalities).
- - - - -
0c9fd8d4 by sheaf at 2025-03-11T06:43:06-04:00
user's guide: flesh out XOverloadedStrings docs
This commit extends the documentation of the OverloadedStrings extension
with some usage information, in particular suggestions to:
- use default declarations, such as `default (Text)` or
`default IsString(Text)` (with the NamedDefaults extension),
- enable the ExtendedDefaultRules extension to relax the requirement
that a defaultable type variable must only appear in unary standard
classes
Fixes #23388
- - - - -
2df171d4 by sheaf at 2025-03-11T06:43:06-04:00
user's guide: NamedDefaults vs ExtendedDefaultRules
This commit clarifies the defaulting rules with NamedDefaults,
in particular in situations where a type variable appears in other
constraints than standard/unary constraints.
- - - - -
77df05d0 by Matthew Pickering at 2025-03-11T06:43:07-04:00
Take into account all flags when computing iface_hash
The "interface hash" should contain a hash of everything in the
interface file. We are not doing that yet but at least a start is to
include a hash of everything in `mi_self_recomp`, rather than just
`mi_src_hash` and `mi_usages`.
In particular, this fixes #25837, a bug where we should recompile a
`dyn_hi` file but fail to do so.
- - - - -
48b8f110 by Matthew Pickering at 2025-03-11T06:43:07-04:00
Pass -fPIC to dynamicToo001 test to avoid platform dependence issues
On darwin platforms, `-fPIC` is always enabled but on linux it is only
enabled in the dynamic flavour. This can cause a difference in
interface files (see #25836).
The purpose of this test isn't to test module A recompilation, so we
avoid this platform dependency by always passing `-fPIC`.
- - - - -
03c72f01 by Matthew Pickering at 2025-03-11T06:43:07-04:00
Remove mi_used_th field from interface files
In the distant past, recompilation checking was disabled for interfaces which used
TemplateHaskell, but for several years now recompilation checking has
been more fine-grained. This has rendered this field unused and
lingering in an interface file.
- - - - -
6bb0e261 by Matthew Pickering at 2025-03-11T06:43:07-04:00
Remove mi_hpc field from interface files
The `mi_hpc` field is not used for anything as far as I can discern so
there is no reason to record in the private interface of a module that
there are modules in the transitive closure which use `hpc`.
You can freely mix modules which use `-fhpc` and ones which don't.
Whether to recompile a module due to `-fhpc` being passed to the module
itself is determined in `fingerprintDynFlags`.
- - - - -
b6d5b091 by Simon Peyton Jones at 2025-03-11T22:39:23-04:00
We can't UNPACK multi-constructor GADTs
This MR fixes #25672
See Note [Unpacking GADTs and existentials] in GHC.Types.Id.Make
- - - - -
8eae151d by Teo Camarasu at 2025-03-11T22:40:00-04:00
template-haskell: Add explicit exports lists to all remaining modules
- - - - -
db621b58 by Teo Camarasu at 2025-03-11T22:40:00-04:00
template-haskell: fix haddocks
It seems that we need a direct dependency on ghc-internal, otherwise
Haddock cannot find our haddocks
The bug seems to be caused by Hadrian because if I rebuild with
cabal-install (without this extra dependency) then I get accurate
Haddocks.
Resolves #25705
- - - - -
64ea68d9 by Ben Gamari at 2025-03-12T07:11:51-04:00
mk-ghcup-metadata: Clean up and add type annotations
Getting this file right has historically been quite painful as it is a
dynamically-typed script running only late in the release pipeline.
- - - - -
b3f80b07 by Ben Gamari at 2025-03-12T07:12:27-04:00
rts: Drop imports of pthreads functions in cmm sources
These are no longer used. I noticed these while looking for uses of
__PIC__ in Cmm sources.
- - - - -
915a6781 by Matthew Pickering at 2025-03-13T01:46:41-04:00
interfaces: Ensure that forceModIface deeply forces a ModIface
A ModIface is the result of compilation that we keep for a long time in
memory. Therefore, it's very important to manage what we are going to
retain and remove any external references to things which we might have
captured compilation.
If storing your ModIface in memory uses too much space, then store
less things or make it use a more efficient representation.
In the past there have been many space leak bugs by not sufficiently
forcing a ModIface (#15111)
This patch adds all the missing NFData instances for all the places I
could find where we weren't deeply forcing the structure.
- - - - -
24d373a6 by Matthew Craven at 2025-03-13T01:47:18-04:00
Add interface-stability test for ghc-prim
- - - - -
77ce847c by Serge S. Gulin at 2025-03-14T18:33:09+04:00
Support for ARM64 Windows (LLVM-enabled) (fixes #24603)
submodule
Co-authored-by: Cheng Shao <terrorjack at type.dance>
Co-authored-by: Dmitrii Egorov <egorov.d.i at icloud.com>
Co-authored-by: Andrei Borzenkov <root at sandwitch.dev>
- - - - -
20c60806 by Serge S. Gulin at 2025-03-14T18:33:09+04:00
Basic NCG support for HelloWorld
- - - - -
c50c09a8 by Serge S. Gulin at 2025-03-14T18:33:09+04:00
Remove trailing whtespace to make CI greener
- - - - -
161 changed files:
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Data/Maybe.hs
- compiler/GHC/Data/Strict.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match/Constructor.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Recomp/Types.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Annotations.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/CostCentre.hs
- compiler/GHC/Types/CostCentre/State.hs
- compiler/GHC/Types/ForeignCall.hs
- compiler/GHC/Types/GREInfo.hs
- compiler/GHC/Types/HpcInfo.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Literal.hs
- compiler/GHC/Types/SourceFile.hs
- compiler/GHC/Types/SrcLoc.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/ModGuts.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Panic.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Type.hs
- compiler/Language/Haskell/Syntax/Type.hs-boot
- docs/users_guide/exts/named_defaults.rst
- docs/users_guide/exts/overloaded_strings.rst
- docs/users_guide/exts/poly_kinds.rst
- + docs/users_guide/exts/type_defaulting.rst
- docs/users_guide/exts/types.rst
- docs/users_guide/ghci.rst
- docs/users_guide/using-concurrent.rst
- libraries/Cabal
- libraries/Win32
- libraries/base/src/System/CPUTime/Windows.hsc
- libraries/base/tests/perf/encodingAllocations.hs
- libraries/directory
- libraries/ghc-boot/GHC/Serialized.hs
- libraries/haskeline
- libraries/process
- libraries/template-haskell/Language/Haskell/TH/Ppr.hs
- libraries/template-haskell/Language/Haskell/TH/PprLib.hs
- libraries/template-haskell/Language/Haskell/TH/Syntax.hs
- libraries/template-haskell/template-haskell.cabal.in
- libraries/unix
- llvm-targets
- m4/ghc_tables_next_to_code.m4
- rts/HeapStackCheck.cmm
- rts/PrimOps.cmm
- rts/StgCRun.c
- rts/linker/MachO.c
- rts/linker/MachOTypes.h
- rts/win32/veh_excn.c
- testsuite/driver/junit.py
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/driver/dynamicToo/dynamicToo001/Makefile
- + testsuite/tests/driver/dynamicToo/dynamicToo001/T25837.stdout
- + testsuite/tests/driver/dynamicToo/dynamicToo001/T25837Module.hs
- testsuite/tests/driver/dynamicToo/dynamicToo001/test.T
- testsuite/tests/ghc-api/Makefile
- + testsuite/tests/ghc-api/T25577.hs
- testsuite/tests/ghc-api/all.T
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/interface-stability/README.mkd
- testsuite/tests/interface-stability/all.T
- + testsuite/tests/interface-stability/ghc-prim-exports.stdout
- + testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/rename/should_fail/T22478b.stderr
- testsuite/tests/rename/should_fail/T22478e.stderr
- testsuite/tests/rename/should_fail/T22478f.stderr
- + testsuite/tests/simplCore/should_fail/T25672.hs
- + testsuite/tests/simplCore/should_fail/T25672.stderr
- testsuite/tests/simplCore/should_fail/all.T
- testsuite/tests/typecheck/should_fail/T19109.stderr
- testsuite/tests/typecheck/should_fail/T23776.stderr
- + testsuite/tests/typecheck/should_fail/T25004.hs
- + testsuite/tests/typecheck/should_fail/T25004.stderr
- testsuite/tests/typecheck/should_fail/TyAppPat_MisplacedApplication.hs
- testsuite/tests/typecheck/should_fail/TyAppPat_MisplacedApplication.stderr
- testsuite/tests/typecheck/should_fail/all.T
- utils/check-exact/ExactPrint.hs
- utils/dump-decls/Main.hs
- utils/ghc-toolchain/exe/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/html-test/ref/QuasiExpr.html
- utils/haddock/html-test/ref/TH.html
- utils/haddock/html-test/ref/Threaded_TH.html
- utils/hsc2hs
- utils/llvm-targets/gen-data-layout.sh
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3d4f0dd9f6e6e8f0fd0fe64db86a5432a2517aad...c50c09a82dd5253415ce9a32214b074086aca232
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3d4f0dd9f6e6e8f0fd0fe64db86a5432a2517aad...c50c09a82dd5253415ce9a32214b074086aca232
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/20250314/c14ec43d/attachment-0001.html>
More information about the ghc-commits
mailing list