1. 23 Mar, 2020 1 commit
  2. 14 Mar, 2020 1 commit
  3. 26 Feb, 2020 1 commit
  4. 19 Feb, 2020 1 commit
    • Sylvain Henry's avatar
      Hadrian: refactor GMP in-tree build support (#17756) · d7029cc0
      Sylvain Henry authored
      * Hadrian doesn't use integer-gmp/config.mk file anymore to determine if
        building GMP in-tree is required.
      
        "config.mk" is created by Cabal when the integer-gmp package is
        configured and this file is still untracked by Hadrian. This led to a
        tricky configure "race" because "config.mk" is built by the
        "setup-config" rule, but this rule is also used to find dependencies,
        in particular the "ghc-gmp.h" header, but the creation of this file
        was depending (without being tracked) on "config.mk".
      
        Now Hadrian only builds in-tree GMP if `--with-intree-gmp` is passed
        to the top-level configure script.
      
      * in-tree GMP isn't built once for all in a fixed stage (Stage1)
        anymore. It is built per stage which is required if we build a
        cross-compiler
      
      * switching between in-tree and external GMP is now supported without
        having to clean the build directory first.
      
      * "wrappers.c" now includes "ghc-gmp.h" instead of "ghc.h". It
        helps ensuring that the build system generates "ghc-gmp.h".
      
      * build in-tree GMP in "<root>/stageN/gmp/gmpbuild" and produce useful
        artefacts (libgmp.a, gmp.h, objs/*.o) in "<root>/stageN/gmp"
      d7029cc0
  5. 14 Feb, 2020 1 commit
  6. 09 Feb, 2020 2 commits
  7. 04 Jan, 2020 1 commit
  8. 17 Dec, 2019 1 commit
    • Ben Gamari's avatar
      testsuite: Make ghc_built_by_llvm check more precise · 6ea4eb4b
      Ben Gamari authored
      Previously it would hackily look at the flavour name to determine
      whether LLVM was used to build stage2 ghc. However, this didn't work at
      all with Hadrian and would miss cases like ARM where we use the LLVM
      backend by default.
      
      See #16087 for the motivation for why ghc_built_by_llvm is needed at
      all. This should catch one of the ARMv7 failures described in #17555.
      6ea4eb4b
  9. 11 Nov, 2019 1 commit
  10. 08 Nov, 2019 1 commit
    • Alp Mestanogullari's avatar
      hadrian: fix support for the recording of perf test results · d0ef8312
      Alp Mestanogullari authored
      Before this patch, Hadrian didn't care about the TEST_ENV and
      METRICS_FILE environment variables, that the performance testing
      infrastructure uses to record perf tests results from CI jobs.
      
      It now looks them up right before running the testsuite driver,
      and passes suitable --test-env/--metrics-file arguments when
      these environment variables are set.
      d0ef8312
  11. 06 Nov, 2019 1 commit
  12. 01 Nov, 2019 1 commit
  13. 29 Oct, 2019 1 commit
  14. 25 Oct, 2019 1 commit
    • James Foster's avatar
      Make Hadrian use -dynamic-too in the basic case · 87175e78
      James Foster authored
      This commit makes Hadrian use the `-dynamic-too` flag when the current
      Flavour's libraryWays contains both vanilla and dynamic, cutting down
      the amount of repeated work caused by separate compilation of dynamic
      and static files. It does this for the basic case where '.o' and
      '.dyn_o' files are built with one command, but does not generalise to
      cases like '.prof_o' and '.prof_dyn_o'.
      87175e78
  15. 12 Oct, 2019 1 commit
    • John Ericson's avatar
      Simplify Configure in a few ways · c2290596
      John Ericson authored
       - No need to distinguish between gcc-llvm and clang. First of all,
         gcc-llvm is quite old and surely unmaintained by now. Second of all,
         none of the code actually care about that distinction!
      
         Now, it does make sense to consider C multiple frontends for LLVMs in
         the form of clang vs clang-cl (same clang, yes, but tweaked
         interface). But this is better handled in terms of "gccish vs
         mvscish" and "is LLVM", yielding 4 combinations. Therefore, I don't
         think it is useful saving the existing code for that.
      
       - Get the remaining CC_LLVM_BACKEND, and also TABLES_NEXT_TO_CODE in
         mk/config.h the normal way, rather than hacking it post-hoc. No point
         keeping these special cases around for now reason.
      
       - Get rid of hand-rolled `die` function and just use `AC_MSG_ERROR`.
      
       - Abstract check + flag override for unregisterised and tables next to
         code.
      
      Oh, and as part of the above I also renamed/combined some variables
      where it felt appropriate.
      
       - GccIsClang -> CcLlvmBackend. This is for `AC_SUBST`, like the other
       Camal case ones. It was never about gcc-llvm, or Apple's renamed clang,
       to be clear.
      
       - llvm_CC_FLAVOR -> CC_LLVM_BACKEND. This is for `AC_DEFINE`, like the
       other all-caps snake case ones. llvm_CC_FLAVOR was just silly
       indirection *and* an odd name to boot.
      c2290596
  16. 05 Oct, 2019 1 commit
    • John Ericson's avatar
      Per stage headers, ghc_boot_platform.h -> stage 0 ghcplatform.h · 05419e55
      John Ericson authored
      The generated headers are now generated per stage, which means we can
      skip hacks like `ghc_boot_platform.h` and just have that be the stage 0
      header as proper. In general, stages are to be embraced: freely generate
      everything in each stage but then just build what you depend on, and
      everything is symmetrical and efficient. Trying to avoid stages because
      bootstrapping is a mind bender just creates tons of bespoke
      mini-mind-benders that add up to something far crazier.
      
      Hadrian was pretty close to this "stage-major" approach already, and so
      was fairly easy to fix. Make needed more work, however: it did know
      about stages so at least there was a scaffold, but few packages except
      for the compiler cared, and the compiler used its own counting system.
      That said, make and Hadrian now work more similarly, which is good for
      the transition to Hadrian. The merits of embracing stage aside, the
      change may be worthy for easing that transition alone.
      05419e55
  17. 23 Sep, 2019 1 commit
    • Artem Pyanykh's avatar
      [hadrian] Rebuild programs on dynamicGhcPrograms/ghcProfiled change · d0c2f3a2
      Artem Pyanykh authored
      Currently, if you change these ^ flavour parameters, rebuilding is not
      triggered, since `programContext` doesn't set up a dependency on
      those values.
      
      Exposing these values via an oracle does set the dependency and
      properly triggers a rebuild of binaries.
      
      Several attempts to factor out these actions ended up in cyclic
      dependency here or there. I'm not absolutely happy with this variant
      either, but at least it works.
      
      ====
      
      Issue repro:
      
      In UserSettings.hs:
      ```
      dbgDynamic = defaultFlavour { name = "dbg-dynamic"
                                  , dynamicGhcPrograms = pure True,
                                  ... }
      
      dbgStatic = defaultFlavour { name = "dbg-static"
                                 , dynamicGhcPrograms = pure False
                                 ... }
      ```
      
      Then in console:
      
      ```
      $ hadrian/build.sh -j --flavour=dbg-dynamic
      ... does the build
      $ hadrian/build.sh -j --flavour=dbg-static
      ... does nothing, considers binaries up to date
      ```
      d0c2f3a2
  18. 02 Sep, 2019 1 commit
  19. 07 Aug, 2019 1 commit
    • James Foster's avatar
      hadrian: Refactor file patterns for future Shake changes (fixes #17005) · 0c1ccf3c
      James Foster authored
      Shake will be moving from its current implementation of ?== to one from
      System.FilePattern. Support for `//` is being dropped, leaving only `*`
      and `**` as special forms. This commit converts the existing file
      patterns in Hadrian to the new format. It also removes all occurances
      of <//> and changes the user-settings docs to remove references to //
      and add **.
      
      The conversion is as follows:
      
      - //a ==> **/a
      
      - a// ==> a/**
      
      - a//b ==> a/**/b
      0c1ccf3c
  20. 19 Jul, 2019 1 commit
    • Ben Gamari's avatar
      Fix formatting of --info's "Debug on" field · d238d306
      Ben Gamari authored
      As noted in #16914, the value `True` was used instead of `YES` here, in
      contrast to the other boolean fields emitted by `--info`. This confused
      the testsuite driver and broke the `ghc_debugged` testsuite predicate.
      d238d306
  21. 14 Jul, 2019 1 commit
  22. 25 Jun, 2019 1 commit
    • Andrey Mokhov's avatar
      Fix cyclic dependencies when using --configure · 15b26223
      Andrey Mokhov authored
      This resolves #16809 (#16809).
      
      This patch removes the unnecessary dependency on configure-generated
      flags `windowsHost`, `osxHost` and `iosHost`, using the information
      provided by the module `System.Info` instead.
      
      We also take care to use the `CrossCompiling` flag generated by the
      configure script only after the latter had a chance to run.
      15b26223
  23. 09 Jun, 2019 1 commit
  24. 04 Jun, 2019 1 commit
  25. 29 May, 2019 1 commit
    • 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
  26. 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
  27. 22 May, 2019 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: add --test-root-dirs, to only run specific directories of tests · 2c15b85e
      Alp Mestanogullari authored
      We can specify several of those, by using the flag multiple times or
      just once but combining the directories with ':'.
      
      Along the way, this patch also fixes the testsuite-related --only flag,
      so that we can use it many times instead of being force to specify a
      space-separated list of test in a single --only flag.
      2c15b85e
  28. 14 May, 2019 1 commit
  29. 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.
      51655fd8
  30. 19 Apr, 2019 1 commit
  31. 18 Apr, 2019 1 commit
  32. 12 Apr, 2019 1 commit
    • 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.
      3c759ced
  33. 27 Mar, 2019 1 commit
  34. 15 Mar, 2019 3 commits
  35. 12 Mar, 2019 3 commits
    • 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.
      2d7dd028
    • 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.
      4cf2160a
    • 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.
      61264556