Skip to content
Snippets Groups Projects
  1. Jul 26, 2023
    • Arnaud Spiwack's avatar
      Fix user-facing label in MR template · af6fdf42
      Arnaud Spiwack authored and Marge Bot's avatar Marge Bot committed
      af6fdf42
    • Bartłomiej Cieślar's avatar
      This MR is an implementation of the proposal #516. · 503fd647
      Bartłomiej Cieślar authored and Marge Bot's avatar Marge Bot committed
      It adds a warning -Wincomplete-record-selectors for usages of a record
      field access function (either a record selector or getField @"rec"),
      while trying to silence the warning whenever it can be sure that a constructor
      without the record field would not be invoked (which would otherwise cause
      the program to fail). For example:
      
          data T = T1 | T2 {x :: Bool}
      
          f a = x a -- this would throw an error
      
          g T1 = True
          g a = x a -- this would not throw an error
      
          h :: HasField "x" r Bool => r -> Bool
          h = getField @"x"
      
          j :: T -> Bool
          j = h -- this would throw an error because of the `HasField`
                -- constraint being solved
      
      See the tests DsIncompleteRecSel* and TcIncompleteRecSel for more examples of the warning.
      See Note [Detecting incomplete record selectors] in GHC.HsToCore.Expr for implementation details
      503fd647
    • Naïm Favier's avatar
      docs: Fix typo · fac9e84e
      Naïm Favier authored and Marge Bot's avatar Marge Bot committed
      fac9e84e
    • Rodrigo Mesquita's avatar
      configure: Default missing options to False when preparing ghc-toolchain Targets · 20db7e26
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      This commit fixes building ghc with 9.2 as the boostrap compiler.
      
      The ghc-toolchain patch assumed all _STAGE0 options were available, and
      forgot to account for this missing information in 9.2.
      
      Ghc 9.2 does not have in settings whether ar supports -l, hence can't
      report it with --info (unliked 9.4 upwards).
      
      The fix is to default the missing information (we default "ar supports
      -l" and other missing options to False)
      20db7e26
    • Krzysztof Gogolewski's avatar
      llvm: Restore accidentally deleted code in 0fc5cb97 · 79463036
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      Fixes #23711
      79463036
    • Gavin Zhao's avatar
      compiler: make -ddump-asm work with wasm backend NCG · 9393df83
      Gavin Zhao authored and Marge Bot's avatar Marge Bot committed
      
      Fixes #23503.
      
      Now the `-ddump-asm` flag is respected in the wasm backend
      NCG, so developers can directly view the generated ASM instead of
      needing to pass `-S` or `-keep-tmp-files` and manually find & open
      the assembly file.
      
      Ideally, we should be able to output the assembly files in smaller
      chunks like in other NCG backends. This would also make dumping assembly
      stats easier. However, this would require a large refactoring, so for
      short-term debugging purposes I think the current approach works fine.
      
      Signed-off-by: default avatarGavin Zhao <git@gzgz.dev>
      9393df83
    • Alan Zimmerman's avatar
      EPA: Simplify GHC/Parser.y comb4/comb5 · 355e1792
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Use the HasLoc instance from Ast.hs to allow comb4/comb5 to work with
      anything with a SrcSpan
      
      Also get rid of some more now unnecessary reLoc calls.
      355e1792
  2. Jul 25, 2023
  3. Jul 24, 2023
    • Matthew Pickering's avatar
      compiler: Remove unused `containers.h` include · 02e6a6ce
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      Fixes #23712
      02e6a6ce
    • Matthew Craven's avatar
      Kill off gen_bytearray_addr_access_ops.py · 32cae784
      Matthew Craven authored and Marge Bot's avatar Marge Bot committed
      The relevant primop descriptions are now
      generated directly by genprimopcode.
      
      This makes progress toward fixing #23490, but it is not
      a complete fix since there is more than one way in which
      cabal-reinstall (hadrian/build build-cabal) is broken.
      32cae784
    • Rodrigo Mesquita's avatar
      Ship ghc-toolchain in the bindist · 38e795ff
      Rodrigo Mesquita authored and Matthew Pickering's avatar Matthew Pickering committed
      Add the ghc-toolchain binary to the binary distribution we ship to
      users, and teach the bindist configure to use the existing ghc-toolchain.
      38e795ff
    • Rodrigo Mesquita's avatar
      Split ghc-toolchain executable to new packge · 61eea240
      Rodrigo Mesquita authored and Matthew Pickering's avatar Matthew Pickering committed
      In light of #23690, we split the ghc-toolchain executable out of the
      library package to be able to ship it in the bindist using Hadrian.
      
      Ideally, we eventually revert this commit.
      61eea240
    • Rodrigo Mesquita's avatar
      Add flag to enable/disable ghc-toolchain based configurations · a732b6d3
      Rodrigo Mesquita authored and Matthew Pickering's avatar Matthew Pickering committed
      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.
      a732b6d3
    • Rodrigo Mesquita's avatar
      ghc-toolchain: Toolchain Selection · 31dcd26c
      Rodrigo Mesquita authored and Matthew Pickering's avatar Matthew Pickering committed
      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)
      
      See also
      * Note [How we configure the bundled windows toolchain]
      * Note [ghc-toolchain consistency checking]
      * Note [ghc-toolchain overview]
      
      Ticket: #19877
      MR: !9263
      31dcd26c
    • Ben Gamari's avatar
      ghc-toolchain: Initial commit · 83cbc672
      Ben Gamari authored and Matthew Pickering's avatar Matthew Pickering committed
      83cbc672
  4. Jul 23, 2023
    • sheaf's avatar
      Add test for #22424 · 73b5c7ce
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This is a simple Template Haskell test in which we refer to
      record selectors by their exact Names, in two different ways.
      
      Fixes #22424
      73b5c7ce
    • Vladislav Zavialov's avatar
      Visible forall in types of terms: Part 1 (#22326) · 33b6850a
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This patch implements part 1 of GHC Proposal #281,
      introducing explicit `type` patterns and `type` arguments.
      
      Summary of the changes:
      
      1. New extension flag:
           RequiredTypeArguments
      
      2. New user-facing syntax:
           `type p` patterns    (represented by EmbTyPat)
           `type e` expressions (represented by HsEmbTy)
      
      3. Functions with required type arguments (visible forall)
         can now be defined and applied:
            idv :: forall a -> a -> a    -- signature   (relevant change: checkVdqOK in GHC/Tc/Validity.hs)
            idv (type a) (x :: a) = x    -- definition  (relevant change: tcPats in GHC/Tc/Gen/Pat.hs)
            x = idv (type Int) 42        -- usage       (relevant change: tcInstFun in GHC/Tc/Gen/App.hs)
      
      4. template-haskell support:
            TH.TypeE corresponds to HsEmbTy
            TH.TypeP corresponds to EmbTyPat
      
      5. Test cases and a new User's Guide section
      
      Changes *not* included here are the t2t (term-to-type) transformation
      and term variable capture; those belong to part 2.
      33b6850a
  5. Jul 22, 2023
    • Krzysztof Gogolewski's avatar
      Misc cleanup · a7349217
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      - Remove unused RDR names
      - Fix typos in comments
      - Deriving: simplify boxConTbl and remove unused litConTbl
      - chmod -x GHC/Exts.hs, this seems accidental
      a7349217
    • sheaf's avatar
      Stop marking plugin tests as fragile on Windows · cb9c93d7
      sheaf authored and Marge Bot's avatar Marge Bot committed
      Now that b2bb3e62 has landed we are in a better situation with
      regards to plugins on Windows, allowing us to unmark many plugin tests
      as fragile.
      
      Fixes #16405
      cb9c93d7
    • sheaf's avatar
      Mark plugins-external as broken on Windows · a72015d6
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This test is broken on Windows, so we explicitly mark it as such now
      that we stop skipping plugin tests on Windows.
      a72015d6
    • sheaf's avatar
      RTS: declare setKeepCAFs symbol · 42b05e9b
      sheaf authored and Marge Bot's avatar Marge Bot committed
      Commit 08ba8720 failed to declare the dependency of keepCAFsForGHCi on
      the symbol setKeepCAFs in the RTS, which led to undefined symbol errors
      on Windows, as exhibited by the testcase frontend001.
      
      Thanks to Moritz Angermann and Ryan Scott for the diagnosis and fix.
      
      Fixes #22961
      42b05e9b
    • Matthew Pickering's avatar
      ci: Mention ~full-ci label in MR template · b91bbc2b
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      We mention that if you need a full validation pipeline then you can
      apply the ~full-ci label to your MR in order to test against the full
      validation pipeline (like we do for marge).
      b91bbc2b
    • Jens Petersen's avatar
      user_guide/flags.py: python-3.12 no longer includes distutils · 026991d7
      Jens Petersen authored and Marge Bot's avatar Marge Bot committed
      packaging.version seems able to handle this fine
      026991d7
    • Matthew Pickering's avatar
      ci: Enable some more jobs to run in a marge batch · 4876fddc
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      In !10907 I made the majority of jobs not run on a validate pipeline but
      then forgot to renable a select few jobs on the marge batch MR.
      4876fddc
    • sheaf's avatar
      Finish migration of diagnostics in GHC.Tc.Validity · 7e05f6df
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This patch finishes migrating the error messages in GHC.Tc.Validity
      to use the new diagnostic infrastructure.
      
      It also refactors the error message datatypes for class and family
      instances, to common them up under a single datatype as much as possible.
      7e05f6df
    • Krzysztof Gogolewski's avatar
      Add a test for #23413 · 5ad8d597
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      It was fixed by commit e1590ddc: Add the SolverStage monad.
      5ad8d597
    • Matthew Pickering's avatar
      simplifier: Correct InScopeSet in rule matching · 4f5538a8
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The in-scope set passedto the `exprIsLambda_maybe` call lacked all the
      in-scope binders. @simonpj suggests this fix where we augment the
      in-scope set with the free variables of expression which fixes this
      failure mode in quite a direct way.
      
      Fixes #23630
      4f5538a8
    • Ilias Tsitsimpis's avatar
      ghc-prim: Link against libatomic · fc186b0c
      Ilias Tsitsimpis authored and Marge Bot's avatar Marge Bot committed
      Commit b4d39adb made 'hs_cmpxchg64()' available to all architectures.
      Unfortunately this made GHC to fail to build on armel, since armel needs
      libatomic to support atomic operations on 64-bit word sizes.
      
      Configure libraries/ghc-prim/ghc-prim.cabal to link against libatomic,
      the same way as we do in rts/rts.cabal.
      fc186b0c
    • Matthew Pickering's avatar
      Allow users to override non-essential haddock options in a Flavour · e4350b41
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      We now supply the non-essential options to haddock using the `extraArgs`
      field, which can be specified in a Flavour so that if an advanced user
      wants to change how documentation is generated then they can use
      something other than the `defaultHaddockExtraArgs`.
      
      This does have the potential to regress some packaging if a user has
      overridden `extraArgs` themselves, because now they also need to add
      the haddock options to extraArgs. This can easily be done by appending
      `defaultHaddockExtraArgs` to their extraArgs invocation but someone
      might not notice this behaviour has changed.
      
      In any case, I think passing the non-essential options in this manner is
      the right thing to do and matches what we do for the "ghc" builder,
      which by default doesn't pass any optmisation levels, and would likewise
      be very bad if someone didn't pass suitable `-O` levels for builds.
      
      Fixes #23625
      e4350b41
    • Ben Gamari's avatar
      testsuite: Elaborate in interface stability README · 87f9bd47
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This discussion didn't make it into the original MR.
      87f9bd47
    • Ben Gamari's avatar
      primops: Introduce unsafeThawByteArray# · c30cea53
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This addresses an odd asymmetry in the ByteArray# primops, which
      previously provided unsafeFreezeByteArray# but no corresponding
      thaw operation.
      
      Closes #22710
      c30cea53
  6. Jul 21, 2023
    • Finley McIlwaine's avatar
      Insert documentation into parsed signature modules · b444c16f
      Finley McIlwaine authored and Marge Bot's avatar Marge Bot committed
      Causes haddock comments in signature modules to be properly
      inserted into the AST (just as they are for regular modules)
      if the `-haddock` flag is given.
      
      Also adds a test that compares `-ddump-parsed-ast` output
      for a signature module to prevent further regressions.
      
      Fixes #23315
      b444c16f
    • Ben Gamari's avatar
      nativeGen: Set explicit section types on all platforms · db7f7240
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      db7f7240
    • Ben Gamari's avatar
      nativeGen: Explicitly set flags of text sections on Windows · 3ece9856
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      The binutils documentation (for COFF) claims,
      
      > If no flags are specified, the default flags depend upon the section
      > name. If the section name is not recognized, the default will be for the
      > section to be loaded and writable.
      
      We previously assumed that this would do the right thing for split
      sections (e.g. a section named `.text$foo` would be correctly inferred
      to be a text section). However, we have observed that this is not the
      case (at least under the clang toolchain used on Windows): when
      split-sections is enabled, text sections are treated by the assembler as
      data (matching the "default" behavior specified by the documentation).
      
      Avoid this by setting section flags explicitly. This should fix split
      sections on Windows.
      
      Fixes #22834.
      3ece9856
  7. Jul 20, 2023
    • Alan Zimmerman's avatar
      EPA: Simplify GHC/Parser.y sL1 · 0b23db03
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      This is the next patch in a series simplifying location management in
      GHC/Parser.y
      
      This one simplifies sL1, to use the HasLoc instances introduced in
      !10743 (closed)
      0b23db03
  8. Jul 19, 2023
    • Matthew Pickering's avatar
      ci: Make "fast-ci" the default validate configuration · 808b55cf
      Matthew Pickering authored
      We are trying out a lighter weight validation pipeline where by default
      we just test on 5 platforms:
      
      * x86_64-deb10-slow-validate
      * windows
      * x86_64-fedora33-release
      * aarch64-darwin
      * aarch64-linux-deb10
      
      In order to enable the "full" validation pipeline you can apply the
      `full-ci` label which will enable all the validation pipelines.
      
      All the validation jobs are still run on a marge batch.
      
      The goal is to reduce the overall CI capacity so that pipelines start
      faster for MRs and marge bot batches are faster.
      
      Fixes #23694
      808b55cf
    • Matthew Pickering's avatar
      gen_ci: Add hie.yaml file · 29ef590c
      Matthew Pickering authored
      This allows you to load `gen_ci.hs` into HLS, and now it is a huge
      module, that is quite useful.
      29ef590c
    • Matthew Pickering's avatar
      Remove unused files in .gitlab · ff884b77
      Matthew Pickering authored
      These were left over after 6078b429
      ff884b77
Loading