1. 27 Oct, 2015 1 commit
    • niteria's avatar
      Make it possible to have different UniqSupply strategies · 158d2a91
      niteria authored
      To get reproducible/deterministic builds, the way that the Uniques are
      assigned shouldn't matter. This allows to test for that.
      
      It add 2 new flags:
      
      * `-dinitial-unique`
      * `-dunique-increment`
      
      And by varying these you can get interesting effects:
      
      * `-dinitial-unique=0 -dunique-increment 1` - current sequential
        UniqSupply
      
      * `-dinitial-unique=16777215 -dunique-increment -1` - UniqSupply that
        generates in decreasing order
      
      * `-dinitial-unique=1 -dunique-increment PRIME` - where PRIME big enough
        to overflow often - nonsequential order
      
      I haven't proven the usefullness of the last one yet and it's the reason
      why we have to mask the bits with `0xFFFFFF` in `genSym`, so I can
      remove it if it becomes contentious.
      
      Test Plan: validate on harbormaster
      
      Reviewers: simonmar, austin, ezyang, bgamari
      
      Reviewed By: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1360
      
      GHC Trac Issues: #4012
      158d2a91
  2. 19 Oct, 2015 1 commit
  3. 15 Oct, 2015 1 commit
  4. 10 Oct, 2015 1 commit
  5. 21 Sep, 2015 2 commits
    • Edward Z. Yang's avatar
      Unify hsig and hs-boot; add preliminary "hs-boot" merging. · 06d46b1e
      Edward Z. Yang authored
      This patch drops the file level distinction between hs-boot and hsig;
      we figure out which one we are compiling based on whether or not there
      is a corresponding hs file lying around.
      
      To make the "import A" syntax continue to work for bare hs-boot
      files, we also introduce hs-boot merging, which takes an A.hi-boot
      and converts it to an A.hi when there is no A.hs file in scope.
      This will be generalized in Backpack to merge multiple A.hi files together;
      which means we can jettison the "load multiple interface files" functionality.
      
      This works automatically for --make, but for one-shot compilation
      we need a new mode: ghc --merge-requirements A will generate an A.hi/A.o
      from a local A.hi-boot file; Backpack will extend this mechanism further.
      
      Has Haddock submodule update to deal with change in msHsFilePath behavior.
      
          - This commit drops support for the hsig extension. Can
            we support it?  It's annoying because the finder code is
            written with the assumption that where there's an hs-boot
            file, there's always an hs file too.  To support hsig, you'd
            have to probe two locations.  Easier to just not support it.
      
          - #10333 affects us, modifying an hs-boot still doesn't trigger
            recomp.
      
          - See compiler/main/Finder.hs: this diff is very skeevy, but
            it seems to work.
      
          - This code cunningly doesn't drop hs-boot files from the
            "drop hs-boot files" module graph, if they don't have a
            corresponding hs file.  I have no idea if this actually is useful.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari, spinda
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1098
      06d46b1e
    • Edward Z. Yang's avatar
      3f13c20e
  6. 29 Aug, 2015 1 commit
    • Michael Snoyman's avatar
      Respect GHC_CHARENC environment variable #10762 · 1b56c405
      Michael Snoyman authored
      Only supports UTF-8 as a value right now. I expect some discussion to go
      on around the naming of this variable and whether it's valid to backport
      it to GHC 7.10 (which would be my preference). The motivation here is
      that, when capturing the output of GHC to a file, we often want to
      ensure that the output is UTF-8, regardless of the actual character
      encoding of the terminal/console.
      
      On the other hand, we don't want to necessary change the
      terminal/console encoding. The reason being:
      
      * On Windows, this requires a global-esque change to the console
        codepage, which adversely affects other processes in the same console
      
      * On all OSes, this can break features like smart quote auto-detection.
      
      Test Plan:
      Set LANG to C, GHC_CHARENC to UTF-8, and compile a Haskell source
      file with a non-ASCII warning produced. The output who include the UTF-8
      sequence instead of replacing it with ?.
      
      Reviewers: austin, rwbarton, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: hsyl20, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1167
      
      GHC Trac Issues: #10762
      1b56c405
  7. 18 Aug, 2015 1 commit
    • Michael Snoyman's avatar
      Transliterate unknown characters at output · 22aca536
      Michael Snoyman authored
      This avoids the compiler from crashing when, for example, a warning
      contains a non-Latin identifier and the LANG variable is set to C.
      Fixes #6037.
      
      Test Plan:
      Create a Haskell source file containing an identifier with non-Latin
      characters and no type signature. Compile with `LANG=C ghc -Wall
      foo.hs`, and it should fail. With this patch, it will succeed.
      
      Reviewers: austin, rwbarton, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1153
      
      GHC Trac Issues: #6037, #10762
      22aca536
  8. 21 Jul, 2015 1 commit
  9. 11 Jun, 2015 1 commit
  10. 07 Apr, 2015 1 commit
    • Edward Z. Yang's avatar
      Support for multiple signature files in scope. · a7524eae
      Edward Z. Yang authored
      Summary:
      A common pattern when programming with signatures is to combine multiple
      signatures together (signature linking).  We achieve this by making it
      not-an-error to have multiple, distinct interface files for the same module
      name, as long as they have the same backing implementation.  When a user
      imports a module name, they get ALL matching signatures dumped into their
      scope.
      
      On the way, I refactored the module finder code, which now distinguishes
      between exact finds (when you had a 'Module') and regular finds (when
      you had a 'ModuleName').  I also refactored the package finder code to
      use a Monoid instance on LookupResult to collect together various results.
      
      ToDo: At the moment, if a signature is declared in the local package,
      it completely overrides any remote signatures.  Eventually, we'll want
      to also pull in the remote signatures (or even override the local signature,
      if the full implementation is available.)  There are bunch of ToDos in the
      code for what to do once this is done.
      
      ToDo: At the moment, whenever a module name lookup occurs in GHCi and we
      would have seen a signature, we instead continue and return the Module
      for the backing implementation.  This is correct for most cases, but there
      might be some situations where we want something a little more fine-grained
      (e.g. :browse should only list identifiers which are available through
      the in-scope signatures, and not ALL of them.)
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, hvr, austin
      
      Subscribers: carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D790
      
      GHC Trac Issues: #9252
      a7524eae
  11. 01 Apr, 2015 1 commit
    • thomie's avatar
      Change which files --make thinks are 'Haskellish' (#10220) · 7cec6c7b
      thomie authored
      `.hspp` and `.hscpp` are haskell files that have already been preprocessed.
      
      Treat `.hspp` and `.hscpp` as Haskellish sources again, as they were before
      commit a10e1990. This way, ghc --make will load their imports.
      
      Make sure that `.cmm` and `.cmmcpp` are still not treated as Haskellish,
      by moving them out of `haskell_src_suffixes` (but still keeping them in
      haskellish_suffixes, though I'm not sure what the purpose of that group
      is).
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D778
      7cec6c7b
  12. 31 Mar, 2015 1 commit
  13. 28 Mar, 2015 1 commit
  14. 27 Mar, 2015 1 commit
    • thomie's avatar
      Rename driver phases C(obj)cpp to C(obj)cplusplus · abde5da4
      thomie authored
      Before:
      Cpp     = Pre-process C
      Ccpp    = Compile C++
      Cobjcpp = Compile Objective-C++
      CmmCpp  = Pre-process Cmm
      
      Quite confusing! This commit renames `Ccpp` to `Ccplusplus`, and
      `Cobjcpp` to `Cobjcplusplus`. The two letters `p-p` keep standing for
      `pre-processing` throughout the compiler.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D756
      abde5da4
  15. 18 Mar, 2015 1 commit
  16. 16 Mar, 2015 1 commit
    • thomie's avatar
      Dont call unsafeGlobalDynFlags if it is not set · 5166ee94
      thomie authored
      Parsing of static and mode flags happens before any session is started,
      i.e., before the first call to 'GHC.withGhc'. Therefore, to report
      errors for invalid usage of these two types of flags, we can not call
      any function that needs DynFlags, as there are no DynFlags available yet
      (unsafeGlobalDynFlags is not set either). So we always print "on the
      commandline" as the location, which is true except for Api users, which
      is probably ok.
      
      When reporting errors for invalid usage of dynamic flags we /can/ make
      use of DynFlags, and we do so explicitly in
      DynFlags.parseDynamicFlagsFull.
      
      Before, we called unsafeGlobalDynFlags when an invalid (combination of)
      flag(s) was given on the commandline, resulting in panics (#9963). This
      regression was introduced in 1d6124de.
      
      Also rename showSDocSimple to showSDocUnsafe, to hopefully prevent this
      from happening again.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D730
      
      GHC Trac Issues: #9963
      5166ee94
  17. 27 Nov, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Embed Git commit id into `ghc --info` output · 73e5e2f8
      Herbert Valerio Riedel authored
      Since we switched to a Git submodule based GHC Git repo, `ghc.git`'s
      commit id uniquely identifies the state of the GHC source-tree. So
      having that information embedded into the `ghc` executable provides
      valuable information to track accurately (especially when created by
      buildbots) from which source-tree-state a given `ghc` snapshot
      (distribution) was generated.
      
      So this commit adds a new field `"Project Git commit id"` to the
      `ghc --info` meta-data containing the `./configure`-time Git commit id
      as reported by `git rev-parse HEAD`.
      
      This field can also be queried with `ghc --print-project-git-commit-id`.
      
      For source distributions, the file `GIT_COMMIT_ID` is created (with some
      sanity checking to detect stale commit ids, as that would render this
      information rather useless)
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D528
      73e5e2f8
  18. 21 Nov, 2014 1 commit
    • Lennart Kolmodin's avatar
      ghc: allow --show-options and --interactive together · 624a7c5a
      Lennart Kolmodin authored
      Summary:
      Previously 'ghc --show-options' showed all options that GHC can possibly
      accept. With this patch, it'll only show the options that have effect in
      non-interactive modes.
      This change also adds support for using 'ghc --interactive --show-options'
      which previously was disallowed. This command will show all options that have
      effect in the interactive mode.
      The CmdLineParser is updated to know about the GHC modes, and then each flag
      is annotated with which mode it has effect.
      This fixes #9259.
      
      Test Plan:
      Try out --show-options with --interactive on the command line. With and without
      --interactive should give different results.
      Run the test suite, mode001 has been updated to verify this new flag
      combination.
      
      Reviewers: austin, jstolarek
      
      Reviewed By: austin, jstolarek
      
      Subscribers: jstolarek, thomie, carter, simonmar
      
      Differential Revision: https://phabricator.haskell.org/D337
      
      GHC Trac Issues: #9259
      624a7c5a
  19. 19 Nov, 2014 1 commit
  20. 23 Sep, 2014 1 commit
    • thomie's avatar
      Delete hack when takeDirectory returns "" · 2a743bbd
      thomie authored
      Summary:
      Since commits 8fe1f8 and bb6731 in the filepath packages (ticket #2034, closed
      in 2010), takeDirectory "foo" returns ".", and not "", so this check is no
      longer needed.
      
      Other commits:
      * Remove trailing whitespace
      * Update comments for #2278
      
      Test Plan: harbormaster
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: simonmar, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D213
      
      GHC Trac Issues: #2034
      2a743bbd
  21. 31 Aug, 2014 1 commit
  22. 29 Aug, 2014 1 commit
    • Duncan Coutts's avatar
      Add a ghc -show-packages mode to display ghc's view of the package env · a4cb9a61
      Duncan Coutts authored
      You can use ghc -show-packages, in addition to any -package -package-conf
      -hide-package, etc flags and see just what ghc's package info looks like.
      The format is much like ghc-pkg show.
      
      Like the existing verbose tracing, but a specific mode.
      Re-introduce pretty printed package info (Cabal handled this previously).
      a4cb9a61
  23. 05 Aug, 2014 1 commit
    • Edward Z. Yang's avatar
      Thinning and renaming modules from packages on the command line. · 20787529
      Edward Z. Yang authored
      Summary:
      This patch set adds support for extra syntax on -package and related
      arguments which allow you to thin and rename modules from a package.
      For example, this argument:
      
          -package "base (Data.Bool as Bam, Data.List)"
      
      adds two more modules into scope, Bam and Data.List, without adding
      any of base's other modules to scope.
      
      These flags are additive: so, for example, saying:
      
          -hide-all-packages -package base -package "base (Data.Bool as Bam)"
      
      will provide both the normal bindings for modules in base, as well as
      the module Bam.
      
      There is also a new debug flag -ddump-mod-map which prints the state
      of the module mapping database.  H = hidden, E = exposed (so for
      example EH says the module in question is exported, but in a hidden
      package.)
      
      Module suggestions have been minorly overhauled to work better with reexports:
      if you have -package "base (Data.Bool as Bam)" and mispell Bam, GHC
      will suggest "Did you mean Bam (defined via package flags to be
      base:Data.Bool)"; and generally you will get more accurate information.
      Also, fix a bug where we suggest the -package flag when we really need
      the -package-key flag.
      
      NB: The renaming afforded here does *not* affect what wired in
      symbols GHC generates.  (But it does affect implicit prelude!)
      
      ToDo: add 'hiding' functionality, to make it easier to support the alternative
      prelude use-case.
      
      ToDo: Cabal support
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: new tests and validate
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D113
      
      GHC Trac Issues: #9375
      20787529
  24. 22 Jun, 2014 1 commit
    • Edward Z. Yang's avatar
      Simplify package dump for -v4 · b6352c99
      Edward Z. Yang authored
      Summary:
      Previously, on -v4  and greater, we dumped out the entire package
      database, including lots of metadata that GHC doesn't really care about,
      and is guaranteed to correspond to the equivalent in the local/global
      package databases on disk.  So, to make this output more useful, on -v4
      we instead just print package IDs, and the exposed and trusted flags
      (E and T, which can be tweaked at runtime).
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: successful validate
      
      Reviewers: simonpj
      
      Subscribers: simonmar, relrod
      
      Differential Revision: https://phabricator.haskell.org/D24
      b6352c99
  25. 15 May, 2014 1 commit
  26. 14 May, 2014 1 commit
  27. 08 Apr, 2014 1 commit
  28. 05 Mar, 2014 1 commit
  29. 20 Feb, 2014 1 commit
  30. 18 Feb, 2014 2 commits
  31. 17 Feb, 2014 2 commits
  32. 27 Aug, 2013 1 commit
    • parcs's avatar
      Make stdout and stderr line-buffered · e8d0dc7e
      parcs authored
      An unbuffered handle is very slow to output to and there doesn't seem to
      be any reason to have these handles unbuffered.
      e8d0dc7e
  33. 30 Jul, 2013 1 commit
  34. 13 Jun, 2013 1 commit
  35. 06 Jun, 2013 1 commit
  36. 21 May, 2013 1 commit
  37. 26 Apr, 2013 1 commit