1. 13 Jun, 2019 1 commit
  2. 12 Jun, 2019 1 commit
  3. 11 Jun, 2019 2 commits
    • Alp Mestanogullari's avatar
      testsuite/mk/boilerplate.mk: rename 'ghc-config-mk' to 'ghc_config_mk' · aad6115a
      Alp Mestanogullari authored
      Make/shell variable names which contain dashes can cause problems under
      some conditions. The 'ghc-config-mk' variable from testsuite/mk/boilerplate.mk
      that I made overridable (by Hadrian) in ba0aed2e was working as expected when
      our Hadrian/Linux job was based off the deb8 Docker image, but broke when
      I switched the job to use our deb9-based image, in 3d97bad6. The exact
      circumstances/tool versions that trigger this problem are unknown, but
      changing the variable's name to 'ghc_config_mk' lets us work around the issue.
      
      This fixes the annth_compunits and annth_make test failures that showed up
      when we switched the Hadrian/Linux job to use the deb9 environment.
      aad6115a
    • David Eichmann's avatar
      Refactor the rules for .hi and .o into a single rule using `&%>` #16764 · 58a5d728
      David Eichmann authored
      Currently the rule for .hi files just triggers (via need) the rule
      for the .o file, and .o rule generates both the .o and .hi file.
      Likewise for .o-boot and .hi-boot files. This is a bit of an abuse
      of Shake, and in fact shake supports rules with multiple output
      with the &%> function. This exact use case appears in Neil
      Mitchell's paper *Shake Before Building* section 6.3.
      58a5d728
  4. 04 Jun, 2019 1 commit
  5. 30 May, 2019 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: always generate the libffi dynlibs manifest with globbing · 3aa71a22
      Alp Mestanogullari authored
      Instead of trying to deduce which dynlibs are expected to be found (and then
      copied to the RTS's build dir) in libffi's build directory, with some OS
      specific logic, we now always just use `getDirectoryFilesIO` to look for
      those dynlibs and record their names in the manifest. The previous logic
      ended up causing problems on Windows, where we don't build dynlibs at all
      for now but the manifest file's logic didn't take that into account because
      it was only partially reproducing the criterions that determine whether or not
      we will be building shared libraries.
      
      This patch also re-enables the Hadrian/Windows CI job, which was failing to
      build GHC precisely because of libffi shared libraries and the aforementionned
      duplicated logic.
      3aa71a22
  6. 29 May, 2019 2 commits
    • David Eichmann's avatar
      a1bf3413
    • Alp Mestanogullari's avatar
      testsuite: introduce 'static_stats' tests · 7a75a094
      Alp Mestanogullari authored
      They are a particular type of perf tests. This patch introduces a
      'stats_files_dir' configuration field in the testsuite driver where all
      haddock timing files (and possibly others in the future) are assumed to live.
      We also change both the Make and Hadrian build systems to pass respectively
      $(TOP)/testsuite/tests/perf/haddock/ and
      <build root>/stage1/haddock-timing-files/ as the value of that new
      configuration field, and to generate the timing files in those directories
      in the first place while generating documentation with haddock.
      
      This new test type can be seen as one dedicated to examining stats files that
      are generated while building a GHC distribution. This also lets us get rid of
      the 'extra_files' directives in the all.T entries for haddock.base,
      haddock.Cabal and haddock.compiler.
      7a75a094
  7. 27 May, 2019 2 commits
    • John Ericson's avatar
      hadrian: Fix generation of settings · f80d3afd
      John Ericson authored
      I jumbled some lines in e529c65e,
      messing up the leading underscores and rts ways settings. This broke at
      least stage1 linking on macOS, but probably loads of other things too.
      
      Should fix #16685 and #16658.
      f80d3afd
    • Alp Mestanogullari's avatar
      Hadrian: Fix problem with unlit path in settings file · 01f8e390
      Alp Mestanogullari authored
      e529c65e introduced a problem in the logic for generating the
      path to the unlit command in the settings file, and this patches
      fixes it.
      
      This fixes many tests, the simplest of which is:
      
      > _build/stage1/bin/ghc testsuite/tests/parser/should_fail/T8430.lhs
      
      which failed because of a wrong path for unlit, and now fails for the right
      reason, with the error message expected for this test.
      
      This addresses #16659.
      01f8e390
  8. 25 May, 2019 1 commit
    • David Eichmann's avatar
      Hadrian: Add Mising Libffi Dependencies #16653 · 9be1749d
      David Eichmann authored
      Libffi is ultimately built from a single archive file (e.g.
      libffi-tarballs/libffi-3.99999+git20171002+77e130c.tar.gz).
      The file can be seen as the shallow dependency for the whole
      libffi build. Hence, in all libffi rules, the archive is
      `need`ed and the build directory is `trackAllow`ed.
      9be1749d
  9. 24 May, 2019 1 commit
    • Alp Mestanogullari's avatar
      add an --hadrian mode to ./validate · 04b4b984
      Alp Mestanogullari authored
      When the '--hadrian' flag is passed to the validate script, we use hadrian
      to build GHC, package it up in a binary distribution and later on run GHC's
      testsuite against the said bindist, which gets installed locally in the process.
      
      Along the way, this commit fixes a typo, an omission (build iserv binaries
      before producing the bindist archive) and moves the Makefile that enables
      'make install' on those bindists from being a list of strings in the code to
      an actual file (it was becoming increasingly annoying to work with).
      
      Finally, the Settings.Builders.Ghc part of this patch is necessary for being
      able to use the installed binary distribution, in 'validate'.
      04b4b984
  10. 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
  11. 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
  12. 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
  13. 08 May, 2019 1 commit
  14. 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
  15. 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
  16. 16 Apr, 2019 1 commit
  17. 14 Apr, 2019 2 commits
  18. 12 Apr, 2019 1 commit
  19. 11 Apr, 2019 1 commit
  20. 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
  21. 02 Apr, 2019 1 commit
  22. 15 Mar, 2019 2 commits
  23. 12 Mar, 2019 1 commit
  24. 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
  25. 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
  26. 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
  27. 04 Mar, 2019 1 commit
  28. 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
  29. 23 Feb, 2019 1 commit
  30. 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