1. 08 Sep, 2015 4 commits
    • thomie's avatar
      Build system: make *-cross BuildFlavours consistent (#10223) · 330fbbda
      thomie authored
      This is a follow up to 841924c9,
      where `-fllvm` was explicitly removed from GhcStage1HcOpts for
      perf-cross.
      
      After removing -fllvm from GhcStage1HcOpts, it should be removed from
      SRC_HC_OPTS as well, because SRC_HC_OPTS are added to every Haskell
      compilation. That's what this patch does.
      
      BuildFlavour bench-cross (added in ddf79ebf),
      is probably never used. But for consistency, also use -fllvm here, for
      building stage2 and the libraries.
      
      Reviewed by: austin
      
      Differential Revision: https://phabricator.haskell.org/D1228
      330fbbda
    • thomie's avatar
      Build system: delete the InstallExtraPackages variable · a1586074
      thomie authored
      Just install all packages that are built. Don't make an exception for
      the dph and extra packages.
      
      You can control whether the dph and extra packages should be build using
      the variables BUILD_DPH and BUILD_EXTRA_PKGS. These variables didn't
      exist before. But now that they do, InstallExtraPackages isn't really
      needed anymore.
      
      Reviewed by: austin
      
      Differential Revision: https://phabricator.haskell.org/D1227
      a1586074
    • thomie's avatar
      Build system: remove hack for Mac OSX in configure.ac (#10476) · 864a9c4f
      thomie authored
      Cross-compilation on Mac OSX currently doesn't work. While building
      stage 1, the build system uses the `ar` for the target architecture
      instead of the `ar` for build/host architecture.
      
      The cause is a hack added in 24746fe7
      (2010), to supporting bootstrap compilers built with older versions of
      Xcode. Xcode 4.3 started installing command line tools in a different
      location. Assuming this all behind us now, and the paths didn't change
      again (you never now), we can delete the hack.
      
      Deleting the hack fixes the cross compilation issue. Tested by Trac user
      jakzale.
      
      Reviewed by: austin
      
      Differential Revision: https://phabricator.haskell.org/D1231
      864a9c4f
    • thomie's avatar
      Build system: detect when user cloned from GitHub · 554be5e7
      thomie authored
      Cloning the ghc repository from GitHub doesn't work out of the box. It
      requires installing some special url rewrites into ~/.gitconfig. The
      build fails mysteriously if you forget. This patch tries to detect when
      you cloned from GitHub, and warns you if you didn't set those url
      rewrites.
      
      This hopefully lowers to barrier to contribute to GHC by a tiny bit. At
      least one /r/haskell user ran into this recently.
      
      Test Plan:
      cloned from github, ran ./boot, saw the message. Installed url
      rewrites, and ran ./boot again, didn't see the message.
      
      Reviewed by: austin
      
      Differential Revision: https://phabricator.haskell.org/D1230
      554be5e7
  2. 07 Sep, 2015 5 commits
    • Joachim Breitner's avatar
      Further simplify the story around minimum/maximum · c6b82e99
      Joachim Breitner authored
      After I have found out that I should look at -ddump-prep and not
      -ddump-core, I noticed that these days, GHC is perfectly capeable of
      turning (the equivalent) of foldl to (the equivalent) of foldl' if the
      operation in question is strict. So instead of using rewrite rules to
      rewrite maximum to a strictMaximum for certain types, we simply use
      SPECIALIZE.
      
      This also marks maximum/minimum as INLINEABLE, so that client code can
      get similar specializations, hopefully even automatically. And inded,
      minimum applied to [Double] produces good code (although due to
      inlineing, not due to specialization, it seems).
      
      I checked (by looking at the core) that this still fixes #10788.
      
      Differential revision: https://phabricator.haskell.org/D1229
      c6b82e99
    • Joachim Breitner's avatar
      SPECIALIZE strictMinimum for Int and Integer · dc671a1c
      Joachim Breitner authored
      This fixes a regression reported in #10788, where due to less inlining
      compared to earlier versions, we’d get worse code. With the SPECIALIZE,
      we get the good code, and moreover, the good code is in List.hs and
      _not_ inlined to the use site, so smaller code size and less compilation
      time.
      dc671a1c
    • thomie's avatar
      Build system: cleanup utils/ghc-pkg/ghc.mk · 1abbacd6
      thomie authored
      There used to be a lot of custom make code to build ghc-pkg with the
      stage0 compiler. Commit ac5a3145
      thankfully cleaned this up, by using the build settings from the
      ghc-pkg.cabal file.
      
      This commit removes some remains of the old way of installing ghc-pkg
      when Stage1Only=YES. Notably, we called both `build-prog` as
      `shell-wrapper`. This is surely wrong, because `build-prog` already
      calls `shell-wrapper`. It isn't needed to set WANT_INSTALLED_WRAPPER
      either; build-prog does that for us.
      
      This prevents the following warnings when Stage1Only=YES:
        utils/ghc-pkg/ghc.mk:46: warning:
          overriding commands for target `install_utils/ghc-pkg_dist_wrapper'
        utils/ghc-pkg/ghc.mk:37: warning:
          ignoring old commands for target `install_utils/ghc-pkg_dist_wrapper'
      
      Also add more comments and restructure a bit.
      
      Reviewed by: austin
      
      Differential Revision: https://phabricator.haskell.org/D1063
      1abbacd6
    • thomie's avatar
      Build system: simplify *-llvm BuildFlavours (#10223) · b40e5595
      thomie authored
      Note that SRC_HC_OPTS are added to every Haskell compilation. So
      there isn't any need to also add `-fllvm` to GhcStage1HcOpts,
      GhcStage2HcOpts and GhcLibHcOpts.
      
      Small bug fix: make sure we test for -fllvm in SRC_HC_OPTS, to check
      whether the bootstrap compiler is affected by bug #9439.
      
      Reviewed by: austin
      
      Differential Revision: https://phabricator.haskell.org/D1188
      b40e5595
    • thomie's avatar
      Build system: put each BuildFlavour in a separate file (#10223) · 2c24fd70
      thomie authored
      This allows easier diffing of different BuildFlavours, including
      `mk/flavours/validate.mk`.
      
      Reviewed By: bgamari, austin
      
      Differential Revision: https://phabricator.haskell.org/D1050
      2c24fd70
  3. 05 Sep, 2015 3 commits
  4. 04 Sep, 2015 4 commits
  5. 03 Sep, 2015 6 commits
  6. 02 Sep, 2015 15 commits
    • thomie's avatar
      Testsuite: delete dead code · bd16e0bc
      thomie authored
      bd16e0bc
    • thomie's avatar
      Testsuite: by default run all tests for a single way · c43c8e2c
      thomie authored
      `make test` now runs all tests for a single way only. Use `make slowtest` to
      get the previous behaviour (i.e. run all tests for all ways).
      
      The intention is to use this new `make test` setting for Phabricator, as
      a reasonable compromise between `make fasttest` (what it previously
      used) and a fullblown `make slowtest` (which runs all tests for all
      ways).
      
      See Note [validate and testsuite speed] in toplevel Makefile.
      
      Differential Revision: https://phabricator.haskell.org/D1178
      c43c8e2c
    • Eric Seidel's avatar
      Fix some tests that were broken by D861 · 32a9eada
      Eric Seidel authored
      I didn't realize that `./validate` does not run every test :(
      
      Test Plan: ./validate --slow
      
      Update submodule hpc.
      
      Differential Revision: https://phabricator.haskell.org/D1204
      32a9eada
    • thomie's avatar
      Testsuite: mark 4 tests expect_broken_for(#10712, opt_ways) · 3b233793
      thomie authored
      Please revert when #10712 is fixed.
      3b233793
    • thomie's avatar
      Testsuite: update expected output · e0b3ff0f
      thomie authored
      e0b3ff0f
    • thomie's avatar
      Testsuite: don't warn about missing specialisations · 5d7a873a
      thomie authored
      They can only occur with `-O`, but we want tests to produce the same
      output for all test ways.
      
      This brings us closer to passing the complete testsuite.
      
      Differential Revision: https://phabricator.haskell.org/D1203
      5d7a873a
    • Ben Gamari's avatar
      stm: Fix test case · 3cc8f075
      Ben Gamari authored
      Updates stm submodule.
      3cc8f075
    • Simon Peyton Jones's avatar
      Improve the error messages for class instance errors · 28ac9d31
      Simon Peyton Jones authored
      Summary: See Note [Displaying potential instances].
      
      Reviewers: austin
      
      Subscribers: KaneTW, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1176
      28ac9d31
    • spinda's avatar
      Expand declaration QQs first (#10047) · c8f623e3
      spinda authored
      Declaration QuasiQuoters do not cause a group split like $(...)
      splices, and are run and expanded before other declarations in
      the group.
      
      Resolves the lingering issue with #10047, and fixes broken tests
      qq007 and qq008.
      
      Test Plan: validate
      
      Reviewers: goldfire, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: goldfire, simonpj, thomie, spinda
      
      Differential Revision: https://phabricator.haskell.org/D1199
      
      GHC Trac Issues: #10047
      c8f623e3
    • spinda's avatar
      Allow annotations though addTopDecls (#10486) · ba5554ec
      spinda authored
      addTopDecls restricts what declarations it can be used to add. Adding
      annotations via this method works fine with no special changes apart
      from adding AnnD to the declaration whitelist.
      
      Test Plan: validate
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1201
      
      GHC Trac Issues: #10486
      ba5554ec
    • snoyberg's avatar
      Use a response file for linker command line arguments #10777 · 296bc70b
      snoyberg authored
      On Windows, we're constrained to 32k bytes total for command line
      arguments.  When building large projects, this limit can be exceeded.
      This patch changes GHC to always use response files for linker
      arguments, a feature first used by Microsoft compilers and added to GCC
      (over a decade ago).
      
      Alternatives here include:
      
      * Only use this method on Windows systems
      * Check the length of the command line arguments and use that to decide
        whether to use this method
      
      I did not pursue either of these, as I believe it would make the patch
      more likely to break in less tested situations.
      
      Test Plan:
      Confirm that linking still works in general. Ideally: compile a very
      large project on Windows with this patch. (I am attempting to do that
      myself now, but having trouble getting the Windows build tool chain up
      and running.)
      
      Reviewers: goldfire, hvr, rwbarton, austin, thomie, bgamari, Phyx
      
      Reviewed By: thomie, bgamari, Phyx
      
      Subscribers: erikd, awson, #ghc_windows_task_force, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1158
      
      GHC Trac Issues: #8596, #10777
      296bc70b
    • Matthew Pickering's avatar
      Add test for updating a record with existentially quantified fields. · ff9432f6
      Matthew Pickering authored
      Test Plan: ./validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1193
      ff9432f6
    • Ben Gamari's avatar
      Fix trac #10413 · 010e1878
      Ben Gamari authored
      Test Plan: Validate.
      
      Reviewers: austin, tibbe, bgamari
      
      Reviewed By: tibbe, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1194
      
      GHC Trac Issues: #10413
      010e1878
    • Eric Seidel's avatar
      Use IP based CallStack in error and undefined · 6740d70d
      Eric Seidel authored
      This patch modifies `error`, `undefined`, and `assertError` to use
      implicit call-stacks to provide better error messages to users.
      
      There are a few knock-on effects:
      
      - `GHC.Classes.IP` is now wired-in so it can be used in the wired-in
        types for `error` and `undefined`.
      
      - `TysPrim.tyVarList` has been replaced with a new function
        `TysPrim.mkTemplateTyVars`. `tyVarList` made it easy to introduce
        subtle bugs when you need tyvars of different kinds. The naive
      
        ```
        tv1 = head $ tyVarList kind1
        tv2 = head $ tyVarList kind2
        ```
      
        would result in `tv1` and `tv2` sharing a `Unique`, thus substitutions
        would be applied incorrectly, treating `tv1` and `tv2` as the same
        tyvar. `mkTemplateTyVars` avoids this pitfall by taking a list of kinds
        and producing a single tyvar of each kind.
      
      - The types `GHC.SrcLoc.SrcLoc` and `GHC.Stack.CallStack` now live in
        ghc-prim.
      
      - The type `GHC.Exception.ErrorCall` has a new constructor
        `ErrorCallWithLocation` that takes two `String`s instead of one, the
        2nd one being arbitrary metadata about the error (but usually the
        call-stack). A bi-directional pattern synonym `ErrorCall` continues to
        provide the old API.
      
      Updates Cabal, array, and haddock submodules.
      
      Reviewers: nh2, goldfire, simonpj, hvr, rwbarton, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, rodlogic, goldfire, maoe, simonmar, carter,
      liyang, bgamari, thomie
      
      Differential Revision: https://phabricator.haskell.org/D861
      
      GHC Trac Issues: #5273
      6740d70d
    • thomie's avatar
      Testsuite: refactoring only · ad26c54b
      thomie authored
      * Rename `platform_wordsize_qualify` to `find_expected_file`, and make
        it return a filename instead of an (absolute) filepath.
      
      * Replace most usages of `qualify` by `in_testdir`. Others usage sites
        will be deleted in a later commit.
      
      These changes will be useful in a later commit, when we'll distinguish
      between files in the source directory and those in a (newly created)
      test directory.
      
      Reviewed by: austin, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1186
      ad26c54b
  7. 31 Aug, 2015 1 commit
    • niteria's avatar
      Anchor type family instances deterministically · 10a07753
      niteria authored
      Summary:
      This is very similar to D1073. It makes type family instances to be
      attached to a binding with a least `OccName`, therefore not depending on `Unique` ordering.
      
      Test Plan:
      * this makes `Language.Haskell.Exts.SrcLoc` deterministic
      * ./validate
      
      Reviewers: simonmar, austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1192
      
      GHC Trac Issues: #4012
      10a07753
  8. 30 Aug, 2015 2 commits