[Git][ghc/ghc][wip/libffi-dep-hadrian] 10 commits: JS: fake support for native adjustors (#25159)

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Tue Sep 10 08:26:00 UTC 2024



Sylvain Henry pushed to branch wip/libffi-dep-hadrian at Glasgow Haskell Compiler / GHC


Commits:
03055c71 by Sylvain Henry at 2024-09-09T14:58:15-04:00
JS: fake support for native adjustors (#25159)

The JS backend doesn't support adjustors (I believe) and in any case if
it ever supports them it will be a native support, not one via libffi.

- - - - -
5bf0e6bc by Sylvain Henry at 2024-09-09T14:58:56-04:00
JS: remove redundant h$lstat

It was introduced a second time by mistake in
27dceb42376c34b99a38e36a33b2abc346ed390f (cf #25190)

- - - - -
ffbc2ab0 by Simon Peyton Jones at 2024-09-10T00:40:37-04:00
Refactor only newSysLocalDs

* Change newSysLocalDs to take a scaled type
* Add newSysLocalMDs that takes a type and makes a ManyTy local

Lots of files touched, nothing deep.

- - - - -
7124e4ad by Simon Peyton Jones at 2024-09-10T00:40:37-04:00
Don't introduce 'nospec' on the LHS of a RULE

This patch address #25160.  The main payload is:

* When desugaring the LHS of a RULE, do not introduce the `nospec` call
  for non-canonical evidence.  See GHC.Core.InstEnv
  Note [Coherence and specialisation: overview]

  The `nospec` call usually introdued in `dsHsWrapper`, but we don't want it
  on the LHS of a RULE (that's what caused #25160).  So now `dsHsWrapper` takes
  a flag to say if it's on the LHS of a RULE.  See wrinkle (NC1) in
  `Note [Desugaring non-canonical evidence]` in GHC.HsToCore.Binds.

But I think this flag will go away again when I have finished with my
(entirely separate) speciaise-on-values patch (#24359).

All this meant I had to re-understand the `nospec` stuff and coherence, and
that in turn made me do some refactoring, and add a lot of new documentation

The big change is that in GHC.Core.InstEnv, I changed
  the /type synonym/ `Canonical` into
  a /data type/ `CanonicalEvidence`
and documented it a lot better.

That in turn made me realise that CalLStacks were being treated with a
bit of a hack, which I documented in `Note [CallStack and ExecptionContext hack]`.

- - - - -
663daf8d by Simon Peyton Jones at 2024-09-10T00:40:37-04:00
Add defaulting of equalities

This MR adds one new defaulting strategy to the top-level
defaulting story: see Note [Defaulting equalities] in GHC.Tc.Solver.

This resolves #25029 and #25125, which showed that users were
accidentally relying on a GHC bug, which was fixed by

    commit 04f5bb85c8109843b9ac2af2a3e26544d05e02f4
    Author: Simon Peyton Jones <simon.peytonjones at gmail.com>
    Date:   Wed Jun 12 17:44:59 2024 +0100

    Fix untouchability test

    This MR fixes #24938.  The underlying problem was tha the test for
    "does this implication bring in scope any equalities" was plain wrong.

This fix gave rise to a number of user complaints; but the improved
defaulting story of this MR largely resolves them.

On the way I did a bit of refactoring, of course

* Completely restructure the extremely messy top-level defaulting
  code. The new code is in GHC.Tc.Solver.tryDefaulting, and is much,
  much, much esaier to grok.

- - - - -
e28cd021 by Andrzej Rybczak at 2024-09-10T00:41:18-04:00
Don't name a binding pattern

It's a keyword when PatternSynonyms are set.

- - - - -
b09571e2 by Simon Peyton Jones at 2024-09-10T00:41:54-04:00
Do not use an error thunk for an absent dictionary

In worker/wrapper we were using an error thunk for an absent dictionary,
but that works very badly for -XDictsStrict, or even (as #24934 showed)
in some complicated cases involving strictness analysis and unfoldings.

This MR just uses RubbishLit for dictionaries. Simple.

No test case, sadly because our only repro case is rather complicated.

- - - - -
8bc9f5f6 by Hécate Kleidukos at 2024-09-10T00:42:34-04:00
haddock: Remove support for applehelp format in the Manual

- - - - -
e3ff1b67 by Matthew Pickering at 2024-09-10T10:23:40+02:00
hadrian: Make sure ffi headers are built before using a compiler

When we are using ffi adjustors then we rely on `ffi.h` and
`ffitarget.h` files during code generation when compiling stubs.

Therefore we need to add this dependency to the build system (which this
patch does).

Reproducer, configure with `--enable-libffi-adjustors` and then build
"_build/stage1/libraries/ghc-prim/build/GHC/Types.p_o".

Observe that this fails before this patch and works afterwards.

Fixes #24864

- - - - -
86e78903 by Sylvain Henry at 2024-09-10T10:25:36+02:00
Try fixing Wasm

- - - - -


30 changed files:

- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Opt/CallerCC/Types.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/HsToCore/Foreign/Call.hs
- compiler/GHC/HsToCore/Foreign/JavaScript.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/HsToCore/ListComp.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/Irred.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/Unify.hs
- hadrian/src/Builder.hs
- libraries/ghc-internal/jsbits/base.js
- m4/ghc_adjustors_method.m4
- testsuite/tests/indexed-types/should_compile/Simple14.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5cddf22a03bb381a645d3ca63fab07a309311ffe...86e7890321477c72a20abc9c5c4d3dc39ee8bfea

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5cddf22a03bb381a645d3ca63fab07a309311ffe...86e7890321477c72a20abc9c5c4d3dc39ee8bfea
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/20240910/9e4cdb66/attachment-0001.html>


More information about the ghc-commits mailing list