summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* rts: Usage message wibblesBen Gamari2017-02-261-1/+1
|
* Load `pthreads` by default on WindowsTamar Christina2017-02-261-1/+13
| | | | | | | | | | | | | | | | | | | | | The GCC Bindists that we use compile with `pthread` enabled by default. This means that on every link the dll is passed as a dependency by the driver. Lots of packages depend on it but the runtime linker doesn't provide it by default making compiled code work but not interpreted. Following D3028 `pthreads` would be provided by default ONLY when linked dynamicly, which we don't support yet (See D2592). Until this is the case we need to manually provide `libpthreads`. Test Plan: ./validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3155
* Make list of deprecated symbols on Windows weak.Tamar Christina2017-02-263-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a unfortunate workaround in place for the fact that most packages out there use POSIX names for symbols even on Windows. This means that we have to recognize e.g. both `_ungetch` and `ungetch`. The former is the actual symbol name on windows and the latter is the POSIX variant. The problem is that on normal windows programs `ungetch` should not be in the global namespace. To work around this, we now mark the deprecated symbols as weak symbols in the global namespace. This provides the flexibility we need: * If you use the symbol without defining it, we assume you meant to use the POSIX variant. * If you actually define the symbol, we'll hence forth use that definition and assume you didn't mean to use POSIX code. This is how MingW64's wrapper also works. This requires D3028. Fixes #13210. Test Plan: ./validate Reviewers: austin, bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3154
* Load dependent dlls.Tamar Christina2017-02-262-67/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the `GCC` driver envokes the pipeline a `SPEC` is used to determine how to configure the compiler and which libraries to pass along. For Windows/mingw, this specfile is https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/mingw32.h This has a lot of interesting things that we need to emulate in order to be able to link as many things out of the box as GCC. In particular this is why you never need to specify `-lgcc_s` when compiling, but you do when using `GHCi`. Unfortunately due to time constraints I can't set up the framework required in `GHC` to do this before the feature freeze. So I suggest this alternate implementation: When we load a dll, also bring it's dependencies into scope of the interpeter. This has pros and cons. Pro is, we'll fix many packages on hackage which specify just `-lstdc++`. Since this points to `libstdc++-6.dll` which will bring `libgcc` into scope. The downside is, we'll be more lenient than GCC, in that the interpreter will link much easier since it has implicit dependencies in scope. Whereas for compilation to work you will have to specify it as an argument to GHC. This will make the Windows runtime linker more consistent with the unix ones. The difference in semantics came about because of the differences between `dlsym` and `GetProcAddress`. The former seems to search the given library and all it's dependencies, while the latter only searches the export table of the library. So we need some extra manual work to search the dependencies which this patch provides. Test Plan: ``` ./validate ``` ``` $ echo :q | inplace/bin/ghc-stage2.exe --interactive +RTS -Dl -RTS -lstdc++ 2>&1 | grep "Loading dependency" ``` ``` $ echo :q | ../inplace/bin/ghc-stage2.exe --interactive -lstdc++ +RTS -Dl -RTS 2>&1 | grep "Loading dependency" Loading dependency *.exe -> GDI32.dll. Loading dependency GDI32.dll -> ntdll.dll. Loading dependency *.exe -> KERNEL32.dll. Loading dependency KERNEL32.dll -> KERNELBASE.dll. Loading dependency *.exe -> msvcrt.dll. Loading dependency *.exe -> SHELL32.dll. Loading dependency SHELL32.dll -> USER32.dll. Loading dependency USER32.dll -> win32u.dll. Loading dependency *.exe -> WINMM.dll. Loading dependency WINMM.dll -> WINMMBASE.dll. Loading dependency *.exe -> WSOCK32.dll. Loading dependency WSOCK32.dll -> WS2_32.dll. Loading dependency WS2_32.dll -> RPCRT4.dll. Loading dependency libstdc++-6.dll -> libwinpthread-1.dll. Loading dependency libstdc++-6.dll -> libgcc_s_seh-1.dll. ``` Trac tickets: #13093, #13189 Reviewers: simonmar, rwbarton, austin, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, RyanGlScott, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3028
* Bring in unicode variants of API Annotations for HsBracketAlan Zimmerman2017-02-265-23/+35
|
* Rename compact to ghc-compact.Edward Z. Yang2017-02-2640-171/+131
| | | | | | | | | | | | | | | | | 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: Edward 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
* Correctly pretty print a wild card in infix positionAlan Zimmerman2017-02-254-0/+12
|
* Delete redundant import.Edward Z. Yang2017-02-241-1/+0
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix validate.Edward Z. Yang2017-02-241-10/+6
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Record full FieldLabel in ifConFields.Edward Z. Yang2017-02-247-80/+66
| | | | | | | | | | | | | | | | | | | | | | Summary: The previous implementation tried to be "efficient" by storing field names once in IfaceConDecls, and only just enough information for us to reconstruct the FieldLabel. But this came at a bit of code complexity cost. This patch undos the optimization, instead storing a full FieldLabel at each data constructor. Consequently, this fixes bugs #12699 and #13250. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: adamgundry, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3174
* Document AMP as a Report deviationDavid Feuer2017-02-241-2/+7
| | | | | | | | | | | | | | | | `Applicative` as a superclass of `Monad` is non-standard. Fixes #13196. [skip ci] Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3185
* Add a comment explaining CompleteMatchSig in HsBindsMatthew Pickering2017-02-241-0/+7
| | | | [skip ci]
* Make SCCFunSig tag Located for ghc-exactprintAlan Zimmerman2017-02-243-3/+3
|
* Add API Annotation AnnSignature for backpack signature modulesAlan Zimmerman2017-02-242-1/+2
|
* Make exprIsConApp_maybe work better for literals stringsSimon Peyton Jones2017-02-247-11/+56
| | | | | | | | | | | | | | | | There are two things here * Use exprIsLiteral_maybe to "look through" a variable bound to a literal string. * Add CONLIKE to the NOINLINE pragma for unpackCString# and unpackCStringUtf8# See Trac #13317, Trac #10844, and Note [exprIsConApp_maybe on literal strings] in CoreSubst I did a nofib run and got essentially zero change except for one 2.2% improvement in allocation for 'pretty'.
* Add instances for (:~~:) mirroring those for (:~:)Ryan Scott2017-02-236-2/+41
| | | | | | | | | | | | | | | `(:~~:)`, the hetergeneous version of `(:~:)`, should have class instances similar to those of `(:~:)`, especially since their implementations aren't particularly tricky or surprising. This adds them. Reviewers: bgamari, austin, hvr, goldfire Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3181
* Correct Windows libdir assumptions.Tamar Christina2017-02-232-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHC and ghc-pkg make some pretty hard assumptions about where they're running on Windows. They assume that they are always running from `foo/bin/ghc.exe` and that to find the `lib` folder they can drop `bin/ghc.exe` from the base path and append `lib`. This is already false for the testsuite, which when testing thenbindist has one test which puts the binaries in `inplace/test spaces`. For some reason before this was either being skipped or mysteriously passing. But as of `2017.02.11` our luck ran out. the testsuite triggers a failure such as those in #13310 Let's soften the assumption and just check that `../lib` exists instead. 80 chars Test Plan: ./validate Reviewers: austin, erikd, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3158
* Fix parsing of And chains in BoolFormulaDmitry Ivanov2017-02-231-3/+7
| | | | | | | | | | | | | | | | | Parse `foo, bar, baz` into `And [foo, bar, baz]` instead of `And [foo, And [bar, baz]]`. Fixes #11024. Test Plan: read and think Reviewers: austin, bgamari, mpickering Reviewed By: bgamari, mpickering Subscribers: ezyang, thomie, alanz Differential Revision: https://phabricator.haskell.org/D3139
* Include OverloadedRecordFields selectors in NameShape.Edward Z. Yang2017-02-234-1/+32
| | | | | | | | | | | | | | | Summary: Fixes #13323. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3175
* More tracing in SpecConstrSimon Peyton Jones2017-02-231-4/+10
| | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3179
* Use half as much memory when reading interfacesReid Barton2017-02-232-3/+5
| | | | | | | | | | | | | | | I don't see any reason for the (filesize*2), and experimentally allocations do go down slightly after this change. Test Plan: validate Reviewers: simonmar, austin, bgamari, trofi Reviewed By: bgamari, trofi Subscribers: trofi, thomie Differential Revision: https://phabricator.haskell.org/D3164
* ghci users guide: mention "~" expansion in :addChris Martin2017-02-231-0/+4
| | | | | | | | | | | | | I discovered this feature via Stack Overflow. https://stackoverflow.com/questions/42310399 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3150
* base: Add handling of -- to getArgs for WindowsAndreas Klebinger2017-02-235-2/+32
| | | | | | | | | | | | | getArgs didn't match the treatmeant of -- in the RTS leading to inconsistencies between behavior on Windows and other platforms. See #13287. Reviewers: austin, hvr, bgamari, erikd, simonmar, rwbarton Reviewed By: bgamari, rwbarton Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3147
* rts: Correct the nursery size in the gen 1 growth computationJohn C. Carey2017-02-231-1/+13
| | | | | | | | | | | | Fixes trac issue #13288. Reviewers: austin, bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: mutjida, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3143
* testsuite: Remove old python version testsReid Barton2017-02-231-38/+4
| | | | | | | | | | | | Test Plan: harbormaster Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3140
* Set $1_$2_SplitSections in distdir-opts.mk not build-package.mkReid Barton2017-02-232-19/+19
| | | | | | | | | | | | | | | | | | | | | | | After commit a50082c11 we use -ffunction-sections -fdata-sections for all C compilations, when $1_$2_SplitSections is set. But that variable was set in build-package.mk which is not run for the RTS. As a result the RTS was not being split, leading to larger binaries. This commit fixes RTS splitting by moving the definition of $1_$2_SplitSections to distdir-opts.mk, which is run for the RTS (and also from build-package.mk). Test Plan: manual ./validate and check that RTS and base .c files are split, but not object files in the compiler Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, snowleopard, olsner Differential Revision: https://phabricator.haskell.org/D3137
* JSON profiler reportsBen Gamari2017-02-239-27/+200
| | | | | | | | | | | | | | | | | | | This introduces a JSON output format for cost-centre profiler reports. It's not clear whether this is really something we want to introduce given that we may also move to a more Haskell-driven output pipeline in the future, but I nevertheless found this helpful, so I thought I would put it up. Test Plan: Compile a program with `-prof -fprof-auto`; run with `+RTS -pj` Reviewers: austin, erikd, simonmar Reviewed By: simonmar Subscribers: duncan, maoe, thomie, simonmar Differential Revision: https://phabricator.haskell.org/D3132
* Have --backpack complain if multiple files are passed.Edward Z. Yang2017-02-232-8/+11
| | | | | | | | | | | | | | | Summary: At the moment it silently swallows the actual arguments; not good! Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: rwbarton, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3173
* Give better error message with you run ghc foo.bkpEdward Z. Yang2017-02-232-3/+12
| | | | | | | | | | | | | | | | Summary: Detect Backpackish suffixes, and bail out if we try to run them in the pipeline. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: rwbarton, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3172
* testsuite: Bump a performance testsBen Gamari2017-02-231-32/+35
| | | | | | | T5321Fun, T3064, and T12707 are failing, but only on Darwin. I suspect this is probably creep from Typeable and pushed over the edge by some of Simon's recent commits. Unfortunately the tree brokenness due to the recent submodule bumps makes it difficult to pin down.
* Spelling only [ci skip]Gabor Greif2017-02-2315-16/+16
|
* Export commentToAnnotation from Lexer.xAlan Zimmerman2017-02-231-0/+1
|
* Drop NFData constraint from compact.Edward Z. Yang2017-02-2211-62/+31
| | | | | | | | | | | | | | | | | | | | | Summary: It's both unsound (easy to write a bogus NFData instance) and incomplete (you might want to serialize data that doesn't have an NFData instance, and will be fine at runtime.) So better just to drop it. (By the way, we used to need the NFData instance to "pre-evaluate" the data before we copied it into the region, but since Simon Marlow rewrote the code to directly evaluate and copy, this is no longer necessary.) Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, austin, dfeuer, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3168
* Changelog notice for compact.Edward Z. Yang2017-02-221-0/+10
| | | | | | | | | | Test Plan: none Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3165
* Revert recent submodule bumpsBen Gamari2017-02-2213-16/+14
| | | | | | | | They broke everything and the solution will be non-trivial. This reverts commit 8ccbc2e5252abd4fa67d155d4fff489ee9929906. This reverts commit c8d995db5d743358b0583fe97f8113bf9047641e. This reverts commit 7153370288e6075c4f8c996ff02227e48805da06.
* Bump time submoduleBen Gamari2017-02-221-0/+0
| | | | | | | | | My previous attempt at bumping `time` was confused by a non-fast-forward update from upstream. Here we merge the orphaned commit back into master, fixing mirroring. Also, we will now follow upstream's `ghc` branch instead of `master` to prevent this sort of thing happening again in the future.
* A much nicer solution for typechecking ApplicativeDoSimon Peyton Jones2017-02-221-35/+32
| | | | | | | | | | | This patch improves the code for TcMatches.tcApplicativeStmts; see the suggestion in Trac #13242 comment:9. I now use (mapM goArg args) rather than a CPS-style fold. The result is less code, easier to understand, and automatically fixes the original problem in Trac #13242. See Note [ApplicativeDo and constraints].
* Test Trac #13244Simon Peyton Jones2017-02-222-0/+35
|
* Fix ApplicativeDo constraint scopingSimon Peyton Jones2017-02-223-22/+70
| | | | | | | | This patch fixes Trac #13242, by a bit of fancy footwork with the LIE variable in which the WantedConstraints are collected. I think it can be simplified further, using a 'map'.
* Test Trac #13271Simon Peyton Jones2017-02-223-0/+18
|
* Bump Cabal and containers submodulesBen Gamari2017-02-219-12/+14
|
* Fix all broken perf tests on x64 WindowsTamar Christina2017-02-215-6/+29
| | | | | | | | | | | | | various perf tests have been broken over the course of the past few months. This updates the numbers. Test Plan: ./validate Reviewers: austin, bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3160
* Test Trac #13300Simon Peyton Jones2017-02-213-0/+17
|
* Gather constraints locally in checkMainSimon Peyton Jones2017-02-215-7/+45
| | | | | | | | Wiwth -fdefer-type-errors we were generating some top-level equality constraints, just in a corner of checkMain. The fix is easy. Fixes Trac #13292
* Disallow class instances for synonymsSimon Peyton Jones2017-02-214-6/+60
| | | | | | | | See Trac #13267 and Note [Instances and constraint synonyms] in TcValidity. We can't easily do a perfect job, because the rename is really trying to do its lookup too early. But this is at least an improvement.
* A bit more tc-tracing in TcTyClsDeclsSimon Peyton Jones2017-02-211-0/+2
|
* Remove panics for TcTyConSimon Peyton Jones2017-02-212-50/+57
| | | | | | | | | | | | | Previously TcTyCons were used only for knot-tying, but now they are also used after an error, to add a benign TyCon to the envt so we can carry on; see TyCon.makeRecoveryTyCon. But since it is used in this way, subsequent declarations may see a TcTyCon (e.g. during injectivity checks) and should not have a heart attack as a result. See Note [TcTyCon] in TyCon. This fixes Trac #13271
* A little refactoring of the simplifier around join pointsSimon Peyton Jones2017-02-212-38/+45
| | | | | | | | | | * Rename SimplEnv.setInScope to setInScopeAndZapFloats, because I keep forgetting that's what it does * Remove unnecessary (and hence confusing) zapJoinFloats from simplLazyBind * Reorder args of simplJoinRhs to put the cont last
* Replace some pushTcLevelM's with pushTcLevelM_Ryan Scott2017-02-211-3/+3
| | | | | | | These occurrences of pushTcLevelM weren't using the resulting TcLevel, so they can be replaced with the (ostensibly more efficient) pushTcLevelM_. No change in behavior.
* Minor spelling, grammar, and formatting fixesRyan Scott2017-02-211-6/+7
| | | | [ci skip]