1. 04 Mar, 2019 1 commit
  2. 01 Mar, 2019 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: introduce ways to skip some documentation targets · 8442103a
      Alp Mestanogullari authored and  Marge Bot's avatar Marge Bot committed
      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
  3. 24 Feb, 2019 1 commit
    • Vladislav Zavialov's avatar
      Expression/command ambiguity resolution · e61f6e35
      Vladislav Zavialov authored and  Marge Bot's avatar Marge Bot committed
      This patch removes 'HsArrApp' and 'HsArrForm' from 'HsExpr' by
      introducing a new ambiguity resolution system in the parser.
      
      Problem: there are places in the grammar where we do not know whether we
      are parsing an expression or a command:
      
      	proc x -> do { (stuff) -< x }   -- 'stuff' is an expression
      	proc x -> do { (stuff) }        -- 'stuff' is a command
      
      Until we encounter arrow syntax (-<) we don't know whether to parse
      'stuff' as an expression or a command.
      
      The old solution was to parse as HsExpr always, and rejig later:
      
      	checkCommand :: LHsExpr GhcPs -> P (LHsCmd GhcPs)
      
      This meant polluting 'HsExpr' with command-related constructors. In
      other words, limitations of the parser were affecting the AST, and
      all other code (the renamer, the typechecker) had to deal with these
      extra constructors by panicking.
      
      We fix this abstraction leak by parsing into an intermediate
      representation, 'ExpCmd':
      
      	data ExpCmdG b where
      	  ExpG :: ExpCmdG HsExpr
      	  CmdG :: ExpCmdG HsCmd
      
      	type ExpCmd = forall b. ExpCmdG b -> PV (Located (b GhcPs))
      
      	checkExp :: ExpCmd -> PV (LHsExpr GhcPs)
      	checkCmd :: ExpCmd -> PV (LHsCmd GhcPs)
      	checkExp f = f ExpG  -- interpret as an expression
      	checkCmd f = f CmdG  -- interpret as a command
      
      See Note [Ambiguous syntactic categories] for details.
      
      Now the intricacies of parsing have no effect on the hsSyn AST when it
      comes to the expression/command ambiguity.
      
      Future work: apply the same principles to the expression/pattern
      ambiguity.
      e61f6e35
  4. 23 Feb, 2019 1 commit
  5. 20 Feb, 2019 1 commit
    • Andrey Mokhov's avatar
      Hadrian: Fix untracked dependencies · 1dad4fc2
      Andrey Mokhov authored and  Marge Bot's avatar Marge Bot committed
      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
  6. 16 Feb, 2019 1 commit
    • Alec Theriault's avatar
      Remove `parallel` as a submodule · 3cb063c8
      Alec Theriault authored and  Marge Bot's avatar Marge Bot committed
      `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
  7. 15 Feb, 2019 1 commit
  8. 10 Feb, 2019 2 commits
  9. 08 Feb, 2019 1 commit
  10. 03 Feb, 2019 1 commit
  11. 31 Jan, 2019 1 commit
  12. 30 Jan, 2019 3 commits
  13. 27 Jan, 2019 1 commit
  14. 23 Jan, 2019 4 commits
    • Gabor Greif's avatar
      A few typofixes · bb2acfe0
      Gabor Greif authored and Ben Gamari's avatar Ben Gamari committed
      bb2acfe0
    • Alec Theriault's avatar
      Hadrian: support in-tree GMP · efc95841
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      This adds top-level configure flags '--with-intree-gmp' and
      '--with-framework-preferred', both of which are especially relevant
      on MacOS.
      
      Besides gaining two new flags, Hadrian also had to be taught what to
      do with the 'framework' in .cabal files.
      
      Test Plan:
      ./boot && ./configure --with-intree-gmp && ./hadrian/build.sh
      ./boot && ./configure --with-gmp-framework-preferred && ./hadrian/build.sh # on macos
      
      Reviewers: carter, snowleopard, alpmestan, hvr, goldfire, bgamari
      
      Subscribers: rwbarton, erikd
      
      GHC Trac Issues: #16001
      
      Differential Revision: https://phabricator.haskell.org/D5417
      efc95841
    • Alec Theriault's avatar
      Hadrian: install patches 'haddock-{html,interface}' · d26869ac
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      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 and Ben Gamari's avatar Ben Gamari committed
      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
  15. 16 Jan, 2019 7 commits
    • Alec Theriault's avatar
      Make sure 'haddock' package also copies resources · 8765c1e6
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      ...and does so in the lib folder of the right stage
      8765c1e6
    • Alec Theriault's avatar
      Hadrian: handle Haddock's resource directory · 2e059120
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      Fixes #16105
      
        * Require Haddock's resource as runtime dependencies of the Haddock
          builder. This means we no longer have to `need` particular resources
          in every other documentation rule.
      
        * Do a _tracked_ copy of both the 'html' and 'latex' folder resource
          folders.
      
        * Move resources into `stage1/lib` (NB: the `haddock` binary goes in
          `stage1/bin`). Besides now actually matching the Haddock script
          wrapper generated by BinaryDist, this also prepares for Haddock
          in relocatable build folder detecting its own resources.
      2e059120
    • Andrey Mokhov's avatar
      Disable Shake Lint by default. · bfb3e307
      Andrey Mokhov authored and Ben Gamari's avatar Ben Gamari committed
      bfb3e307
    • Andrey Mokhov's avatar
      Switch to the untracked version of getDirectoryFiles when scanning for GMP objects · 7218270d
      Andrey Mokhov authored and Ben Gamari's avatar Ben Gamari committed
      See https://ghc.haskell.org/trac/ghc/ticket/15971.
      
      This is work in progress: this commit does the right thing, but does not
      yet fix the ticket.
      7218270d
    • Alec Theriault's avatar
      Support printing `integer-simple` Integers in GHCi · 582a96f4
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      This means that `:p` no longer leaks the implementation details of
      `Integer` with `integer-simple`. The `print037` test case should
      exercise all possible code paths for GHCi's code around printing
      `Integer`s (both in `integer-simple` and `integer-gmp`).
      
      `ghc` the package now also has a Cabal `integer-simple` flag (like the
      `integer-gmp` one).
      582a96f4
    • Alec Theriault's avatar
      Hadrian: support extra libraries + OSX rpath · 2f65025e
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      This fixes some of the issues that surfaced when trying to build
      dynamic GHC on OSX. Unfortunately, due some other `libffi`
      issues, this doesn't completely fix dynamic builds on OSX.
      
        - Use 'extra-libraries' from .cabal files instead of hardcoding
          which packages need which extra libs. Also add support for
          'extra-lib-dirs'.
      
        - Make sure Hadrian looks in the right places to support both
          plain '<pkg>.buildinfo' and '<pkg>.buildinfo.in' files.
      
        - Make the '-rpath' support more robust across OS's (it previously
          didn't work on OSX and possibly windows either).
      
      Reviewers: angerman, alpmestan, adamse, DavidEichmann, bgamari, Phyx
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15990
      
      Differential Revision: https://phabricator.haskell.org/D5409
      2f65025e
    • Alec Theriault's avatar
      Hadrian: configure packages with right 'htmldir' · da2d9cf8
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      This means that we can query the package DB for haddock interfaces.
      Haddock uses this in its testsuite. 'cabal {v1-,v2,}-haddock' also
      uses this.
      
      Also thread through to Haddock package-specific overrides of GHC
      warnings.
      da2d9cf8
  16. 14 Jan, 2019 1 commit
    • Herbert Valerio Riedel's avatar
      Update `Cabal` submodule · cb31b23d
      Herbert Valerio Riedel authored and Ben Gamari's avatar Ben Gamari committed
      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
  17. 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
  18. 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 and Ben Gamari's avatar Ben Gamari committed
      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
  19. 25 Dec, 2018 1 commit
  20. 24 Dec, 2018 1 commit
  21. 17 Dec, 2018 1 commit
    • Alp Mestanogullari's avatar
      Hadrian: introduce userDefaultFlavour, making default flavour overridable · c42eb2e6
      Alp Mestanogullari authored and Ben Gamari's avatar Ben Gamari committed
      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
  22. 15 Dec, 2018 1 commit
  23. 11 Dec, 2018 4 commits
    • Alec Theriault's avatar
      Support generating HIE files · f582379d
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      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 and Ben Gamari's avatar Ben Gamari committed
      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 and Ben Gamari's avatar Ben Gamari committed
      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 and Ben Gamari's avatar Ben Gamari committed
      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
  24. 08 Dec, 2018 2 commits
    • Alp Mestanogullari's avatar
      Hadrian: fix dynamicGhcPrograms value for the quickest flavour · 7d96d281
      Alp Mestanogullari authored and Ben Gamari's avatar Ben Gamari committed
      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 and Ben Gamari's avatar Ben Gamari committed
      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