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
      0af519ac
  2. 14 May, 2019 3 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.
      a416ae26
    • 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
         time.
      
      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
         library.
      
      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!
      e529c65e
    • John Ericson's avatar
      hadrian: Make settings stage specific · 015a21b8
      John Ericson authored
      015a21b8
  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.
      
          _build/stage1/lib/x86_64-linux-ghc-8.9.0.20190430/libHSdeepseq-1.4.4.0-ghc8.9.0.20190430.so
      
      Add the corresponding `need`s for these library files and the subsequent rules.
      bfcd986d
  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
      failures.
      ba0aed2e
    • John Ericson's avatar
      Remove cGhcEnableTablesNextToCode · 27941064
      John Ericson authored
      Get "Tables next to code" from the settings file instead.
      27941064
  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
      bootstrapping.
      2988ef5e
    • John Ericson's avatar
      Generate settings by make/hadrian instead of configure · d37d91e9
      John Ericson authored
      This allows it to eventually become stage-specific
      d37d91e9
  7. 16 Apr, 2019 1 commit
  8. 14 Apr, 2019 2 commits
  9. 12 Apr, 2019 1 commit
  10. 11 Apr, 2019 1 commit
  11. 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
      libraries.
      
      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:
      
         LIBDIR/ghc-VERSION/{bin,lib}
      
      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.
      fe40ddd9
  12. 02 Apr, 2019 1 commit
  13. 15 Mar, 2019 2 commits
  14. 12 Mar, 2019 1 commit
  15. 09 Mar, 2019 1 commit
    • Ben Gamari's avatar
      Rip out perl dependency · b760269c
      Ben Gamari authored
      The object splitter was the last major user of perl. There remain a few
      uses in nofib but we can just rely on the system's perl for this since
      it's not critical to the build.
      b760269c
  16. 08 Mar, 2019 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: various improvements around the 'test' rule · 48927a9a
      Alp Mestanogullari authored
      - introduce a -k/--keep-test-files flag to prevent cleanup
      - add -dstg-lint to the options that are always passed to tests
      - infer library ways from the compiler to be tested instead of getting them
        from the flavour (like make)
      - likewise for figuring out whether the compiler to be tested is "debugged"
      - specify config.exeext
      - correctly specify config.in_tree_compiler, instead of always passing True
      - fix formatting of how we pass a few test options
      - add (potential) extensions to check-* program names
      - build check-* programs with the compiler to be tested
      - set TEST_HC_OPTS_INTERACTIVE and PYTHON env vars when running tests
      48927a9a
  17. 06 Mar, 2019 2 commits
    • P.C. Shyamshankar's avatar
      Handle absolute paths to build roots in Hadrian. · 2ff77b98
      P.C. Shyamshankar authored
      Fixes #16187.
      
      This patch fixes various path concatenation issues to allow functioning
      builds with hadrian when the build root location is specified with an
      absolute path.
      
      Remarks:
      
      - The path concatenation operator (-/-) now handles absolute second operands
        appropriately. Its behavior should match that of POSIX (</>) in this
        regard.
      
      - The `getDirectoryFiles*` family of functions only searches for matches
        under the directory tree rooted by its first argument; all of the
        results are also relative to this root. If the first argument is the
        empty string, the current working directory is used.
      
        This patch passes the appropriate directory (almost always either `top`
        or `root`), and subsequently attaches that directory prefix so that
        the paths refer to the appropriate files.
      
      - Windows `tar` does not like colons (':') in paths to archive files, it
        tries to resolve them as remote paths. The `--force-local` option
        remedies this, and is applied on windows builds.
      2ff77b98
    • Ben Gamari's avatar
      Rip out object splitting · 37f257af
      Ben Gamari authored
      The splitter is an evil Perl script that processes assembler code.
      Its job can be done better by the linker's --gc-sections flag. GHC
      passes this flag to the linker whenever -split-sections is passed on
      the command line.
      
      This is based on @DemiMarie's D2768.
      
      Fixes Trac #11315
      Fixes Trac #9832
      Fixes Trac #8964
      Fixes Trac #8685
      Fixes Trac #8629
      37f257af
  18. 04 Mar, 2019 1 commit
  19. 01 Mar, 2019 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: introduce ways to skip some documentation targets · 8442103a
      Alp Mestanogullari authored
      The initial motivation for this is to have a chance to run the binary
      distribution rules in our Windows CI without having to install
      sphinx-build and xelatex there, while retaining the ability to
      generate haddocks. I just ended up extending this idea a little bit so
      as to have control over whether we build haddocks, (sphinx) HTML manuals,
      (sphinx) PDF manuals and (sphinx) manpages.
      8442103a
  20. 23 Feb, 2019 1 commit
  21. 20 Feb, 2019 1 commit
    • Andrey Mokhov's avatar
      Hadrian: Fix untracked dependencies · 1dad4fc2
      Andrey Mokhov authored
      This is a preparation for #16295: https://ghc.haskell.org/trac/ghc/ticket/16295
      
      This commit mostly focuses on getting rid of untracked dependencies,
      which prevent Shake's new `--shared` feature from appropriately caching
      build rules.
      
      There are three different solutions to untracked dependencies:
      
      * Track them! This is the obvious and the best approach, but in some
        situations we cannot use it, for example, because a build rule creates
        files whose names are not known statically and hence cannot be
        specified as the rule's outputs.
      
      * Use Shake's `produces` to record outputs dynamically, within the rule.
      
      * Use Shake's `historyDisable` to disable caching for a particular build
        rule. We currently use this approach only for `ghc-pkg` which mutates
        the package database and the file `package.cache`.
      
      These two tickets are fixed as the result:
      
      Ticket #16271: ​https://ghc.haskell.org/trac/ghc/ticket/16271
      
      Ticket #16272: ​https://ghc.haskell.org/trac/ghc/ticket/16272 (this one
      is fixed only partially: we correctly record the dependency, but we
      still copy files into the RTS build tree).
      1dad4fc2
  22. 16 Feb, 2019 1 commit
    • Alec Theriault's avatar
      Remove `parallel` as a submodule · 3cb063c8
      Alec Theriault authored
      `parallel` is used in exactly one place in the GHC tree: the T2317 test.
      It seems almost by accident that it is a submodule; libraries needed
      only for tests should net be included as submodules (see `QuickCheck`,
      `async`, `haskell98`, `regex-compat`, `utf8-string`, `vector` and more
      for examples).
      
      T2317 will now get run only when `parallel` is installed instead of
      `parallel` being required for the testsuite to run.
      3cb063c8
  23. 23 Jan, 2019 3 commits
    • Gabor Greif's avatar
      A few typofixes · bb2acfe0
      Gabor Greif authored
      bb2acfe0
    • Alec Theriault's avatar
      Hadrian: install patches 'haddock-{html,interface}' · d26869ac
      Alec Theriault authored
      Since the `$(docdir)` can be picked independently from the `$(libdir)`,
      we need to make sure that that the `haddock-html` and `haddock-interface`
      fields in the package DB (which is in the `$(libdir)`) get updated to
      point to the appropriate places in the `$(docdir)`.
      
      NB: in the make system, `ghc-cabal` would cover this sort of thing by
      re-running `configure` on installation, but here we get away with a
      couple lines of `sed` and a call to `ghc-pkg recache`.
      
      Fixes #16202.
      d26869ac
    • Matthew Pickering's avatar
      Fix hadrian prof flavour so that it builds a profiled version of GHC · cfe64019
      Matthew Pickering authored
      In Alp's refactoring of `getProgramContexts` he removed a call to
      `getProgramContext` which was where the logic for this used to be
      implemented.
      
      Fixes #16214
      cfe64019
  24. 16 Jan, 2019 5 commits
  25. 14 Jan, 2019 1 commit
    • Herbert Valerio Riedel's avatar
      Update `Cabal` submodule · cb31b23d
      Herbert Valerio Riedel authored
      This also requires adapting `ghc-pkg` to use the new Cabal parsing API
      as the old ReadP-based one has finally been evicted for good.
      
      Hadrian bit finished by: Ben Gamari <ben@smart-cactus.org>
      cb31b23d
  26. 09 Jan, 2019 1 commit
    • Matthew Pickering's avatar
      Hadrian: Add support for building stage3 · 6486c6e4
      Matthew Pickering authored
      This ticket enables the building of a `stage3` compiler by making the
      build logic more consistent and predictable in Hadrian.
      
      Two of the main changes are:
      
      1. In order to build anything at stageN we use the package database
      present at stageN. Fixing #16069
      2. `haddock` and `ghc-tags` are built
      as stage1 executables (with the stage1 compiler) rather than as
      stage2 compiler. Fixing
      [hadrian#661](https://github.com/snowleopard/hadrian/issues/661)
      
      In order to build a stage3 compiler, you have to set the new `finalStage` hadrian option to `Stage3`.
      6486c6e4
  27. 06 Jan, 2019 1 commit
    • Zejun Wu's avatar
      Hadrian: merge sections in profiling _p.a to .p_o for ghci · 9ea8dcea
      Zejun Wu authored
      This is the hadrain version of {D5169}
      
      * We build squashed .o and .p_o for ghci when `dynamicGhcPrograms` is
      `False`
      * We no longer build them for rts as ghci never loads it
      
      we need https://github.com/haskell/cabal/pull/5592 for cabal to copy
      the built `.p_o` file.
      
      Test Plan:
      ```
      $ grep dynamicGhc hadrian/UserSettings.hs
        , dynamicGhcPrograms = return False
      $ touch ...
      $ hadrian/build.sh --flavour=user -j --digest-or
      $ find _build/stage1/libraries/ -name 'HS*-*.*o' | wc
           62      62    3664
      ```
      
      ```
      $ grep -C3 dynamicGhc hadrian/UserSettings.hs
      userFlavour :: Flavour
      userFlavour = performanceFlavour
        { name = "user"
        , dynamicGhcPrograms = return False
        }
      $ hadrian/build.sh -j --flavour=user test --verbose
      Unexpected results from:
      TEST="T3807 T9208 T9293 annth_make ghci057 haddock.Cabal haddock.base
      haddock.compiler"
      
      SUMMARY for test run started at Wed Dec  5 17:45:39 2018 PST
       0:03:16 spent to go through
          6708 total tests, which gave rise to
         26015 test cases, of which
         19290 were skipped
      
            29 had missing libraries
          6600 expected passes
            88 expected failures
      
             3 caused framework failures
             0 caused framework warnings
             1 unexpected passes
             7 unexpected failures
             0 unexpected stat failures
      $ find _build -name 'HSbase*.*o'
      _build/stage1/lib/x86_64-linux-ghc-8.7.20181204/base-4.12.0.0/HSbase-4.1
      2.0.0.o
      _build/stage1/lib/x86_64-linux-ghc-8.7.20181204/base-4.12.0.0/HSbase-4.1
      2.0.0.p_o
      _build/stage1/libraries/base/build/HSbase-4.12.0.0.o
      _build/stage1/libraries/base/build/HSbase-4.12.0.0.p_o
      ```
      
      Reviewers: bgamari, simonmar, snowleopard
      
      Reviewed By: snowleopard
      
      Subscribers: alpmestan, rwbarton, carter
      
      GHC Trac Issues: #15779
      
      Differential Revision: https://phabricator.haskell.org/D5270
      9ea8dcea