1. 21 May, 2019 1 commit
    • David Eichmann's avatar
      Refactor Libffi and RTS rules · 0af519ac
      David Eichmann authored
      This removes a hack that copies libffi files to the rts
      build directory. This was done in a libffi rule, but now
      an rts rule correctly needs and copies the relevant
      files from the libffi build dir to the rts build dir.
      Issues: #16272 #16304
  2. 14 May, 2019 4 commits
    • Alp Mestanogullari's avatar
      Hadrian: 'need' source files for various docs in Rules.Documentation · a416ae26
      Alp Mestanogullari authored
      Previously, changing one of the .rst files from the user guide would not cause
      the user guide to be rebuilt. This patch take a first stab at declaring the
      documentation source files that our documentation rules depend on, focusing
      on the .rst files only for now.
      We eventually might want to rebuild docs when we, say, change the haddock style
      file, but this level of tracking isn't really necessary for now.
      This fixes #16645.
    • Vladislav Zavialov's avatar
      Restore the --coerce option in 'happy' configuration · 684dc290
      Vladislav Zavialov authored
      happy-1.19.10 has been released with a fix for --coerce in the presence
      of higher rank types. This should result in about 10% performance
      improvement in the parser.
    • John Ericson's avatar
      Remove all target-specific portions of Config.hs · e529c65e
      John Ericson authored
      1. If GHC is to be multi-target, these cannot be baked in at compile
      2. Compile-time flags have a higher maintenance than run-time flags.
      3. The old way makes build system implementation (various bootstrapping
         details) with the thing being built. E.g. GHC doesn't need to care
         about which integer library *will* be used---this is purely a crutch
         so the build system doesn't need to pass flags later when using that
      4. Experience with cross compilation in Nixpkgs has shown things work
         nicer when compiler's can *optionally* delegate the bootstrapping the
         package manager. The package manager knows the entire end-goal build
         plan, and thus can make top-down decisions on bootstrapping. GHC can
         just worry about GHC, not even core library like base and ghc-prim!
    • John Ericson's avatar
      hadrian: Make settings stage specific · 015a21b8
      John Ericson authored
  3. 10 May, 2019 1 commit
    • David Eichmann's avatar
      Hadrian: programs need registered ghc-pkg libraries · bfcd986d
      David Eichmann authored
      In Hadrian, building programs (e.g. `ghc` or `haddock`) requires libraries located in the ghc-pkg package database i.e.
      Add the corresponding `need`s for these library files and the subsequent rules.
  4. 08 May, 2019 1 commit
  5. 06 May, 2019 2 commits
    • Alp Mestanogullari's avatar
      Hadrian: override $(ghc-config-mk), to prevent redundant config generation · ba0aed2e
      Alp Mestanogullari authored
      This required making the 'ghc-config-mk' variable overridable in
      testsuite/mk/boilerplate.mk, and then making use of this in hadrian
      to point to '<build root>/test/ghcconfig' instead, which is where we
      always put the test config.
      Previously, we would build ghc-config and run it against the
      GHC to be tested, a second time, while we're running the tests, because some
      include testsuite/mk/boilerplate.mk. This was causing unexpected output
    • John Ericson's avatar
      Remove cGhcEnableTablesNextToCode · 27941064
      John Ericson authored
      Get "Tables next to code" from the settings file instead.
  6. 01 May, 2019 2 commits
    • John Ericson's avatar
      Move cGHC_UNLIT_PGM to be "unlit command" in settings · 2988ef5e
      John Ericson authored
      The bulk of the work was done in #712, making settings be make/Hadrian
      controlled. This commit then just moves the unlit command rules in
      make/Hadrian from the `Config.hs` generator to the `settings` generator
      in each build system.
      I think this is a good change because the crucial benefit is *settings*
      don't affect the build: ghc gets one baby step closer to being a regular
      cabal executable, and make/Hadrian just maintains settings as part of
    • John Ericson's avatar
      Generate settings by make/hadrian instead of configure · d37d91e9
      John Ericson authored
      This allows it to eventually become stage-specific
  7. 22 Apr, 2019 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: use the testsuite driver's config.haddock arg more correctly · 51655fd8
      Alp Mestanogullari authored
      4 haddock tests assume that .haddock files have been produced, by using the
      'req_haddock' modifier. The testsuite driver assumes that this condition is
      satisfied if 'config.haddock' is non-empty, but before this patch Hadrian was
      always passing the path to where the haddock executable should be, regardless
      of whether it is actually there or not.
      Instead, we now pass an empty config.haddock when we can't find all of
      <build root>/docs/html/libraries/<pkg>/<pkg>.haddock>, where <pkg> ranges over
      array, base, ghc-prim, process and template-haskell, and pass the path
      to haddock when all those file exists. This has the (desired) effect of skipping
      the 4 tests (marked as 'missing library') when the docs haven't been built,
      and running the haddock tests when they have.
  8. 19 Apr, 2019 1 commit
  9. 18 Apr, 2019 1 commit
  10. 16 Apr, 2019 1 commit
  11. 14 Apr, 2019 3 commits
  12. 12 Apr, 2019 2 commits
    • Alp Mestanogullari's avatar
      Hadrian: add a --test-accept/-a flag, to mimic 'make accept' · 3c759ced
      Alp Mestanogullari authored
      When -a or --test-accept is passed, and if one runs the 'test' target, then
      any test failing because of mismatching output and which is not expected to
      fail will have its expected output adjusted by the test driver, effectively
      considering the new output correct from now on.
      When this flag is passed, hadrian's 'test' target becomes sensitive to the
      PLATFORM and OS environment variable, just like the Make build system:
      - when the PLATFORM env var is set to "YES", when accepting a result, accept it
        for the current platform;
      - when the OS env var is set to "YES", when accepting a result, accept it
        for all wordsizes of the current operating system.
      This can all be combined with `--only="..."` and `TEST="..." to only accept
      the new output of a subset of tests.
    • Sylvain Henry's avatar
  13. 11 Apr, 2019 1 commit
  14. 09 Apr, 2019 1 commit
    • Sylvain Henry's avatar
      Hadrian: fix library install paths in bindist Makefile (#16498) · fe40ddd9
      Sylvain Henry authored
      GHC now works out-of-the-box (i.e. without any wrapper script) by
      assuming that @bin@ and @lib@ directories sit next to each other. In
      particular, its RUNPATH uses $ORIGIN-based relative path to find the
      However, to be good citizens we want to support the case where @bin@ and
      @lib@ directories (respectively BINDIR and LIBDIR) don't sit next to
      each other or are renamed. To do that the install script simply creates
      GHC specific @bin@ and @lib@ siblings directories into:
      Then it installs wrapper scripts into BINDIR that call the appropriate
      programs into LIBDIR/ghc-VERSION/bin/.
      The issue fixed by this patch is that libraries were not installed into
      LIBDIR/ghc-VERSION/lib but directly into LIBDIR.
  15. 02 Apr, 2019 3 commits
  16. 01 Apr, 2019 1 commit
  17. 27 Mar, 2019 3 commits
    • David Eichmann's avatar
      Hadrian: don't use -zorigin on darwin. · 3dec527a
      David Eichmann authored
    • Alp Mestanogullari's avatar
      Hadrian: introduce an easy way for users to build with -split-sections · fb12f53c
      Alp Mestanogullari authored
      Any user can now trivially build any number of Haskell packages with
      `-split-sections` by using `splitSections`/`splitSectionsIf` on any
      existing or new flavour:
          -- build all packages but the ghc library with -split-sections
          splitSections :: Flavour -> Flavour
          -- build all packages that satisfy the given predicate
          -- with --split-sections
          splitSectionsIf :: (Package -> Bool) -> Flavour -> Flavour
      See the new section in `doc/user-settings.md`.
    • Andrey Mokhov's avatar
      Hadrian: trace the execution of expensive Cabal calls · 646f2e79
      Andrey Mokhov authored
      We use Cabal to parse, configure, register and copy packages, which are
      expensive operations that are currently not visible to Shake's profiling
      infrastructure. By using `traced` we tell Shake to add these IO actions
      to the profiling report, helping us to identify performance bottlenecks.
      We use short tracing keys, as recommended in Shake docs: the name of the
      current target is already available in the rest of the profiling
  18. 25 Mar, 2019 1 commit
    • Takenobu Tani's avatar
      Update Wiki URLs to point to GitLab · 3769e3a8
      Takenobu Tani authored
      This moves all URL references to Trac Wiki to their corresponding
      GitLab counterparts.
      This substitution is classified as follows:
      1. Automated substitution using sed with Ben's mapping rule [1]
          Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...
          New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...
      2. Manual substitution for URLs containing `#` index
          Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz
          New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz
      3. Manual substitution for strings starting with `Commentary`
          Old: Commentary/XxxYyy...
          New: commentary/xxx-yyy...
      See also !539
      [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
  19. 21 Mar, 2019 1 commit
  20. 15 Mar, 2019 3 commits
  21. 13 Mar, 2019 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: build (and retrieve) binary distributions in CI · cb17c2da
      Alp Mestanogullari authored
      With all the recent fixes to the binary-dist rule in Hadrian, we can now run
      that rule in CI and keep the bindists around in gitlab as artifacts, just like
      we do for the make CI jobs.
      To get 'autoreconf' to work in the Windows CI, we have to run it through the
      shell interpreter, so this commit does that along the way.
  22. 12 Mar, 2019 5 commits
    • Matthew Pickering's avatar
      Remove training whitespace · bb684e65
      Matthew Pickering authored
    • Matthew Pickering's avatar
      Hadrian: Add ./hadrian/ghci.sh script for fast development feedback · 2d7dd028
      Matthew Pickering authored
      Running the `./hadrian/ghci` target will load the main compiler into
      a ghci session. This is intended for fast development feedback, modules are only
      typechecked so it isn't possible to run any functions in the repl.
      You can also use this target with `ghcid`.
      The first time this command is run hadrian will need to compile a few dependencies
      which will take 1-2 minutes. Loading GHC into GHCi itself takes about 30 seconds.
      Internally this works by calling a new hadrian target called `tool-args`.
      This target prints out the package and include flags which are necessary
      to load files into ghci. The same target is intended to be used by other
      tooling which uses the GHC API in order to set up the correct GHC API
      session. For example, using this target it is also possible to use HIE
      when developing on GHC.
    • Matthew Pickering's avatar
      Hadrian: Fix rpath so shared objects work after being copied · 4cf2160a
      Matthew Pickering authored
      After being copied all the shared objects end up in the same directory.
      Therefore the correct rpath is `$ORIGIN` rather than the computed
      path which is relative to the directory where it is built.
    • Matthew Pickering's avatar
      Hadrian: Make makeRelativeNoSysLink total · 705fa21d
      Matthew Pickering authored
      makeRelativeNoSysLink would previously crash for no reason if the first
      argument as `./` due to the call to `head`. This refactoring keeps the
      behaviour the same but doesn't crash in this corner case.
    • Matthew Pickering's avatar
      Hadrian: Make libsuf and distDir stage aware · 61264556
      Matthew Pickering authored
      The version suffix needs to be the version of the stage 0 compiler
      when building shared libraries with the stage 0 compiler.