Skip to content
Snippets Groups Projects
  1. Mar 05, 2024
    • Matthew Pickering's avatar
      Fix haddock source links and hyperlinked source · 23f2a478
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There were a few issues with the hackage links:
      
      1. We were using the package id rather than the package name for the
         package links. This is fixed by now allowing the template to mention
         %pkg% or %pkgid% and substituing both appropiatly.
      2. The `--haddock-base-url` flag is renamed to `--haddock-for-hackage`
         as the new base link works on a local or remote hackage server.
      3. The "src" path including too much stuff, so cross-package source
         links were broken as the template was getting double expanded.
      
      Fixes #24086
      23f2a478
  2. Mar 01, 2024
  3. Feb 27, 2024
  4. Feb 26, 2024
    • Cheng Shao's avatar
      hadrian/hie-bios: pass -j to hadrian · c71bfdff
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This commit passes -j to hadrian in the hadrian/hie-bios scripts. When
      the user starts HLS in a fresh clone that has just been configured, it
      takes quite a while for hie-bios to pick up the ghc flags and start
      actual indexing, due to the fact that the hadrian build step defaulted
      to -j1, so -j speeds things up and improve HLS user experience in GHC.
      Also add -j flag to .ghcid to speed up ghcid, and sets the Windows
      build root to .hie-bios which also works and unifies with other
      platforms, the previous build root _hie-bios was missing from
      .gitignore anyway.
      c71bfdff
  5. Feb 21, 2024
  6. Feb 19, 2024
  7. Feb 13, 2024
  8. Feb 08, 2024
    • John Ericson's avatar
      Generate LLVM min/max bound policy via Hadrian · c37931b3
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      Per #23966, I want the top-level configure to only generate
      configuration data for Hadrian, not do any "real" tasks on its own.
      This is part of that effort --- one less file generated by it.
      
      (It is still done with a `.in` file, so in a future world non-Hadrian
      also can easily create this file.)
      
      Split modules:
      
      - GHC.CmmToLlvm.Config
      - GHC.CmmToLlvm.Version
      - GHC.CmmToLlvm.Version.Bounds
      - GHC.CmmToLlvm.Version.Type
      
      This also means we can get rid of the silly `unused.h` introduced in
      !6803 / 7dfcab2f as temporary kludge.
      
      Part of #23966
      c37931b3
    • Matthew Pickering's avatar
      Update bootstrap plans for 9.4.8 and 9.6.4 · 5fcd58be
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      5fcd58be
    • Matthew Pickering's avatar
      Use specific clang assembler when compiling with -fllvm · ab533e71
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There are situations where LLVM will produce assembly which older gcc
      toolchains can't handle. For example on Deb10, it seems that LLVM >= 13
      produces assembly which the default gcc doesn't support.
      
      A more robust solution in the long term is to require a specific LLVM
      compatible assembler when using -fllvm.
      
      Fixes #16354
      ab533e71
    • Ben Gamari's avatar
      Bump filepath to 1.5.0.0 · f2dffd2e
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Required bumps of the following submodules:
      
       * `directory`
       * `filepath`
       * `haskeline`
       * `process`
       * `unix`
       * `hsc2hs`
       * `Win32`
       * `semaphore-compat`
      
      and the addition of `os-string` as a boot package.
      f2dffd2e
    • Ben Gamari's avatar
      hadrian: Set -this-package-name · d7ee12ea
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      When constructing the GHC flags for a package Hadrian must take care to
      set `-this-package-name` in addition to `-this-unit-id`. This hasn't
      broken until now as we have not had any uses of qualified package
      imports. However, this will change with `filepath-1.5` and the
      corresponding `unix` bump, breaking `hadrian/multi-ghci`.
      d7ee12ea
    • Ben Gamari's avatar
      Add os-string as a boot package · 9060d55b
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Introduces `os-string` submodule. This will be necessary for
      `filepath-1.5`.
      9060d55b
    • Ben Gamari's avatar
      Move `base` to `ghc-internal` · 44f6557a
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Here we move a good deal of the implementation of `base` into a new
      package, `ghc-internal` such that it can be evolved independently
      from the user-visible interfaces of `base`.
      
      While we want to isolate implementation from interfaces, naturally, we
      would like to avoid turning `base` into a mere set of module re-exports.
      However, this is a non-trivial undertaking for a variety of reasons:
      
       * `base` contains numerous known-key and wired-in things, requiring
         corresponding changes in the compiler
      
       * `base` contains a significant amount of C code and corresponding
         autoconf logic, which is very fragile and difficult to break apart
      
       * `base` has numerous import cycles, which are currently dealt with via
         carefully balanced `hs-boot` files
      
       * We must not break existing users
      
      To accomplish this migration, I tried the following approaches:
      
      * [Split-GHC.Base]: Break apart the GHC.Base knot to allow incremental
        migration of modules into ghc-internal: this knot is simply too
        intertwined to be easily pulled apart, especially given the rather
        tricky import cycles that it contains)
      
      * [Move-Core]: Moving the "core" connected component of base (roughly
        150 modules) into ghc-internal. While the Haskell side of this seems
        tractable, the C dependencies are very subtle to break apart.
      
      * [Move-Incrementally]:
      
        1. Move all of base into ghc-internal
        2. Examine the module structure and begin moving obvious modules (e.g.
           leaves of the import graph) back into base
        3. Examine the modules remaining in ghc-internal, refactor as necessary
           to facilitate further moves
        4. Go to (2) iterate until the cost/benefit of further moves is
           insufficient to justify continuing
        5. Rename the modules moved into ghc-internal to ensure that they don't
           overlap with those in base
        6. For each module moved into ghc-internal, add a shim module to base
           with the declarations which should be exposed and any requisite
           Haddocks (thus guaranteeing that base will be insulated from changes
           in the export lists of modules in ghc-internal
      
      Here I am using the [Move-Incrementally] approach, which is empirically
      the least painful of the unpleasant options above
      
      Bumps haddock submodule.
      
      Metric Decrease:
          haddock.Cabal
          haddock.base
      Metric Increase:
          MultiComponentModulesRecomp
          T16875
          size_hello_artifact
      44f6557a
  9. Jan 24, 2024
    • Cheng Shao's avatar
      Fix genapply for cross-compilation by nuking fragile CPP logic · dd4af0e5
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This commit fixes incorrectly built genapply when cross compiling
      (#24347) by nuking all fragile CPP logic in it from the orbit. All
      target-specific info are now read from DerivedConstants.h at runtime,
      see added note for details. Also removes a legacy Makefile and adds
      haskell language server support for genapply.
      dd4af0e5
  10. Jan 20, 2024
  11. Jan 16, 2024
    • Matthew Pickering's avatar
      hadrian: Reduce Cabal verbosity · 65da79b3
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The comment claims that `simpleUserHooks` decrease verbosity, and it
      does, but only for the `postConf` phase. The other phases are too
      verbose with `-V`.
      
      At the moment > 5000 lines of the build log are devoted to output from
      `cabal copy`.
      
      So I take the simple approach and just decrease the verbosity level
      again.
      
      If the output of `postConf` is essential then it would be better to
      implement our own `UserHooks` which doesn't decrease the verbosity for
      `postConf`.
      
      Fixes #24338
      65da79b3
  12. Jan 15, 2024
    • Krzysztof Gogolewski's avatar
      Make the build more strict on documentation errors · da908790
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      * Detect undefined labels. This can be tested by adding :ref:`nonexistent`
        to a documentation rst file; attempting to build docs will fail.
        Fixed the undefined label in `9.8.1-notes.rst`.
      * Detect errors. While we have plenty of warnings, we can at least enforce
        that Sphinx does not report errors.
        Fixed the error in `required_type_arguments.rst`.
      
      Unrelated change: I have documented that the `-dlint` enables
      `-fcatch-nonexhaustive-cases`, as can be verified by checking
      `enableDLint`.
      da908790
  13. Dec 21, 2023
    • Matthew Pickering's avatar
      hadrian: Build all executables in bin/ folder · f7e21fab
      Matthew Pickering authored
      In the end the bindist creation logic copies them all into the bin
      folder. There is no benefit to building a specific few binaries in the
      lib/bin folder anymore.
      
      This also removes the ad-hoc logic to copy the touchy and unlit
      executables from stage0 into stage1. It takes <1s to build so we might
      as well just build it.
      f7e21fab
  14. Dec 06, 2023
  15. Nov 22, 2023
  16. Nov 21, 2023
    • Rodrigo Mesquita's avatar
      Improve error message when reading invalid `.target` files · f158a8d0
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      A `.target` file generated by ghc-toolchain or by configure can become
      invalid if the target representation (`Toolchain.Target`) is changed
      while the files are not re-generated by calling `./configure` or
      `ghc-toolchain` again. There is also the issue of hadrian caching the
      dependencies on `.target` files, which makes parsing fail when reading
      reading the cached value if the representation has been updated.
      
      This patch provides a better error message in both situations, moving
      away from a terrible `Prelude.read: no parse` error that you would get
      otherwise.
      
      Fixes #24199
      f158a8d0
  17. Nov 15, 2023
    • Rodrigo Mesquita's avatar
      darwin: Fix single_module is obsolete warning · e6c803f7
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      In XCode 15's linker, -single_module is the default and otherwise
      passing it as a flag results in a warning being raised:
      
          ld: warning: -single_module is obsolete
      
      This patch fixes this warning by, at configure time, determining whether
      the linker supports -single_module (which is likely false for all
      non-darwin linkers, and true for darwin linkers in previous versions of
      macOS), and using that information at runtime to decide to pass or not
      the flag in the invocation.
      
      Fixes #24168
      e6c803f7
  18. Nov 10, 2023
    • PHO's avatar
      Don't assume the current locale is *.UTF-8, set the encoding explicitly · 52c0fc69
      PHO authored and Marge Bot's avatar Marge Bot committed
      primops.txt contains Unicode characters:
      > LC_ALL=C ./genprimopcode --data-decl < ./primops.txt
      > genprimopcode: <stdin>: hGetContents: invalid argument (cannot decode byte sequence starting from 226)
      
      Hadrian must also avoid using readFile' to read primops.txt because it
      tries to decode the file with a locale-specific encoding.
      52c0fc69
  19. Nov 05, 2023
  20. Nov 02, 2023
  21. Oct 22, 2023
  22. Oct 18, 2023
    • John Ericson's avatar
      Generate `ghcversion.h` from a `.in` file · 0295375a
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      Now that there are no conditional sections (see the previous commit), we
      can just a do simple substitution rather than pasting it together line
      by line.
      
      Progress on #23966
      0295375a
    • John Ericson's avatar
      Make Hadrian solely responsible for substituting `docs/users_guide/ghc_config.py.in` · f9436990
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      Fixes #24091
      Progress on #23966
      
      Issue #24091 reports that `@ProjectVersion@` is no longer being
      substituted in the GHC user's guide. I assume this is a recent issue,
      but I am not sure how it's worked since
      c1a3ecde; it looks like both Hadrian and
      configure are trying to substitute the same `.in` file!
      
      Now only Hadrian does. That is better anyways; already something that
      issue #23966 requested.
      
      It seems like we were missing some dependencies in Hadrian. (I really,
      really hate that this is possible!) Hopefully it is fixed now.
      f9436990
    • Sylvain Henry's avatar
      Hadrian: enable `-fcheck-prim-bounds` in validate flavour · 72c7380c
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      This allows T24066 to fail when the bug is present.
      
      Otherwise the out-of-bound access isn't detected as it happens in
      ghc-bignum which wasn't compiled with the bounds check.
      72c7380c
  23. Oct 14, 2023
    • Ilias Tsitsimpis's avatar
      hadrian: Pass -DNOSMP to C compiler when needed · 257c2807
      Ilias Tsitsimpis authored and Marge Bot's avatar Marge Bot committed
      Hadrian passes the -DNOSMP flag to GHC when the target doesn't support
      SMP, but doesn't pass it to CC as well, leading to the following
      compilation error on mips64el:
      
      | Run Cc (FindCDependencies CDep) Stage1: rts/sm/NonMovingScav.c => _build/stage1/rts/build/c/sm/NonMovingScav.o.d
      Command line: /usr/bin/mips64el-linux-gnuabi64-gcc -E -MM -MG -MF _build/stage1/rts/build/c/hooks/FlagDefaults.thr_debug_p_o.d -MT _build/stage1/rts/build/c/hooks/FlagDefaults.o -Irts/include -I_build/stage1/rts/build -I_build/stage1/rts/build/include -Irts/include -x c rts/hooks/FlagDefaults.c -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Winline -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls -Wundef -fno-strict-aliasing -DTHREADED_RTS -DDEBUG -fomit-frame-pointer -O2 -g -Irts -I_build/stage1/rts/build -DDEBUG -fno-omit-frame-pointer -g3 -O0
      ===> Command failed with error code: 1
      In file included from rts/include/Stg.h:348,
                       from rts/include/Rts.h:38,
                       from rts/hooks/FlagDefaults.c:8:
      rts/include/stg/SMP.h:416:2: error: #error memory barriers unimplemented on this architecture
        416 | #error memory barriers unimplemented on this architecture
            |  ^~~~~
      rts/include/stg/SMP.h:440:2: error: #error memory barriers unimplemented on this architecture
        440 | #error memory barriers unimplemented on this architecture
            |  ^~~~~
      rts/include/stg/SMP.h:464:2: error: #error memory barriers unimplemented on this architecture
        464 | #error memory barriers unimplemented on this architecture
            |  ^~~~~
      
      The old make system correctly passed this flag to both GHC and CC [1].
      
      Fix this error by passing -DNOSMP to CC as well.
      
      [1] https://gitlab.haskell.org/ghc/ghc/-/blob/00920f176b0235d5bb52a8e054d89a664f8938fe/rts/ghc.mk#L407
      
      Closes #24082
      257c2807
    • Matthew Pickering's avatar
      hadrian: Move ghcBinDeps into ghcLibDeps · 32523713
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      This completes a5227080, the
      `ghc-usage.txt` and `ghci-usage.txt` file are also used by the `ghc`
      library so need to make sure they are present in the libdir even if we
      are not going to build `ghc-bin`.
      
      This also fixes things for cross compilers because the stage2
      cross-compiler requires the ghc-usage.txt file, but we are using
      the stage2 lib folder but not building stage3:exe:ghc-bin so
      ghc-usage.txt was not being generated.
      32523713
  24. Oct 13, 2023
    • John Ericson's avatar
      Do not substitute `@...@` for stage-specific values in cabal files · 08fc27af
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      
      `rts` and `ghc-prim` now no longer have a `*.cabal.in` to set Cabal flag
      defaults; instead manual choices are passed to configure in the usual
      way.
      
      The old way was fundamentally broken, because it meant we were baking
      these Cabal files for a specific stage. Now we only do stage-agnostic
      @...@ substitution in cabal files (the GHC version), and so all
      stage-specific configuration is properly confined to `_build` and the
      right stage dir.
      
      Also `include-ghc-prim` is a flag that no longer exists for `ghc-prim`
      (it was removed in 835d8ddb) so I got
      rid of it.
      
      Co-Authored-By: default avatarMatthew Pickering <matthewtpickering@gmail.com>
      08fc27af
Loading