1. 11 Dec, 2018 24 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:
      This is a rebased version of Zubin Duggal's (@wz1000) GHC changes for
      his GSOC project, as posted here:
      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
    • awson's avatar
      RTS linker: don't crash early when not finding extra-libraries · 21339c9f
      awson authored
      Allow GHCi to not crash when no assumed DLL is found in the standard
      location.  E.g. when loading the package built "dyn" way, we may well
      have the package's DLL around, and it's the system linker which loads
      necessary dependencies.
      Why does this (partially) fix #11042? It's because we often (and when
      having packages built `dyn` way -- almost always) don't need to load
      anything recorded in the `extra-libraries` stanza, since if the package
      DLL exists, GHCi linker simply calls the system linker (via `dlopen`/
      `LoadLibrary` APIs) to load it and doesn't bother to load package
      prelinked object file (if any) or package static library.
      Thus, all "regular" (with no fancy low-level package content
      manipulation) packages built "dyn" way should be OK after this fix.
      Reviewers: hvr, bgamari, int-index
      Reviewed By: bgamari, int-index
      Subscribers: Phyx, int-index, rwbarton, carter
      GHC Trac Issues: #11042
      Differential Revision: https://phabricator.haskell.org/D5170
    • Ben Gamari's avatar
      dmdAnal: Move handling of datacon strictness to mkWWstr_one · d549c081
      Ben Gamari authored
      Previously datacon strictness was accounted for when we demand analysed a case
      analysis. However, this results in pessimistic demands in some cases. For
      instance, consider the program (from T10482)
          data family Bar a
          data instance Bar (a, b) = BarPair !(Bar a) !(Bar b)
          newtype instance Bar Int = Bar Int
          foo :: Bar ((Int, Int), Int) -> Int -> Int
          foo f k =
            case f of
              BarPair x y -> case burble of
                                True -> case x of
                                          BarPair p q -> ...
                                False -> ...
      We really should be able to assume that `p` is already evaluated since it came
      from a strict field of BarPair.
      However, as written the demand analyser can not conclude this since we may end
      up in the False branch of the case on `burble` (which places no demand on `x`).
      By accounting for the data con strictness later, applied to the demand of the
      RHS, we get the strict demand signature we want.
      See Note [Add demands for strict constructors] for a more comprehensive
      Test Plan: Validate
      Reviewers: simonpj, osa1, goldfire
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15696
      Differential Revision: https://phabricator.haskell.org/D5226
    • Peter Trommler's avatar
      PPC NCG: Generate MO_?_QuotRem for subword sizes · 9e7d58c8
      Peter Trommler authored
      Handle Int*QuotRemOP and Word*QuotRemOp in PPC NCG.
      Refactor common code with remainder operation.
      Test Plan: validate (I validated on Linux powerpc64le and x86_64)
      Reviewers: erikd, hvr, bgamari, simonmar
      Reviewed By: bgamari
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5323
    • Daniel Gröber (dxld)'s avatar
      Support registering Plugins through the GHC API · da05d79d
      Daniel Gröber (dxld) authored
      This allows tooling using the GHC API to use plugins internally.
      Hopefully this will make it possible to decouple the development of
      useful plugins from (currently) kitchen-sink type tooling projects
      such as ghc-mod or HIE -- at least to some extent.
      Test Plan: validate
      Reviewers: bgamari, mpickering
      Subscribers: mpickering, alanz, rwbarton, carter
      GHC Trac Issues: #15826
      Differential Revision: https://phabricator.haskell.org/D5278
    • Peter Trommler's avatar
      PPC NCG: Implement MachOps for smaller sizes · 9e763afa
      Peter Trommler authored
      Generate code for MachOps with smaller than wordsize data.
      Refactor conversion MachOps.
      Fixes #15854
      Test Plan: validate (I validated on powerpc64le and x86_64 Linux)
      Reviewers: bgamari, hvr, erikd, simonmar
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15854
      Differential Revision: https://phabricator.haskell.org/D5300
    • Roland Senn's avatar
      Misleading msg with qualified imports "No module named X imported" · 4c174ddd
      Roland Senn authored
      To check whether a given module has been imported, we do the following:
      From the list of all qualified names we extract the distinct module
      names to a list of module names.
      Then we check whether the given module name is in this list of module
      Test Plan: make test TEST=T14225
      Reviewers: mpickering, hvr, monoidal, osa1, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, carter
      GHC Trac Issues: #14225
      Differential Revision: https://phabricator.haskell.org/D5331
    • David Eichmann's avatar
      Do not save performance test results if worktree is dirty. · 54ee148c
      David Eichmann authored
      Reviewers: bgamari, tdammers
      Reviewed By: bgamari, tdammers
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15924
      Differential Revision: https://phabricator.haskell.org/D5368
    • Simon Marlow's avatar
      Fix recompilation bug with default class methods (#15970) · 288f681e
      Simon Marlow authored
      If a module uses a class, then it can instantiate the class and
      thereby use its default methods, so we must include the default
      methods when calculating the fingerprint for the class.
      Test Plan:
      New unit test: driver/T15970
      =====> T15970(normal) 1 of 1 [0, 0, 0]
      cd "T15970.run" && $MAKE -s --no-print-directory T15970
      Wrong exit code for T15970()(expected 0 , actual 2 )
      Stdout ( T15970 ):
      Makefile:13: recipe for target 'T15970' failed
      Stderr ( T15970 ):
      C.o:function Main_zdfTypeClassMyDataType1_info: error: undefined
      reference to 'A_toTypedData2_closure'
      C.o:function Main_main1_info: error: undefined reference to
      C.o(.data+0x298): error: undefined reference to 'A_toTypedData2_closure'
      C.o(.data+0x480): error: undefined reference to 'A_toTypedData2_closure'
      collect2: error: ld returned 1 exit status
      `gcc' failed in phase `Linker'. (Exit code: 1)
      After: test passes.
      Reviewers: bgamari, simonpj, erikd, watashi, afarmer
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15970
      Differential Revision: https://phabricator.haskell.org/D5394
    • Zejun Wu's avatar
      Fix uninformative hp2ps error when the cmdline contains double quotes · 0136906c
      Zejun Wu authored
      Reapply D5346 with fix incompatible shell quoting in tests. It seems
      like `$'string'` is not recognized under all test environments, so let's
      avoid it in tests.
      Test Plan:
      hp2ps: "T15904".hp, line 2: integer must follow identifier
      use new ghc and hp2ps to profile a simple program.
      Reviewers: simonmar, bgamari, erikd, tdammers
      Reviewed By: bgamari
      Subscribers: tdammers, carter, rwbarton
      GHC Trac Issues: #15904
      Differential Revision: https://phabricator.haskell.org/D5388
    • Zejun Wu's avatar
      cosmetic change: expandtab in utils/hp2ps/HpFile.c · 0ff5ecfb
      Zejun Wu authored
      rGHCbba2b9bf2d69700dc114118658507aaac34c5e62 expand tabs in
      utils/hp2ps/HpFile.c with tabwidth 2, but the code was written as
      tabwidth 8.  This change simply retabs the code with tabwidth 8 and
      removes trailing spaces.
      Test Plan: Tested in stacked diff: {D5388}
      Reviewers: simonmar, bgamari, afarmer, tdammers
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5407
    • Alp Mestanogullari's avatar
      circleci: ignore gitlab branches for all jobs in the validate workflow · d7cb230a
      Alp Mestanogullari authored
      Our previous attempt ended up breaking the CircleCI config, but
      this one has been tested, see:
      which shows the builds getting triggered correctly. I also pushed the same
      branch under 'gitlab/alp/test', and that didn't trigger any build, as desired.
      Reviewers: bgamari
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5429
    • 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
          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
    • 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
      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
    • Ben Gamari's avatar
      configure: Don't use ln -v · 066d3989
      Ben Gamari authored
      There's no reason why we need to print the linked files and apparently
      ln on OpenBSD doesn't support -v.
      Fixes #15946.
      Test Plan: Validate
      Reviewers: monoidal
      Reviewed By: monoidal
      Subscribers: rwbarton, erikd, carter
      GHC Trac Issues: #15946
      Differential Revision: https://phabricator.haskell.org/D5425
    • Simon Marlow's avatar
      Add +RTS -F to the --help output · 015dd8ab
      Simon Marlow authored
      Test Plan: `./inplace/bin/ghc-stage2 +RTS --help"
      Reviewers: bgamari, sgraf, erikd
      Reviewed By: sgraf
      Subscribers: adamse, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5428
    • 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
    • Ben Gamari's avatar
      circleci: Add integer-simple build target · 50f0cd46
      Ben Gamari authored
      Fixes #15915.
    • Ben Gamari's avatar
    • Ben Gamari's avatar
      rts: Disable fallthrough attribute when compiling with Clang · 6a71add8
      Ben Gamari authored
      Apparently clang doesn't enable implicitly fallthrough warnings by default
      http://llvm.org/viewvc/llvm-project?revision=167655&view=revision when compiling
      C and the attribute cause warnings of their own (#16019).
    • Ben Gamari's avatar
      utils/gen-dll: Bump containers upper bound · e709c8f8
      Ben Gamari authored
      Fixes #16023.
    • Ben Gamari's avatar
    • Ben Gamari's avatar
      testsuite: Use explicit -e in sed command · 3ab8234a
      Ben Gamari authored
      Otherwise Darwin's sed interprets the command as the suffix for -i.
    • Ryan Scott's avatar
      Fix #16008 with a pinch of addConsistencyConstraints · 3899966e
      Ryan Scott authored
      #16008 happened because we forgot to typecheck nullary
      associated type family instances in a way that's consistent with the
      type variables bound by the parent class. Oops. Easily fixed with a
      use of `checkConsistencyConstraints`.
      Test Plan: make test TEST=T16008
      Reviewers: simonpj, goldfire, bgamari
      Reviewed By: goldfire
      Subscribers: rwbarton, carter
      GHC Trac Issues: #16008
      Differential Revision: https://phabricator.haskell.org/D5435
  2. 10 Dec, 2018 1 commit
  3. 08 Dec, 2018 15 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).
    • Ben Gamari's avatar
      testsuite: 32-bit expected output for T15460 · f5bff4bc
      Ben Gamari authored
    • Ben Gamari's avatar
      rts: Ensure that task->id is initialized · 64ef4d7f
      Ben Gamari authored
      Reviewers: erikd, simonmar
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5325
    • Simon Marlow's avatar
      Use --no-as-needed with LLD too · aa619f39
      Simon Marlow authored
      Test Plan: validate using LLD as the linker (TODO)
      Reviewers: bgamari, angerman, kavon, erikd
      Reviewed By: bgamari
      Subscribers: watashi, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5336
    • Matthew Pickering's avatar
      Add -fno-safe-haskell flag · 45e98f64
      Matthew Pickering authored
      This flag can be set to turn off the Safe Haskell checks.
      Whether a module is marked Safe/Unsafe/Trustworthy is ignored when
      this flag to set.
      Reviewers: bgamari, tdammers
      Reviewed By: tdammers
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15920
      Differential Revision: https://phabricator.haskell.org/D5360
    • Ömer Sinan Ağacan's avatar
      Fix StgLint bound id check, generalize StgLint · 04caa935
      Ömer Sinan Ağacan authored
      StgLint was incorrectly using isLocalId for bound id check to see
      whether an id is imported (in which case we don't expect it to be bound)
      or local.  The problem with isLocalId is that its semantics changes
      after Core, as explained in the note: (last line)
          Note [GlobalId/LocalId]
          A GlobalId is
            * always a constant (top-level)
            * imported, or data constructor, or primop, or record selector
            * has a Unique that is globally unique across the whole
              GHC invocation (a single invocation may compile multiple
            * never treated as a candidate by the free-variable finder;
                  it's a constant!
          A LocalId is
            * bound within an expression (lambda, case, local let(rec))
            * or defined at top level in the module being compiled
            * always treated as a candidate by the free-variable finder
          After CoreTidy, top-level LocalIds are turned into GlobalIds
      We now pass current module as a parameter to StgLint, which uses it to
      see if an id should be bound (defined in the current module) or not
      Other changes:
      - Generalized StgLint to make it work on both StgTopBinding and
      - Bring all top-level binders into scope before linting top-level
        bindings to allow uses before definitions.
      TODO: We should remove the binder from local vars when checking RHSs of
      non-recursive bindings.
      Test Plan: This validates.
      Reviewers: simonpj, bgamari, sgraf
      Reviewed By: simonpj, sgraf
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5370
    • Roland Senn's avatar
      Fix #15369: GHCi doesn't honor :set +c when loading for a second time · 57c9b1ae
      Roland Senn authored
      The decision to (re)collect the type info for a (re)loaded module is
      now taken only by comparing the file timestamps of the .hs file of the
      module. (Or form the .o file if the .hs file is missing).
      If the file timestamp changes, we (re)collect the type info.
      The timestamp of the processing time of the last collect is no longer
      Test Plan: make test TEST=T15369
      Reviewers: alanz, hvr, monoidal, osa1, thomie, bgamari, tdammers
      Reviewed By: tdammers
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15369
      Differential Revision: https://phabricator.haskell.org/D5376
    • Andreas Klebinger's avatar
      Add haddock for Node in Digraph. [skip ci] · c5ced679
      Andreas Klebinger authored
      Test Plan: make
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5378
    • Zejun Wu's avatar
      Remove redundant include of Rts.h in EventLogWriter.h · a24ab444
      Zejun Wu authored
      `EventLogWriter.h` doesn't use anything from `Rts.h`, the include is
      redundant. This include is ignored when we include
      Rts.h -> RtsAPI.h -> rts/EventLogWriter.h -> Rts.h
      but can can cause problem when we include `RtsApi.h` directly with
      errors like
      In file included from /usr/lib/ghc-8.6.2/include/RtsAPI.h:20:
      In file included from
      In file included from /usr/lib/ghc-8.6.2/include/Rts.h:185:
      /usr/lib/ghc-8.6.2/include/rts/storage/GC.h:187:29: error: unknown type
      name 'Capability'
      StgPtr  allocate          ( Capability *cap, W_ n );
      Test Plan: ./validate
      Reviewers: simonmar, bgamari, afarmer, erikd, alexbiehl
      Reviewed By: bgamari, alexbiehl
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5395
    • Ömer Sinan Ağacan's avatar
      Rename "changed" to "no-change" in HscMain · f2bad7e1
      Ömer Sinan Ağacan authored
      hscSimpleIface is returning a bool for whether there were _no changes_
      in the iface file. The same bool is called "no_change_at_all" in
      mkIface_, and "no_change" in hscWriteIface and other functions. However
      it is called "changed" in HscMain.finish and hscMaybeWriteIface, which
      is confusing because "changed" and "no_change" have opposite meanings.
      This patch renames "changed" to "no_change" to fix this.
      Reviewers: simonpj, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5416
    • 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
    • Ömer Sinan Ağacan's avatar
      Mark SRT_1/SRT_2 as CONSTR_1_0/CONSTR_2_0 · 38edeea9
      Ömer Sinan Ağacan authored
      Test Plan:
      Validated locally, but skipped perf tests as there's a
      framework-related error
      Reviewers: simonmar, bgamari, erikd
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5421
    • 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
    • Alec Theriault's avatar
      Require 'libdw' for '--enable-dwarf-unwind' · cb882fc9
      Alec Theriault authored
      This causes './configure --enable-dwarf-unwind' to exit with a helpful
      error message when 'libdw' cannot be found (compared to the previous
      behaviour of silently pretending the user hadn't requested DWARF support
      at all).
      Test Plan: ./configure --enable-dwarf-unwind # on systems with/without
      Reviewers: bgamari, nh2
      Reviewed By: nh2
      Subscribers: nh2, rwbarton, erikd, carter
      GHC Trac Issues: #15968
      Differential Revision: https://phabricator.haskell.org/D5424
    • Peter Trommler's avatar
      Mark broken tests on powerpc64le and skip ghci-ext · bd808316
      Peter Trommler authored
      Mark tests with DWARF as broken
      Test way `ghci-ext` only where available
      Test Plan: validate
      Reviewers: bgamari, hvr, simonmar, erikd, Phyx
      Reviewed By: bgamari, Phyx
      Subscribers: Phyx, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5297