1. 29 Aug, 2017 1 commit
    • Tamar Christina's avatar
      Remove dll-split. · 5266ab90
      Tamar Christina authored
      This patch removes dll-split from the code base, the reason is dll-split
      no longer makes any sense. It was designed to split a dll in two, but we
      now already have many more symbols than would fit inside two dlls. So we
      need a third one. This means there's no point in having to maintain this
      list as it'll never work anyway and the solution isn't scalable.
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, #ghc_windows_task_force
      
      GHC Trac Issues: #5987
      
      Differential Revision: https://phabricator.haskell.org/D3882
      5266ab90
  2. 25 Aug, 2017 1 commit
  3. 22 Aug, 2017 1 commit
  4. 01 Aug, 2017 1 commit
    • Herbert Valerio Riedel's avatar
      Enable building Cabal with parsec · 36fe21aa
      Herbert Valerio Riedel authored
      Cabal's parser has been rewritten in terms of Parsec (which is not
      enabled yet in Cabal-2.0 by default, but can be enabled by a cabal
      flag). The plan for Cabal is to drop support for the non-parsec parser,
      so we need to prepare GHC to cope with new situation.
      
      However, this means that lib:Cabal requires three new library
      dependency submodules,
      
       - parsec
       - text
       - mtl
      
      What complicates matters is that we need to build `ghc-cabal` early on
      during the bootstrap phase which currently needs to invoke `ghc --make`
      directly. So these additional dependencies need to be integrated into
      the monolithic `ghc --make` invocation which produces the `ghc-cabal`
      executable.
      
      Test Plan: `./validate --fast` passed
      
      Reviewers: austin, bgamari
      
      Subscribers: erikd, phadej, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3757
      36fe21aa
  5. 21 Jul, 2017 1 commit
    • Ben Gamari's avatar
      build system: Ensure there are no duplicate files in bindist list · fefcbfa8
      Ben Gamari authored
      Several executables inexplicably appear twice in bindist.list, which
      ends up producing multiple tar file entries, consequently breaking BSD
      tar during extraction. I spent a fair amount of time trying to work out
      where these duplicates were coming from to no avail. Since Hadrian is
      right around the corner I'm satisfied with a terrible hack: just uniq
      bindist.list before producing the bindist tarball.
      
      Test Plan: Validate
      
      Reviewers: austin
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #13979, #13974
      
      Differential Revision: https://phabricator.haskell.org/D3767
      fefcbfa8
  6. 23 Jun, 2017 1 commit
    • Michal Terepeta's avatar
      Hoopl: remove dependency on Hoopl package · 42eee6ea
      Michal Terepeta authored
      This copies the subset of Hoopl's functionality needed by GHC to
      `cmm/Hoopl` and removes the dependency on the Hoopl package.
      
      The main motivation for this change is the confusing/noisy interface
      between GHC and Hoopl:
      - Hoopl has `Label` which is GHC's `BlockId` but different than
        GHC's `CLabel`
      - Hoopl has `Unique` which is different than GHC's `Unique`
      - Hoopl has `Unique{Map,Set}` which are different than GHC's
        `Uniq{FM,Set}`
      - GHC has its own specialized copy of `Dataflow`, so `cmm/Hoopl` is
        needed just to filter the exposed functions (filter out some of the
        Hoopl's and add the GHC ones)
      With this change, we'll be able to simplify this significantly.
      It'll also be much easier to do invasive changes (Hoopl is a public
      package on Hackage with users that depend on the current behavior)
      
      This should introduce no changes in functionality - it merely
      copies the relevant code.
      Signed-off-by: Michal Terepeta's avatarMichal Terepeta <michal.terepeta@gmail.com>
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari, simonmar
      
      Reviewed By: bgamari, simonmar
      
      Subscribers: simonpj, kavon, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3616
      42eee6ea
  7. 02 Jun, 2017 1 commit
  8. 23 May, 2017 1 commit
    • Sergei Trofimovich's avatar
      ghc.mk: rename installed ghc-stage1 on non-windows · 10760105
      Sergei Trofimovich authored
      When user installs _native_ build ghc executable is renamed
      from '$(libexec)/bin/ghc-stage<N>' to '$(libexec)/bin/ghc'.
      But not on windows!
      
      In case of _cross-compiler_ rename should happen only
      for '$(libexec)/bin/ghc-stage<N>' runnable on non-windows
      platform.
      
      Before the change '$(libexec)/bin/ghc-stage<N>' rename happened
      for any compiler not targeting windows.
      
      After the patch rename also happens for '$(libexec)/bin/ghc-stage1'
      cross-compiler built for linux targeting windows (Stage1Only=YES case).
      
      Or on a concrete example:
      
         # host is x86_64-pc-linux-gnu
         $ ./configure --target=i686-w64-mingw32
         $ make install Stage1Only=YES
      
      Before the change the layout was:
         - '$(libexec)/bin/ghc-stage1' was installed
         - bin/ghc contained 'exec $(libexec)/bin/ghc' # missing file!
      After the change:
         - '$(libexec)/bin/ghc' was installed
         - bin/ghc contained 'exec $(libexec)/bin/ghc' # present file
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      10760105
  9. 22 May, 2017 1 commit
  10. 24 Apr, 2017 2 commits
  11. 23 Apr, 2017 1 commit
    • Sergei Trofimovich's avatar
      ghc.mk: fix 'make install' for cross-mingw32 · 74e5ec9e
      Sergei Trofimovich authored
      Attempt to install cross-compiled mingw32 GHC built on linux failed as:
      
          $ make install DESTDIR=$(pwd)/__i__
      
          "mv" "$(pwd)/__i__/usr/local/lib/ghc-8.3.20170422/bin/ghc-stage2" \
               "$(pwd)/__i__/usr/local/lib/ghc-8.3.20170422/bin/ghc"
          mv: failed to stat
               '$(pwd)/__i__/usr/local/lib/ghc-8.3.20170422/bin/ghc-stage2': \
               No such file or directory
      
      The rename should not be performed for windows targets.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      74e5ec9e
  12. 21 Apr, 2017 1 commit
  13. 08 Apr, 2017 1 commit
    • Sergei Trofimovich's avatar
      fix 'make install' for cross-stage2 · 54895c90
      Sergei Trofimovich authored
      When cross-built GHC is being installed one of
      latest steps is to register installed libraries
      with 'ghc-pkg'.
      
      GHC uses freshly installed 'ghc-pkg' and 'ghc-stage2'
      for that.
      
      Tested as:
          ./configure --target=aarch64-unknown-linux-gnu
          make install DESTDIR=$(pwd)/__s2 STRIP_CMD=:
      
      Before the change install failed on ghc-pkg execution phase:
      
          ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg" \
              --force \
              --global-package-db \
              ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/package.conf.d" \
              update rts/dist/package.conf.install
          /bin/sh: .../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg: \
              No such file or directory
      
      To avoid breakage we use 'ghc' and 'ghc-pkg' built by stage0.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Test Plan: run 'make install' on stage2 crosscompiler
      
      Reviewers: rwbarton, austin, bgamari
      
      Subscribers: thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3432
      54895c90
  14. 28 Feb, 2017 2 commits
  15. 26 Feb, 2017 2 commits
    • Ben Gamari's avatar
      build system: Persist CrossCompiling in binary distributions · a7eeb607
      Ben Gamari authored
      The build system uses the CrossCompiling variable to decide whether or
      not we should build various packages that must be built using the
      compiler.  Consequently, it is important that we persist its value in
      the binary distribution so we know during `make install` not to go
      looking for files that would have been built for these packages. Failing
      to do this causes #13325.
      
      Test Plan: Cross compile, `make binary-dist`, and try installing the
      binary distribution on the target
      
      Reviewers: hvr, austin, trofi, rwbarton
      
      Reviewed By: trofi, rwbarton
      
      Subscribers: carter, trofi, rwbarton, erikd, thomie, snowleopard, davean
      
      Differential Revision: https://phabricator.haskell.org/D3187
      a7eeb607
    • Edward Z. Yang's avatar
      Rename compact to ghc-compact. · a0b4a2ac
      Edward Z. Yang authored
      Summary:
      The plan is to release a separate library, 'compact', which gives a
      friendly user-facing interface.  This library is just enough so that we
      can make sure the functionality is working in GHC.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, dfeuer, austin, simonmar, hvr
      
      Subscribers: thomie, erikd, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3206
      a0b4a2ac
  16. 20 Dec, 2016 1 commit
  17. 19 Dec, 2016 1 commit
  18. 18 Dec, 2016 1 commit
  19. 15 Dec, 2016 1 commit
  20. 07 Dec, 2016 1 commit
    • Alan Zimmerman's avatar
      Add HsSyn prettyprinter tests · 499e4382
      Alan Zimmerman authored
      Summary:
      Add prettyprinter tests, which take a file, parse it, pretty print it,
      re-parse the pretty printed version and then compare the original and
      new ASTs (ignoring locations)
      
      Updates haddock submodule to match the AST changes.
      
      There are three issues outstanding
      
      1. Extra parens around a context are not reproduced. This will require an
         AST change and will be done in a separate patch.
      
      2. Currently if an `HsTickPragma` is found, this is not pretty-printed,
         to prevent noise in the output.
      
         I am not sure what the desired behaviour in this case is, so have left
         it as before. Test Ppr047 is marked as expected fail for this.
      
      3. Apart from in a context, the ParsedSource AST keeps all the parens from
         the original source.  Something is happening in the renamer to remove the
         parens around visible type application, causing T12530 to fail, as the
         dumped splice decl is after the renamer.
      
         This needs to be fixed by keeping the parens, but I do not know where they
         are being removed.  I have amended the test to pass, by removing the parens
         in the expected output.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, mpickering, simonpj, bgamari, austin
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: simonpj, goldfire, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2752
      
      GHC Trac Issues: #3384
      499e4382
  21. 26 Aug, 2016 1 commit
    • harendra's avatar
      Fix doc build inconsistency · 1083f453
      harendra authored
      Remove the doc targets completely not partially when disabled.
      Otherwise even though we are able to build the targets but we will see
      some strange errors.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2470
      1083f453
  22. 20 Jul, 2016 1 commit
    • gcampax's avatar
      Compact Regions · cf989ffe
      gcampax authored
      This brings in initial support for compact regions, as described in the
      ICFP 2015 paper "Efficient Communication and Collection with Compact
      Normal Forms" (Edward Z. Yang et.al.) and implemented by Giovanni
      Campagna.
      
      Some things may change before the 8.2 release, but I (Simon M.) wanted
      to get the main patch committed so that we can iterate.
      
      What documentation there is is in the Data.Compact module in the new
      compact package.  We'll need to extend and polish the documentation
      before the release.
      
      Test Plan:
      validate
      (new test cases included)
      
      Reviewers: ezyang, simonmar, hvr, bgamari, austin
      
      Subscribers: vikraman, Yuras, RyanGlScott, qnikst, mboes, facundominguez, rrnewton, thomie, erikd
      
      Differential Revision: https://phabricator.haskell.org/D1264
      
      GHC Trac Issues: #11493
      cf989ffe
  23. 16 May, 2016 1 commit
    • Ben Gamari's avatar
      Move Extension type to ghc-boot-th · eed820b6
      Ben Gamari authored
      This creates a new package, `ghc-boot-th`, to contain the `Extension`
      type, which now lives in `GHC.LanguageExtension.Type`. This ensures that
      the transitive dependency set of the `template-haskell` package remains
      minimal.
      
      The `GHC.LanguageExtensions.Type` module is also re-exported by
      `ghc-boot`, which provides an orphan `binary` instance as well.
      
      Test Plan: Validate
      
      Reviewers: goldfire, thomie, hvr, austin
      
      Reviewed By: thomie
      
      Subscribers: RyanGlScott, thomie, erikd, ezyang
      
      Differential Revision: https://phabricator.haskell.org/D2224
      eed820b6
  24. 07 Apr, 2016 1 commit
  25. 09 Feb, 2016 2 commits
    • Ben Gamari's avatar
      Unset GREP_OPTIONS in build system · bfec4a6a
      Ben Gamari authored
      Test Plan: GREP_OPTIONS=--blah ./validate
      
      Reviewers: austin, thomie
      
      Reviewed By: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1887
      
      GHC Trac Issues: #11530
      bfec4a6a
    • thomie's avatar
      Early error when crosscompiling + haddock/docs · 04fb7813
      thomie authored
      When CrossCompiling=YES or Stage1Only=YES, building the haddocks and the
      User's Guide should be skipped, because haddock and mkUserGuidePart
      depend on the GHC API.
      See Note [No stage2 packages when CrossCompiling or Stage1Only] for
      details.
      
      There are several places in the build system where the variables
      HADDOCK_DOCS and BUILD_SPHINX_* are checked. Instead of also checking
      for the variables CrossCompiling or Stage1Only in all those places,
      `make` will now exit with a nice error message when the user requests
      the impossible.
      
      Reviewers: rwbarton, austin, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1882
      04fb7813
  26. 27 Jan, 2016 1 commit
    • Tamar Christina's avatar
      Enable RemoteGHCi on Windows · 44a5d51a
      Tamar Christina authored
      Makes the needed changes to make RemoteGHCi work on Windows.
      The approach passes OS Handles areound instead of the Posix Fd
      as on Linux.
      
      The reason is that I could not find any real documentation about
      the behaviour of Windows w.r.t inheritance and Posix FDs.
      
      The implementation with Fd did not seem to be able to find the Fd
      in the child process. Instead I'm using the much better documented
      approach of passing inheriting handles.
      
      This requires a small modification to the `process` library.
      https://github.com/haskell/process/pull/52
      
      Test Plan: ./validate On Windows x86_64
      
      Reviewers: thomie, erikd, bgamari, simonmar, austin, hvr
      
      Reviewed By: simonmar
      
      Subscribers: #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D1836
      
      GHC Trac Issues: #11100
      44a5d51a
  27. 18 Jan, 2016 1 commit
  28. 10 Jan, 2016 1 commit
  29. 08 Jan, 2016 1 commit
    • Simon Marlow's avatar
      Enable stack traces with ghci -fexternal-interpreter -prof · 6be09e88
      Simon Marlow authored
      Summary:
      The main goal here is enable stack traces in GHCi.  After this change,
      if you start GHCi like this:
      
        ghci -fexternal-interpreter -prof
      
      (which requires packages to be built for profiling, but not GHC
      itself) then the interpreter manages cost-centre stacks during
      execution and can produce a stack trace on request.  Call locations
      are available for all interpreted code, and any compiled code that was
      built with the `-fprof-auto` familiy of flags.
      
      There are a couple of ways to get a stack trace:
      
      * `error`/`undefined` automatically get one attached
      * `Debug.Trace.traceStack` can be used anywhere, and prints the current
        stack
      
      Because the interpreter is running in a separate process, only the
      interpreted code is running in profiled mode and the compiler itself
      isn't slowed down by profiling.
      
      The GHCi debugger still doesn't work with -fexternal-interpreter,
      although this patch gets it a step closer.  Most of the functionality
      of breakpoints is implemented, but the runtime value introspection is
      still not supported.
      
      Along the way I also did some refactoring and added type arguments to
      the various remote pointer types in `GHCi.RemotePtr`, so there's
      better type safety and documentation in the bridge code between GHC
      and ghc-iserv.
      
      Test Plan: validate
      
      Reviewers: bgamari, ezyang, austin, hvr, goldfire, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1747
      
      GHC Trac Issues: #11047, #11100
      6be09e88
  30. 04 Jan, 2016 1 commit
    • thomie's avatar
      Build system: delete ghc-pwd · 4c56ad36
      thomie authored
      On Windows, with msys2, `pwd` works (as can be seen by the use of `pwd`
      that slipped into the validate script), so there is really no need for
      `ghc-pwd` anymore.
      
      Test Plan: try it
      
      Reviewers: austin, bgamari, Phyx
      
      Reviewed By: Phyx
      
      Subscribers: Phyx, erikd
      
      Differential Revision: https://phabricator.haskell.org/D1731
      4c56ad36
  31. 28 Dec, 2015 1 commit
    • Herbert Valerio Riedel's avatar
      Synchronise ghci-package version with ghc-package · 01299ca8
      Herbert Valerio Riedel authored
      In order to simplify the task, the version munging logic has
      been radically simplified:
      
      Previously, in cases where the version contained dates as version components,
      the build-system would munge the version of the stage1 ghc package before
      registering the `ghc` package.
      
      However, this hack was already questionable at the time of its introduction
      (c.f. 7b45c46c).
      Simplifying the build-systems by avoiding such hacks may also help the
      shaking-up-ghc effort.
      
      So now we simply munge directly via the `.cabal` files, which gives a simpler
      picture, as now every stage is munged the same. Munging is only active when
      the first patch-level version component is a date. So stable snapshots and release
      candidates are unaffacted (as those have the date in the second patch-level
      version component)
      
      Reviewers: simonmar, bgamari, austin, thomie, ezyang
      
      Reviewed By: bgamari, thomie, ezyang
      
      Differential Revision: https://phabricator.haskell.org/D1673
      01299ca8
  32. 19 Dec, 2015 1 commit
  33. 17 Dec, 2015 4 commits
    • thomie's avatar
      Build system: allow bindist without docs · 116ba5e7
      thomie authored
      Useful for testing 'make binary-dist-prep' when HADDOCK_DOCS=NO.
      
      Reviewed by: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1648
      116ba5e7
    • thomie's avatar
      Build system: also put scripts in libexecdir/bin · c1bd3d44
      thomie authored
      This follows a similar change in
      4905b83a, where binaries are installed
      in libexecdir/bin instead of libexecdir.
      
      This fixes a problem with ghc not able to find ghc-split, when
      SplitObjs=YES.
      c1bd3d44
    • Simon Marlow's avatar
      Fix libffi dependency, and remove redundant LibFFI.hsc · 27f47cda
      Simon Marlow authored
      LibFFI.hsc was moved to libraries/ghci/GHCi/FFI.hsc, I just forgot to
      remove the old one.  We also need an explicit dependency on libffi,
      which moves from compiler/ghc.mk to the top-level ghc.mk (because
      libraries/ghci/ghc.mk is auto-generated).
      27f47cda
    • Simon Marlow's avatar
      Remote GHCi, -fexternal-interpreter · 4905b83a
      Simon Marlow authored
      Summary:
      (Apologies for the size of this patch, I couldn't make a smaller one
      that was validate-clean and also made sense independently)
      
      (Some of this code is derived from GHCJS.)
      
      This commit adds support for running interpreted code (for GHCi and
      TemplateHaskell) in a separate process.  The functionality is
      experimental, so for now it is off by default and enabled by the flag
      -fexternal-interpreter.
      
      Reaosns we want this:
      
      * compiling Template Haskell code with -prof does not require
        building the code without -prof first
      
      * when GHC itself is profiled, it can interpret unprofiled code, and
        the same applies to dynamic linking.  We would no longer need to
        force -dynamic-too with TemplateHaskell, and we can load ordinary
        objects into a dynamically-linked GHCi (and vice versa).
      
      * An unprofiled GHCi can load and run profiled code, which means it
        can use the stack-trace functionality provided by profiling without
        taking the performance hit on the compiler that profiling would
        entail.
      
      Amongst other things; see
      https://ghc.haskell.org/trac/ghc/wiki/RemoteGHCi for more details.
      
      Notes on the implementation are in Note [Remote GHCi] in the new
      module compiler/ghci/GHCi.hs.  It probably needs more documenting,
      feel free to suggest things I could elaborate on.
      
      Things that are not currently implemented for -fexternal-interpreter:
      
      * The GHCi debugger
      * :set prog, :set args in GHCi
      * `recover` in Template Haskell
      * Redirecting stdin/stdout for the external process
      
      These are all doable, I just wanted to get to a working validate-clean
      patch first.
      
      I also haven't done any benchmarking yet.  I expect there to be slight hit
      to link times for byte code and some penalty due to having to
      serialize/deserialize TH syntax, but I don't expect it to be a serious
      problem.  There's also lots of low-hanging fruit in the byte code
      generator/linker that we could exploit to speed things up.
      
      Test Plan:
      * validate
      * I've run parts of the test suite with
      EXTRA_HC_OPTS=-fexternal-interpreter, notably tests/ghci and tests/th.
      There are a few failures due to the things not currently implemented
      (see above).
      
      Reviewers: simonpj, goldfire, ezyang, austin, alanz, hvr, niteria, bgamari, gibiansky, luite
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1562
      4905b83a