1. 24 Dec, 2018 1 commit
  2. 18 Dec, 2018 1 commit
  3. 17 Dec, 2018 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: introduce userDefaultFlavour, making default flavour overridable · c42eb2e6
      Alp Mestanogullari authored
      This patch introduces the `userDefaultFlavour` user setting. It should
      be the name of the default flavour to use when no --flavour argument is
      passed. Before this patch, we would just always default to... the
      `default` flavour. With this patch, we default to whatever Flavour whose
      name is `userDefaultFlavour`, therefore providing a way for users to
      "persist" their choice of flavour, not having to repeat --flavour=[...]
      in every hadrian command.
      
      Test Plan:
      Set `userDefaultFlavour = "quickest"`, run `hadrian/build.sh`, check
      that the quickest flavour is indeed picked.
      
      Reviewers: snowleopard, bgamari
      
      Reviewed By: snowleopard
      
      Subscribers: mpickering, rwbarton, carter
      
      GHC Trac Issues: #15890
      
      Differential Revision: https://phabricator.haskell.org/D5454
      c42eb2e6
  4. 15 Dec, 2018 1 commit
  5. 11 Dec, 2018 4 commits
    • Alec Theriault's avatar
      Support generating HIE files · f582379d
      Alec Theriault authored
      Adds a `-fenable-ide-info` flag which instructs GHC to generate `.hie`
      files (see the wiki page:
      https://ghc.haskell.org/trac/ghc/wiki/HIEFiles).
      
      This is a rebased version of Zubin Duggal's (@wz1000) GHC changes for
      his GSOC project, as posted here:
      https://gist.github.com/wz1000/5ed4ddd0d3e96d6bc75e095cef95363d.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, gershomb, nomeata, alanz, sjakobi
      
      Reviewed By: alanz, sjakobi
      
      Subscribers: alanz, hvr, sjakobi, rwbarton, wz1000, carter
      
      Differential Revision: https://phabricator.haskell.org/D5239
      f582379d
    • Alp Mestanogullari's avatar
      Hadrian: ability to run a subset of the testsuite · a5e76a07
      Alp Mestanogullari authored
      This was supposed to be working already but didn't work when we
      specified several tests with --only. This patch not only fixes this
      but also makes it possible to specify a subset of tests to run with the
      TEST environment variable, like the make build system. Here are some
      examples:
      
          hadrian/build.sh test --only=plugins01
          hadrian/build.sh test --only="plugins01 plugins02"
          TEST="plugins01 plugins02" hadrian/build.sh test
          TEST=plugins03 hadrian/build.sh test --only="plugins01 plugins02"
      
      When both the TEST environment variable and the --only flag are used,
      we simply concatenate the list of tests from both sources and ask the
      testsuite driver to run them all.
      
      This patch addresses #16026.
      
      Test Plan: hadrian/build.sh test --only="plugins01 plugins02"
      
      Reviewers: bgamari, snowleopard
      
      Reviewed By: bgamari, snowleopard
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #16026
      
      Differential Revision: https://phabricator.haskell.org/D5431
      a5e76a07
    • Alp Mestanogullari's avatar
      Hadrian: simple targets for building libraries and executables · 7491cedb
      Alp Mestanogullari authored
      This patch introduces (phony) build targets of the form
      
          (1) stage<N>:<lib>:<name>   (e.g: stage1:lib:Cabal)
          (2) stage<N>:<exe>:<name>   (e.g: stage2:exe:ghc-bin)
      
      where (1) builds the given library with the stage N compiler and (2)
      builds the given executable with the stage N-1 compiler. This patch may
      be generating too many such targets but it's a first stab that we can
      refine.
      
      This fixes #15949.
      
      Test Plan: hadrian/build.sh stage1:exe:ghc-bin
      
      Reviewers: bgamari, snowleopard
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15949
      
      Differential Revision: https://phabricator.haskell.org/D5434
      7491cedb
    • David Eichmann's avatar
      Revert dynamically linking ghc. · 4efafe7e
      David Eichmann authored
      Building a dynamically linked ghc is broken do to incorrectly building
      and installing libffi. This disables building a dynamically linked ghc
      and ghc-iserv-dyn while keeping most of the code in the relevant
      commits: 79d5427e and 89fa34ec
      
      Test Plan:
      Ensure build environment does NOT have a system libffi installed (you
      may want to use a nix environment).
      Then `hadrian/build.sh -c --flavour=default`.
      
      Reviewers: bgamari, alpmestan
      
      Reviewed By: alpmestan
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15837
      
      Differential Revision: https://phabricator.haskell.org/D5430
      4efafe7e
  6. 08 Dec, 2018 3 commits
    • Ben Gamari's avatar
      hadrian: Drop nix build script · c00d2f59
      Ben Gamari authored
      It's currently too out-of-date to build current hadrian and is arguably
      completely broken anyways (see #15794).
      c00d2f59
    • Alp Mestanogullari's avatar
      Hadrian: fix dynamicGhcPrograms value for the quickest flavour · 7d96d281
      Alp Mestanogullari authored
      Quickest does not build anything in a dynamic way, so that
      flavour should default to not building "ghc programs" dynamically.
      
      I ran into this problem by building the 'docs' target with quickest,
      which failed because at some point we run a haddock command in a
      context whose Way is sensitive to dynamicGhcPrograms, and it
      started looking for dyn interface files when it shouldn't have.
      
      Test Plan: hadrian/build.sh --flavour=quickest docs
      
      Reviewers: snowleopard, bgamari
      
      Reviewed By: snowleopard
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5419
      7d96d281
    • Alp Mestanogullari's avatar
      hadrian: eliminate most of the remaining big rule enumerations · 665f8b0c
      Alp Mestanogullari authored
      Following what was done to Rules.Library some time ago and to
      Rules.Compile recently (D5412), this patch moves more rules away from
      the "enumerate a lot of contexts and generate one rule for each" style
      and instead uses the "parse data from file path to recover context"
      approach. In fact, the only rules left to convert seem to be the ones
      from Rules.Generate.
      
      This effectively decreases the pauses described in #15938 further as
      well as the amount of allocations and GC that we do, unsurprisingly.
      Nowhere as drastically as D5412, though.
      
      Test Plan: perform full build and generate docs
      
      Reviewers: snowleopard, bgamari
      
      Reviewed By: snowleopard
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15938
      
      Differential Revision: https://phabricator.haskell.org/D5422
      665f8b0c
  7. 07 Dec, 2018 1 commit
    • Alp Mestanogullari's avatar
      hadrian: optimise Rules.Compile · eee1b61f
      Alp Mestanogullari authored
      Previously, as reported in #15938, resuming a build "in the middle",
      e.g when building _build/stage1/libraries/base/, hadrian would take up
      to a whole minute to get started doing actual work, building code.
      
      This was mostly due to a big enumeration that we do in Rules.hs, to
      generate all the possible patterns for object files for 1) all ways, 2)
      all packages and 3) all stages. Since rule enumeration is always
      performed, whatever the target, we were always paying this cost, which
      seemed to grow bigger the farther in the build we stopped and were
      resuming from.
      
      Instead, this patch borrows the approach that we took for Rules.Library
      in https://github.com/snowleopard/hadrian/pull/571, which exposes all the
      relevant object files under as few catch-all rules as possible (8 here),
      and parses all the information we need out of the object's path.
      
      The concrete effect of this patch that I have observed is to reduce the
      45-60 seconds pause to <5 seconds. Along with the Shake performance
      improvements that Neil mentions in #15938, most of the pause should
      effectively disappear.
      
      Reviewers: snowleopard, bgamari, goldfire
      
      Reviewed By: snowleopard
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15938
      
      Differential Revision: https://phabricator.haskell.org/D5412
      eee1b61f
  8. 04 Dec, 2018 1 commit
    • Alec Theriault's avatar
      Hadrian: include 'findPtr' via find-ptr cabal flag · 924026e0
      Alec Theriault authored
      Summary:
      This is the latest in the 'findPtr' saga. See
      
        * 900c47f8
        * 561748cb
      
      for the previous attempts. The problem with re-using the 'debug'
      cabal flag for the purpose of forcing inclusion of 'findPtr' occurs
      when 'debug' is one of the RTS ways, but RTS is not being compiled
      with '-DDEBUG':
      
        * the 'debug' flag gets passed to cabal, signalling to build
          'rts' with the debug flavour, but also forcing inclusion of
          the 'findPtr'/'_findPtr' symbol
      
        * since '-DDEBUG' isn't enabled, that symbol doesn't show up in
          the libraries, so executable that depend on 'rts' (everything)
          will end up always requiring 'findPtr'/'_findPtr' but 'rts' won'y
          provide it!
      
      The fix is simple: create a a new 'find-ptr' cabal-flag whose only
      purpose is forcing '-Wl,-u,findPtr'/'-Wl,-u,_findPtr'. Then, enable that
      flag when the RTS is being compiled with '-DDEBUG'
      
      Test Plan: ./hadrian/build.sh -c # on mac
      
      Reviewers: alpmestan, snowleopard, bgamari, erikd, simonmar, Phyx
      
      Reviewed By: alpmestan, snowleopard, Phyx
      
      Subscribers: Phyx, rwbarton, carter
      
      GHC Trac Issues: #15956
      
      Differential Revision: https://phabricator.haskell.org/D5404
      924026e0
  9. 01 Dec, 2018 2 commits
  10. 29 Nov, 2018 3 commits
    • Ryan Scott's avatar
      Allow containers-0.6, QuickCheck-2.12 in Hadrian · 8bffd580
      Ryan Scott authored
      Summary:
      Currently, Hadrian has restrictive upper bounds on
      `containers` and `QuickCheck` that prevents it from building with
      the latest versions of each respective library (0.6.0.1 and
      2.12.6.1). There doesn't appear to be any good reason to do so,
      since Hadrian builds fine with them, so let's bump the upper version
      bounds accordingly.
      
      Test Plan: ./build/hadrian.sh
      
      Reviewers: bgamari, alpmestan, snowleopard
      
      Reviewed By: snowleopard
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5389
      8bffd580
    • David Eichmann's avatar
      Hadrian: support dynamically linking ghc · 79d5427e
      David Eichmann authored
      * (#15837 point 5) Use the -rpath gcc option and using the $ORIGIN
      variable which the dynamic linker sets to the location of the ghc
      binary.
      * (#15837 point 4) "-fPIC -dynamic" options are used when building ghc
      when either ghc or the rts have a dynamic way.
      * (#15837 point 7) "-shared -dynload deploy" options are only used when
      linking a library (no longer when linking a program).
      
      Reviewers: bgamari, alpmestan
      
      Reviewed By: alpmestan
      
      Subscribers: adamse, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5281
      79d5427e
    • Alp Mestanogullari's avatar
      Hadrian: bump Cabal submodule, install extra dynamic flavours of RTS · fb997160
      Alp Mestanogullari authored
      Previously, Hadrian was building all the appropriate dynamic ways for
      libHSrts
      but they were not picked up and installed in the package database when
      we register the rts library. Since we use Cabal for registering
      packages and
      the .cabal files of packages as sources of truth for configuring and
      installing,
      we ended up patching Cabal to add a new field,
      'extra-dynamic-library-flavours',
      to specify those extra flavours to install in .cabal files:
      
          https://github.com/haskell/cabal/pull/5606
      
      We now make use of this in rts.cabal.in to expose dynamic flavours
      behind a
      Cabal flag, which Hadrian will use whenever we are building a GHC
      flavour that
      requires dynamic libraries.
      
      This is all part of a larger plan to build a dynamic stage 2 GHC by
      default,
      like with make, which in turn will fix a lot of test failures. See
      
      Test Plan:
      hadrian/build.sh _build/stage1/lib/package.conf.d/rts-1.0.conf
      _build/stage1/lib/x86_64-.../ should contain many libHSrts-*.so
      
      Reviewers: snowleopard, DavidEichmann, bgamari, erikd, simonmar
      
      Reviewed By: snowleopard, DavidEichmann
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15837
      
      Differential Revision: https://phabricator.haskell.org/D5385
      fb997160
  11. 27 Nov, 2018 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: improve bindist rule · 8f52ab92
      Alp Mestanogullari authored
      As outlined in #15925, hadrian bindists had not made a clear choice with
      respect to relocatable GHCs and wrapper scripts. This commit implements
      the policy described in the ticket. That is:
      
      - the bindists ship {bin, lib} as they are, modulo the addition of
        haddock from stage2/bin
      - we now _always_ generate wrapper scripts for all the programs that
        are in the bindist's bin/ directory
      
      The idea being that anyone on Linux/Windows/OS X can just unpack
      the binary distribution anywhere and start using bin/ghc, while the
      installation process systematicaly generates wrapper scripts.
      
      Test Plan: hadrian/build.sh binary-dist ; cd
      _build/bindist/ghc-X.Y.Z-arch/; configure --prefix=/tmp/foo && make
      install
      
      Reviewers: snowleopard, bgamari, angerman
      
      Reviewed By: snowleopard, bgamari, angerman
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15925
      
      Differential Revision: https://phabricator.haskell.org/D5371
      8f52ab92
  12. 23 Nov, 2018 1 commit
  13. 22 Nov, 2018 3 commits
    • David Eichmann's avatar
      Fix unused-import warnings · 6353efc7
      David Eichmann authored
      This patch fixes a fairly long-standing bug (dating back to 2015) in
      RdrName.bestImport, namely
      
         commit 9376249b
         Author: Simon Peyton Jones <simonpj@microsoft.com>
         Date:   Wed Oct 28 17:16:55 2015 +0000
      
         Fix unused-import stuff in a better way
      
      In that patch got the sense of the comparison back to front, and
      thereby failed to implement the unused-import rules described in
        Note [Choosing the best import declaration] in RdrName
      
      This led to Trac #13064 and #15393
      
      Fixing this bug revealed a bunch of unused imports in libraries;
      the ones in the GHC repo are part of this commit.
      
      The two important changes are
      
      * Fix the bug in bestImport
      
      * Modified the rules by adding (a) in
           Note [Choosing the best import declaration] in RdrName
        Reason: the previosu rules made Trac #5211 go bad again.  And
        the new rule (a) makes sense to me.
      
      In unravalling this I also ended up doing a few other things
      
      * Refactor RnNames.ImportDeclUsage to use a [GlobalRdrElt] for the
        things that are used, rather than [AvailInfo]. This is simpler
        and more direct.
      
      * Rename greParentName to greParent_maybe, to follow GHC
        naming conventions
      
      * Delete dead code RdrName.greUsedRdrName
      
      Bumps a few submodules.
      
      Reviewers: hvr, goldfire, bgamari, simonmar, jrtc27
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5312
      6353efc7
    • Alec Theriault's avatar
      Hadrian: Misc. fixes in Haddock rules · ff619555
      Alec Theriault authored
      * Pass 'GHC/Prim.hs' to Haddock when processing 'ghc-prim'. This
        file is autogenerated for the sole purpose of giving Haddock
        something to process, so we really should make sure it gets
        through to Haddock!
      
      * Add a "docs-haddock" build rule, which should build all Haddock docs
        that the Makefile builds by default (all libs + index for libs + ghc)
      
      * Prune some unnecessary rules (esp. `gen_contents_index`)
      
      Reviewers: bgamari, snowleopard
      
      Reviewed By: snowleopard
      
      Subscribers: alpmestan, snowleopard, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5316
      ff619555
    • Alec Theriault's avatar
      Hadrian: work around Cabal's/GHC's different Arch/OS strings · 19ffddc1
      Alec Theriault authored
      The path to the 'include' subdirectory of 'rts' includes a folder that
      whose name is generated by Cabal and mentiones the architecture and OS.
      For example:
      
          _build/stage1/lib/x86_64-osx-ghc-8.7.20181120/rts-1.0/include
      
      Hadrian needs to be aware that Cabal renders architectures and OSes in
      a slightly different way than GHC. There is already symmetric logic in
      Cabal (for working with GHC environment files, which follow GHC's naming
      conventions).
      
      Test Plan: ./hadrian/build.sh -c "binary-dist" # on mac
      
      Reviewers: snowleopard, alpmestan, bgamari
      
      Reviewed By: snowleopard
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15922
      
      Differential Revision: https://phabricator.haskell.org/D5361
      19ffddc1
  14. 19 Nov, 2018 1 commit
    • Alp Mestanogullari's avatar
      hadrian: make it possible to run the testsuite with quickest and quick · cc615c69
      Alp Mestanogullari authored
      More generally, we so far assumed that the testsuite would be executed
      with a flavour that's as comprehensive as perf in terms of available RTS
      and library flavours (at least vanilla + dynamic + prof). This would
      manifest itself concretely by needing 3 "ways" of the iserv program,
      unconditionally.
      
      We now only require the ways among vanilla, dynamic and prof that we
      can find in our current Flavour's rtsWays.
      
      Test Plan:
      hadrian/build.sh --flavour={quick, quickest} test now goes through
      (with a few failing tests, of course).
      
      Reviewers: bgamari, tdammers
      
      Reviewed By: tdammers
      
      Subscribers: mpickering, RyanGlScott, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5355
      cc615c69
  15. 14 Nov, 2018 1 commit
  16. 01 Nov, 2018 1 commit
    • Alp Mestanogullari's avatar
      hadrian: build ghc-iserv-prof in addition to ghc-iserv · 695f1f2f
      Alp Mestanogullari authored
      As it is required for 10+ tests.
      
      Hadrian didn't give us a chance to build a given executable in vanilla
      and profiling, simultaneously, under two different names. This patch
      implements support for this in general and applies it to
      ghc-iserv[-prof].
      
      Test Plan: scc001 fails without this patch, passes with it.
      
      Reviewers: snowleopard, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: simonpj, ndmitchell, simonmar, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5255
      695f1f2f
  17. 23 Oct, 2018 1 commit
  18. 05 Aug, 2018 1 commit
  19. 12 Jun, 2018 1 commit
  20. 07 Jun, 2018 1 commit
  21. 25 Apr, 2018 1 commit
    • Andrey Mokhov's avatar
      Update Hadrian submodule · 625eea93
      Andrey Mokhov authored
        * Link to Quick Start guide
        * Update README.md (hadrian/578)
        * Fix AppVeyor (hadrian/577)
        * Fix CircleCI
        * Generic library rules (hadrian/571)
        * Fix lint error (hadrian/575)
        * Fix missing libHSghc-8.5-0.a (hadrian/574)
        * Fix the path to touchy (hadrian/572)
        * Fix integer-gmp build (hadrian/568)
        * Undo fs*.h workaround
        * Fix copying of fs*.h files during RTS registration (hadrian/566)
        * Fix Windows build, improve error reporting (hadrian/565)
        * Fix Windows build (hadrian/563)
        * Fix boot and configure on AppVeyor (hadrian/561)
        * Preliminary bindist (hadrian/558, hadrian/555)
        * Unregister stage0 package first if it needs to be
          cloned (hadrian/552)
        * Fix Circle CI (hadrian/553)
        * Fix warnings (hadrian/547)
        * Merge pull request hadrian/542 from Mistuke/fix-specific-file
        * Use Cabal directly in place of ghc-cabal + make build root
          configurable (hadrian/531)
        * Add user-defined flavour example for turning off dynamic
          linking (hadrian/535)
        * Add clean routines for fs (hadrian/533)
        * Add 'git' to nativeBuildInputs in shell.nix (hadrian/530)
        * Add extra include paths when invoking ghc-cabal (hadrian/526)
        * Merge pull request hadrian/528 from snowleopard/bump-cabal
        * Merge pull request hadrian/521 from snowleopard/drop-chmod
        * Change permission bits for build.cabal.sh,
          fixes hadrian/517 (hadrian/520)
        * Pin nixpkgs and all-cabal-hashes in shell.nix (hadrian/511)
        * Add troubleshooting section
      625eea93
  22. 24 Feb, 2018 1 commit
    • Andrey Mokhov's avatar
      Update Hadrian submodule · bf3f0a68
      Andrey Mokhov authored
        * Make shell.nix less broken (hadrian/510)
        * Add --configure flag to the script
        * Undo iserv changes (hadrian/507)
        * Fix ghc-cabal: Parsec modules are now found in libraries/parsec/src (hadrian/506)
        * Move a bunch of types into dedicated modules (hadrian/502)
        * Add --quickjump to Haddock (hadrian/505)
        * Add iserv library (hadrian/504)
        * Merge pull request hadrian/503 from snowleopard/angerman-patch-1
        * Merge pull request hadrian/500 from snowleopard/runtime-deps
        * Fix Hadrian after Cabal changes (hadrian/498)
        * Drop custom logic for Scav_thr and Evac_thr (hadrian/497)
        * Fix Haddock (hadrian/496)
      bf3f0a68
  23. 27 Jan, 2018 1 commit
  24. 08 Dec, 2017 2 commits