[Git][ghc/ghc][wip/toolchain-selection] 17 commits: base: fix haddock syntax in GHC.Profiling

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon Jul 17 17:31:21 UTC 2023



Rodrigo Mesquita pushed to branch wip/toolchain-selection at Glasgow Haskell Compiler / GHC


Commits:
e10556b6 by Teo Camarasu at 2023-07-14T16:28:46-04:00
base: fix haddock syntax in GHC.Profiling

- - - - -
0f3fda81 by Matthew Pickering at 2023-07-14T16:29:23-04:00
Revert "CI: add JS release and debug builds, regen CI jobs"

This reverts commit 59c5fe1d4b624423b1c37891710f2757bb58d6af.

This commit added two duplicate jobs on all validate pipelines, so we
are reverting for now whilst we work out what the best way forward is.

Ticket #23618

- - - - -
54bca324 by Alan Zimmerman at 2023-07-15T03:23:26-04:00
EPA: Simplify GHC/Parser.y sLL

Follow up to !10743

- - - - -
c8863828 by sheaf at 2023-07-15T03:24:06-04:00
Configure: canonicalise PythonCmd on Windows

This change makes PythonCmd resolve to a canonical absolute path on
Windows, which prevents HLS getting confused (now that we have a
build-time dependency on python).

fixes #23652

- - - - -
ca1e636a by Rodrigo Mesquita at 2023-07-15T03:24:42-04:00
Improve Note [Binder-swap during float-out]

- - - - -
cf86f3ec by Matthew Craven at 2023-07-16T01:42:09+02:00
Equality of forall-types is visibility aware

This patch finally (I hope) nails the question of whether
   (forall a. ty) and (forall a -> ty)
are `eqType`: they aren't!

There is a long discussion in #22762, plus useful Notes:

* Note [ForAllTy and type equality] in GHC.Core.TyCo.Compare
* Note [Comparing visiblities] in GHC.Core.TyCo.Compare
* Note [ForAllCo] in GHC.Core.TyCo.Rep

It also establishes a helpful new invariant for ForAllCo,
and ForAllTy, when the bound variable is a CoVar:in that
case the visibility must be coreTyLamForAllTyFlag.

All this is well documented in revised Notes.

- - - - -
7f13acbf by Vladislav Zavialov at 2023-07-16T01:56:27-04:00
List and Tuple<n>: update documentation

Add the missing changelog.md entries and @since-annotations.

- - - - -
2afbddb0 by Andrei Borzenkov at 2023-07-16T10:21:24+04:00
Type patterns (#22478, #18986)

Improved name resolution and type checking of type patterns in constructors:

1. HsTyPat: a new dedicated data type that represents type patterns in
   HsConPatDetails instead of reusing HsPatSigType

2. rnHsTyPat: a new function that renames a type
   pattern and collects its binders into three groups:
    - explicitly bound type variables, excluding locally bound
      variables
    - implicitly bound type variables from kind signatures
      (only if ScopedTypeVariables are enabled)
    - named wildcards (only from kind signatures)
2a. rnHsPatSigTypeBindingVars: removed in favour of rnHsTyPat
2b. rnImplcitTvBndrs: removed because no longer needed

3. collect_pat: updated to collect type variable binders from type patterns
   (this means that types and terms use the same infrastructure to detect
   conflicting bindings, unused variables and name shadowing)
3a. CollVarTyVarBinders: a new CollectFlag constructor that enables
    collection of type variables

4. tcHsTyPat: a new function that typechecks type patterns, capable of
   handling polymorphic kinds.
   See Note [Type patterns: binders and unifiers]

Examples of code that is now accepted:

   f = \(P @a) -> \(P @a) -> ...  -- triggers -Wname-shadowing

   g :: forall a. Proxy a -> ...
   g (P @a) = ...                 -- also triggers -Wname-shadowing

   h (P @($(TH.varT (TH.mkName "t")))) = ...
                                  -- t is bound at splice time

   j (P @(a :: (x,x))) = ...      -- (x,x) is no longer rejected

   data T where
     MkT :: forall (f :: forall k. k -> Type).
       f Int -> f Maybe -> T
   k :: T -> ()
   k (MkT @f (x :: f Int) (y :: f Maybe)) = ()
                                  -- f :: forall k. k -> Type

Examples of code that is rejected with better error messages:

  f (Left @a @a _) = ...
  -- new message:
  --     • Conflicting definitions for ‘a’
  --       Bound at: Test.hs:1:11
  --                 Test.hs:1:14

Examples of code that is now rejected:

  {-# OPTIONS_GHC -Werror=unused-matches #-}
  f (P @a) = ()
  -- Defined but not used: type variable ‘a’

- - - - -
eb1a6ab1 by sheaf at 2023-07-16T09:20:45-04:00
Don't use substTyUnchecked in newMetaTyVar

There were some comments that explained that we needed to use an
unchecked substitution function because of issue #12931, but that
has since been fixed, so we should be able to use substTy instead now.

- - - - -
c7bbad9a by sheaf at 2023-07-17T02:48:19-04:00
rnImports: var shouldn't import NoFldSelectors

In an import declaration such as

  import M ( var )

the import of the variable "var" should **not** bring into scope record
fields named "var" which are defined with NoFieldSelectors.
Doing so can cause spurious "unused import" warnings, as reported in
ticket #23557.

Fixes #23557

- - - - -
1af2e773 by sheaf at 2023-07-17T02:48:19-04:00
Suggest similar names in imports

This commit adds similar name suggestions when importing. For example

  module A where { spelling = 'o' }
  module B where { import B ( speling ) }

will give rise to the error message:

  Module ‘A’ does not export ‘speling’.
  Suggested fix: Perhaps use ‘spelling’

This also provides hints when users try to import record fields defined
with NoFieldSelectors.

- - - - -
654fdb98 by Alan Zimmerman at 2023-07-17T02:48:55-04:00
EPA: Store leading AnnSemi for decllist in al_rest

This simplifies the markAnnListA implementation in ExactPrint

- - - - -
784159b3 by Rodrigo Mesquita at 2023-07-17T18:13:55+01:00
Split GHC.Platform.ArchOS from ghc-boot into ghc-platform

Split off the `GHC.Platform.ArchOS` module from the `ghc-boot` package
into this reinstallable standalone package which abides by the PVP, in
part motivated by the ongoing work on `ghc-toolchain` towards runtime
retargetability.

- - - - -
8facf830 by Ben Gamari at 2023-07-17T18:13:55+01:00
ghc-toolchain: Initial commit

- - - - -
81e2cfa4 by Rodrigo Mesquita at 2023-07-17T18:13:55+01:00
ghc-toolchain: Toolchain Selection

This commit integrates ghc-toolchain, the brand new way of configuring
toolchains for GHC, with the Hadrian build system, with configure, and
extends and improves the first iteration of ghc-toolchain.

The general overview is

* We introduce a program invoked `ghc-toolchain --triple=...` which, when run,
  produces a file with a `Target`. A `GHC.Toolchain.Target.Target`
  describes the properties of a target and the toolchain (executables
  and configured flags) to produce code for that target

* Hadrian was modified to read Target files, and will both
  * Invoke the toolchain configured in the Target file as needed
  * Produce a `settings` file for GHC based on the Target file for that stage

* `./configure` will invoke ghc-toolchain to generate target files, but
  it will also generate target files based on the flags configure itself
  configured (through `.in` files that are substituted)

  * By default, the Targets generated by configure are still (for now) the ones used by Hadrian

  * But we additionally validate the Target files generated by
    ghc-toolchain against the ones generated by configure, to get a head
    start on catching configuration bugs before we transition
    completely.

  * When we make that transition, we will want to drop a lot of the
    toolchain configuration logic from configure, but keep it otherwise.

* For each compiler stage we should have 1 target file (up to a stage compiler we can't run in our machine)
  * We just have a HOST target file, which we use as the target for stage0
  * And a TARGET target file, which we use for stage1 (and later stages, if not cross compiling)
  * Note there is no BUILD target file, because we only support cross compilation where BUILD=HOST
  * (for more details on cross-compilation see discussion on !9263)

Ticket: #19877
MR: !9263

---

ghc-toolchain: Rename readProcess to readProcessStdout

Fixes bugs regarding a translation from the original autconf program
that failed to account for the exit code.

The longer name reenforces that we really only care about the stdout,
and the exit code and stderr of the program are irrelevant for the case.

Fixes

Re-introduce ld-override option

ghc-toolchain library and usage in hadrian flags

Re-introduce flags in hadrian config

ghc-toolchain: UseLibFFI, LdCompactUnwind, LdFileList

A more complete ghc-toolchain.
Added configuration of:

* Use libffi for adjustors
* Supports compact unwind
* Supports filelist

Handle passing CPP cmd and flags from configure to ghc-toolchain

Rip more of configure that is no longer being used

Remove configure checks of GNUnoexecStack and ident directive

And fix bug in ghc-toolchain respective code

Rip out more from hadrians system.config.in

Configure CLink supports response files

Read deleted keys from host and target's target

Delete CMD_OPTS_STAGEX

Instead of having configure configure different options for different
programs depend on the stage, we delete this completely and have hadrian
select the correct target toolchain configuration file depending on the
stage, from which it can read those options.

Fix [host|target]-[os|arch] vs [host|target]-haskell-[os|arch]

Handle unspecified vs specified flags and commands better

Configure Cpp and HsCpp separately

Fixes for compilation

Link is GNU linkerg

Revert "Rip more of configure that is no longer being used"

I realized we still need this function in rts/configure.ac

This reverts commit 01f5d4b4.

Revert get_arm_isa deletion from 74f03f24

As in the previous commit, we still need this info from the rts
configure script.

I suppose it could be useful for the rts to also read somehow the
toolchain information...

helper AC function for enable/disable

Delete unused imports of SysTools.Info

Drop PROG_CPP in distrib/autoconf too

Get rid of MonadCatch instances and dependencies

ghc-toolchain: Check Cc supports extra-via-c-flags

Consider empty programs as non-specified programs

Cpp and HsCpp cleanup

Add comment from check for gold t22266

Remove more settings bits from hadrian/cfg

Use llvm target from ghc-toolchain

Print default.target

Fix bugs in MergeTool and Ar

Add check and log errors on error

X

Revert LLVMTarget deletion in mkprojectmkin

Fix stack job

Fixes for ghc-toolchain to match configure output

ghc-toolchain: Fix ar supports at file

Fixes

ghc-toolchain: Fix check for gold bug

ghc-toolchain: configure linker options correctly

Support more targets and dont use llvmtarget

allow duplos in place of triples

A TODO comment

ghc-toolchain: set CC LD plat. dependent flags

A lot to be said about the approach of configuring linker flags (what
used to be SET CC LD platform dependent flags in configure), we might
want to re-do this all eventually...
Perhaps I ought to add a TODO at the top level of these functions?

We might also not do it altogether, some of these might be outdated?

Move osElfTarget from GHC.Platform to GHC.Platform.ArchOS, to use it in
Toolchain.Tools.Link to correctly determine if -Wl,--no-as-needed is required

Windows bundled toolchain, output path, etc

Add windows bundled toolchain specific flags

refactor on hadrian handling of toolchains

Fixes to hadrian and ghc-toolchain

Create ghc_toolchain.m4

Don't pass options to ghc-toolchain, it should arrive at the same conclusion as configure for now

Don't crash on ghc-toolchain failure

Mingw bundled toolchain

leftovers

Delete a part

Use ghc-platform instead of ghc-boot

configure: Create and validate toolchain target file

Interpolate LeadingUnderscore in distrib/configure.ac.in

Rename target files to hadrian/cfg (not on bindist)

Add Note [How we configure the bundled windows toolchain]

Add Note [ghc-toolchain consistency checking]

Fix hadrian 99974tooldir substituttion

- - - - -
e29d8286 by Rodrigo Mesquita at 2023-07-17T18:13:55+01:00
Add flag to enable/disable ghc-toolchain based configurations

This flag is disabled by default, and we'll use the
configure-generated-toolchains by default until we remove the toolchain
configuration logic from configure.

- - - - -
0261da57 by Rodrigo Mesquita at 2023-07-17T18:31:06+01:00
Address review

Apply 10 suggestion(s) to 4 file(s)

- - - - -


30 changed files:

- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- + TODO
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Reduction.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCo/FVs.hs-boot
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCo/Tidy.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToIface.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/Quote.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Rename.hs
- compiler/GHC/Iface/Syntax.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9896d0a081dc6b2e953765834233d645c885cad6...0261da573c13e6b7d371674b722b57fc89b3f926

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9896d0a081dc6b2e953765834233d645c885cad6...0261da573c13e6b7d371674b722b57fc89b3f926
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/20230717/42a76b5e/attachment-0001.html>


More information about the ghc-commits mailing list