ghc.git
5 years agoPackage keys (for linking/type equality) separated from package IDs.
Edward Z. Yang [Fri, 18 Jul 2014 13:48:47 +0000 (14:48 +0100)] 
Package keys (for linking/type equality) separated from package IDs.

This patch set makes us no longer assume that a package key is a human
readable string, leaving Cabal free to "do whatever it wants" to allocate
keys; we'll look up the PackageId in the database to display to the user.
This also means we have a new level of qualifier decisions to make at the
package level, and rewriting some Safe Haskell error reporting code to DTRT.

Additionally, we adjust the build system to use a new ghc-cabal output
Make variable PACKAGE_KEY to determine library names and other things,
rather than concatenating PACKAGE/VERSION as before.

Adds a new `-this-package-key` flag to subsume the old, erroneously named
`-package-name` flag, and `-package-key` to select packages by package key.

RFC: The md5 hashes are pretty tough on the eye, as far as the file
system is concerned :(

ToDo: safePkg01 test had its output updated, but the fix is not really right:
the rest of the dependencies are truncated due to the fact the we're only
grepping a single line, but ghc-pkg is wrapping its output.

ToDo: In a later commit, update all submodules to stop using -package-name
and use -this-package-key.  For now, we don't do it to avoid submodule
explosion.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, simonmar, hvr, austin

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D80

5 years agoDisable package auto-hiding if -hide-all-packages is passed
Edward Z. Yang [Thu, 31 Jul 2014 17:11:22 +0000 (18:11 +0100)] 
Disable package auto-hiding if -hide-all-packages is passed

Summary:
This is in preparation for thinning/renaming package arguments, which allow
users to rename modules of packages they import.  In situations like this,
it may be desirable to load multiple copies of a package at different versions
explicitly under different names.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, simonmar, hvr, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D106

5 years agofix topHandler03 execution on Solaris where shell signals SIGTERM correctly
Karel Gardas [Mon, 4 Aug 2014 13:15:54 +0000 (08:15 -0500)] 
fix topHandler03 execution on Solaris where shell signals SIGTERM correctly

Summary:
This patch fixes topHandler03 execution on Solaris where
shell correctly signals SIGTERM as exit status 15.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D112

5 years agofix openFile003 test on Solaris/i386 (platform output is not needed anymore)
Karel Gardas [Mon, 4 Aug 2014 13:15:39 +0000 (08:15 -0500)] 
fix openFile003 test on Solaris/i386 (platform output is not needed anymore)

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D114

5 years agoghc --make: add nicer names to RTS threads (threaded IO manager, make workers)
Sergei Trofimovich [Mon, 4 Aug 2014 13:10:33 +0000 (08:10 -0500)] 
ghc --make: add nicer names to RTS threads (threaded IO manager, make workers)

Summary:
The patch names most of RTS threads
and ghc (the tool) threads.

It makes nicer debug and eventlog output for ghc itself.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: ran debugged ghc under '+RTS -Ds'

Reviewers: simonmar, austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D101

5 years agofix linker_unload test on Solaris/i386 platform
Karel Gardas [Mon, 4 Aug 2014 13:10:11 +0000 (08:10 -0500)] 
fix linker_unload test on Solaris/i386 platform

Summary:
This patch set fixes two issues in linker_unload test case
on Solaris/i386 platform. First there is an issue in linker_unload.c
which causes warning to be emitted about _FILE_OFFSET_BITS redefined.
This is solved by including ghcconfig.h as a first header file.
Another issue is that on Solaris and its builders we use to configure
ghc with --with-gmp-libraries=/usr/lib and this causes issue with
test case Makefile's logic. It attempts to start linker_unload
and pass it HSinteger-gmp library for unload, but the library
name is prefixed with two directories names. The first is of
ghc's integer-gmp/build itself and another is the directory name
passed to --with-gmp-libraries= configure parameter. In case
of Solaris this is /usr/lib. The testcase then fails on unloading
integer-gmp/build directory thinking that this is a library to unload.
This issue is solved by cuting the first library name from the list
and using this for unloading the HSinteger-gmp library.

Test Plan: validate

Reviewers: ezyang, austin

Reviewed By: ezyang, austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D110

5 years agoUse 'install' command for 'inplace/' install as we do in 'make install'
Sergei Trofimovich [Mon, 4 Aug 2014 13:09:44 +0000 (08:09 -0500)] 
Use 'install' command for 'inplace/' install as we do in 'make install'

Summary:
On hardened gentoo ghc-stage2 does not work as-is,
as it uses runtime code generation/loading, thus
ghc0stage2 needs to be marked in a special way
(via POSIX extened attributes).

Before the patch we used 'cp -p' command, which
does not preserve that marking. It leads to buid
failure on hardened. Hardened's 'install' does
preserve POSIX xattrs, thus patch uses it instead.

'inplace/' directory can be seen the same way as target
for 'make install', thus using the same facilities
to install files to 'inplace/' sounds more consistent.

Reported-by: Jay Yang
Gentoo-bug: https://bugs.gentoo.org/518734
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: tested ghc installation on vanilla and hardened distributions

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D108

5 years agodocs: fix typo: 'OVERLAPPINGP' -> 'OVERLAPPING'
Sergei Trofimovich [Mon, 4 Aug 2014 13:09:29 +0000 (08:09 -0500)] 
docs: fix typo: 'OVERLAPPINGP' -> 'OVERLAPPING'

Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Test Plan: proofread

Reviewers: ezyang, austin

Reviewed By: ezyang, austin

Subscribers: phaskell, ezyang, simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D100

5 years agoTerminate in forkProcess like in real_main
Edsko de Vries [Mon, 4 Aug 2014 13:09:11 +0000 (08:09 -0500)] 
Terminate in forkProcess like in real_main

Test Plan: validate

Reviewers: simonmar, austin

Reviewed By: simonmar, austin

Subscribers: phaskell, simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D99

GHC Trac Issues: #9377

5 years agoAdd missing *.stderr files
Joachim Breitner [Sat, 2 Aug 2014 08:00:22 +0000 (10:00 +0200)] 
Add missing *.stderr files

which probably should have been added in commit fbd0586ea

5 years agoAdd in (disabled for now) test of a Safe Haskell bug.
David Terei [Sat, 2 Aug 2014 01:50:45 +0000 (18:50 -0700)] 
Add in (disabled for now) test of a Safe Haskell bug.

5 years agoInfer safety of modules correctly with new overlapping pragmas.
David Terei [Sat, 2 Aug 2014 01:49:43 +0000 (18:49 -0700)] 
Infer safety of modules correctly with new overlapping pragmas.

5 years agoUpdate Safe Haskell typeable test outputs.
David Terei [Thu, 31 Jul 2014 17:12:35 +0000 (10:12 -0700)] 
Update Safe Haskell typeable test outputs.

5 years agoAllow warning if could have been infered safe instead of explicit
David Terei [Tue, 18 Mar 2014 22:45:54 +0000 (15:45 -0700)] 
Allow warning if could have been infered safe instead of explicit
Trustworthy label.

5 years agoDont allow hand-written Generic instances in Safe Haskell.
David Terei [Fri, 6 Dec 2013 01:27:17 +0000 (17:27 -0800)] 
Dont allow hand-written Generic instances in Safe Haskell.

While they aren't strictly unsafe, it is a similar situation to
Typeable. There are few instances where a programmer will write their
own instance, and having compiler assurance that the Generic
implementation is correct brings a lot of benefits.

5 years agoFix-up to d4d4bef2 'Improve the desugaring of RULES'
Simon Peyton Jones [Fri, 1 Aug 2014 20:26:51 +0000 (21:26 +0100)] 
Fix-up to d4d4bef2 'Improve the desugaring of RULES'

I'd forgotten the possiblity that desugaring could generate
dead dictionary bindings; easily fixed by calling occurAnalyseExpr

5 years agoTwo new executables to ignore.
Edward Z. Yang [Fri, 1 Aug 2014 18:14:31 +0000 (19:14 +0100)] 
Two new executables to ignore.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
5 years ago[backpack] More revisions to various pieces.
Edward Z. Yang [Thu, 31 Jul 2014 16:52:56 +0000 (17:52 +0100)] 
[backpack] More revisions to various pieces.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
5 years agoBump haddock.base max_bytes_used
Joachim Breitner [Fri, 1 Aug 2014 17:55:52 +0000 (19:55 +0200)] 
Bump haddock.base max_bytes_used

It has reliably increased with commit 1ae5fa45, and has been stable
since then, so it does not seem to be a fluke. I did not investigate why
that commit might have increased this value.

5 years agoImprove the desugaring of RULES, esp those from SPECIALISE pragmas
Simon Peyton Jones [Fri, 1 Aug 2014 13:56:53 +0000 (14:56 +0100)] 
Improve the desugaring of RULES, esp those from SPECIALISE pragmas

In the code for Trac #8331 we were not getting a complaint, but
we *were* getting a terrible (and virtually useless) RULE, looking
like
   useAbstractMonad (complicated-dictionary-expresion) = $fuseAbstractMonad
where we wanted
   useAbstractMonad d = $fuseAbstractMonad

This commit improves the desugaring algorithm.  More comments
explain; see Note [Drop dictionary bindings on rule LHS]

5 years agoA panic in CmmBuildInfoTables.bundle shouldn't be a panic (#9329)
Simon Marlow [Thu, 31 Jul 2014 10:47:16 +0000 (11:47 +0100)] 
A panic in CmmBuildInfoTables.bundle shouldn't be a panic (#9329)

Summary:
This code needs more comments, but I believe this is safe.  By
definition I can't have broken anything that was working by turning a
panic into a non-panic anyway.

Test Plan: validate

Reviewers: hvr, simonpj, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D105

GHC Trac Issues: #9329

5 years agoadd a comment
Simon Marlow [Thu, 31 Jul 2014 10:47:44 +0000 (11:47 +0100)] 
add a comment

5 years agoupdate comment
Simon Marlow [Thu, 31 Jul 2014 10:47:35 +0000 (11:47 +0100)] 
update comment

5 years agoFix reference to note
Simon Marlow [Thu, 31 Jul 2014 10:47:28 +0000 (11:47 +0100)] 
Fix reference to note

5 years agointerruptible() was not returning true for BlockedOnSTM (#9379)
Simon Marlow [Thu, 31 Jul 2014 09:00:16 +0000 (10:00 +0100)] 
interruptible() was not returning true for BlockedOnSTM (#9379)

Summary:
There's an knock-on fix in HeapStackCheck.c which is potentially
scary, but I'm pretty confident is OK.  See comment for details.

Test Plan:
I've run all the STM
tests I can find, including libraries/stm/tests/stm049 with +RTS -N8
and some of the constants bumped to make it more of a stress test.

Reviewers: hvr, rwbarton, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D104

GHC Trac Issues: #9379

5 years agopanic message fix
Simon Marlow [Thu, 31 Jul 2014 09:33:42 +0000 (10:33 +0100)] 
panic message fix

5 years agorefactor to fix 80column overflow
Simon Marlow [Thu, 31 Jul 2014 08:30:18 +0000 (09:30 +0100)] 
refactor to fix 80column overflow

5 years agoUnbreak build.
Gabor Pali [Fri, 1 Aug 2014 08:26:53 +0000 (10:26 +0200)] 
Unbreak build.

5 years agoTypo fixes
Gabor Greif [Fri, 1 Aug 2014 00:03:08 +0000 (02:03 +0200)] 
Typo fixes

5 years agoSmall tweaks to comment
Gabor Greif [Thu, 31 Jul 2014 23:46:29 +0000 (01:46 +0200)] 
Small tweaks to comment

5 years agoMinor wordsmithing of comments
Gabor Greif [Thu, 31 Jul 2014 23:29:10 +0000 (01:29 +0200)] 
Minor wordsmithing of comments

5 years agoFix up ghci044
Simon Peyton Jones [Thu, 31 Jul 2014 20:37:01 +0000 (21:37 +0100)] 
Fix up ghci044

5 years agoTypo in comment
Gabor Greif [Thu, 31 Jul 2014 16:56:50 +0000 (18:56 +0200)] 
Typo in comment

5 years agoComplete work on new OVERLAPPABLE/OVERLAPPING pragmas (Trac #9242)
Simon Peyton Jones [Thu, 31 Jul 2014 14:49:14 +0000 (15:49 +0100)] 
Complete work on new OVERLAPPABLE/OVERLAPPING pragmas (Trac #9242)

* Deprecate -XOverlappingInstances

* Update test suite.  Several tests even had entirely unnecessary
  uses of -XOverlappingInstances

* Update user manual with a careful description of the instance
  resolution story

* Fix an outright bug in the handling of duplidate instances in GHCi,
  which are meant to silently overwrite the earlier duplicate. The
  logic was right for family instances but was both more complicated,
  and plain wrong, for class instances.  (If you are interested, the
  bug was that we were eliminating the duplicate from the InstEnv, but
  not from the [ClsInst] held in tcg_insts.)  Test is ghci044a.

5 years agoAdd comments about the {-# INCOHERENT #-} for Typeable (f a)
Simon Peyton Jones [Thu, 31 Jul 2014 13:01:32 +0000 (14:01 +0100)] 
Add comments about the {-# INCOHERENT #-} for Typeable (f a)

C.f. Trac #9242

5 years agoComments only
Simon Peyton Jones [Thu, 31 Jul 2014 12:49:47 +0000 (13:49 +0100)] 
Comments only

5 years agoAdd a fast-path in TcInteract.kickOutRewritable
Simon Peyton Jones [Thu, 31 Jul 2014 12:49:32 +0000 (13:49 +0100)] 
Add a fast-path in TcInteract.kickOutRewritable

5 years agoTest Trac #9380
Simon Peyton Jones [Thu, 31 Jul 2014 12:48:46 +0000 (13:48 +0100)] 
Test Trac #9380

5 years agoComments and white space
Simon Peyton Jones [Mon, 28 Jul 2014 13:21:04 +0000 (14:21 +0100)] 
Comments and white space

5 years ago[backpack] Package selection
Edward Z. Yang [Thu, 31 Jul 2014 13:05:02 +0000 (14:05 +0100)] 
[backpack] Package selection

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
5 years agoCompiler perf has improved a bit
Simon Peyton Jones [Thu, 31 Jul 2014 07:57:35 +0000 (08:57 +0100)] 
Compiler perf has improved a bit

5 years agoComments and minor refactoring
Simon Peyton Jones [Thu, 31 Jul 2014 07:57:13 +0000 (08:57 +0100)] 
Comments and minor refactoring

- Better comments about Generalised Newtype Deriving
  See Note [Bindings for Generalised Newtype Deriving]

- Refactor the interface between TcDeriv and TcGenDeriv,
  to reduce the size of the interface of the latter.

5 years agoComments and white space
Simon Peyton Jones [Tue, 29 Jul 2014 21:01:59 +0000 (22:01 +0100)] 
Comments and white space

5 years agoAllow multiple entry points when allocating recursive groups (#9303)
Simon Marlow [Tue, 22 Jul 2014 11:04:32 +0000 (12:04 +0100)] 
Allow multiple entry points when allocating recursive groups (#9303)

Summary:
In this example we ended up with some code that was only reachable via
an info table, because a branch had been optimised away by the native
code generator.  The register allocator then got confused because it
was only considering the first block of the proc to be an entry point,
when actually any of the info tables are entry points.

Test Plan: validate

Reviewers: simonpj, austin

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D88

5 years agocomment update
Simon Marlow [Tue, 22 Jul 2014 11:02:45 +0000 (12:02 +0100)] 
comment update

5 years agoAdd .gitignore line for stage=1 testsuite generated file
Reid Barton [Thu, 31 Jul 2014 02:10:43 +0000 (22:10 -0400)] 
Add .gitignore line for stage=1 testsuite generated file

5 years agoMake mod73 test insensitive to minor variations (#9325)
Reid Barton [Thu, 31 Jul 2014 01:44:42 +0000 (21:44 -0400)] 
Make mod73 test insensitive to minor variations (#9325)

5 years agoFix variable name typo from commit 3021fb
Niklas Larsson [Wed, 30 Jul 2014 01:48:19 +0000 (03:48 +0200)] 
Fix variable name typo from commit 3021fb

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd user documentation for explicitly-bidirectional pattern synonyms
Dr. ERDI Gergo [Tue, 29 Jul 2014 09:33:57 +0000 (11:33 +0200)] 
Add user documentation for explicitly-bidirectional pattern synonyms

5 years agoAdd note about renaming of pattern synonym wrappers
Dr. ERDI Gergo [Tue, 29 Jul 2014 09:28:33 +0000 (11:28 +0200)] 
Add note about renaming of pattern synonym wrappers

5 years agoRefactor PatSynBind so that we can pass around PSBs instead of several arguments
Dr. ERDI Gergo [Tue, 29 Jul 2014 09:27:26 +0000 (11:27 +0200)] 
Refactor PatSynBind so that we can pass around PSBs instead of several arguments

5 years agoAdd test cases for explicitly-bidirectional pattern synonym
Dr. ERDI Gergo [Tue, 29 Jul 2014 06:25:40 +0000 (08:25 +0200)] 
Add test cases for explicitly-bidirectional pattern synonym

5 years agoWhen computing minimal recursive sets of bindings, don't include references in wrappe...
Dr. ERDI Gergo [Sun, 27 Jul 2014 19:06:44 +0000 (21:06 +0200)] 
When computing minimal recursive sets of bindings, don't include references in wrapper definitions
for explicitly-bidirectional pattern synonyms

5 years agoTypecheck the wrapper definition of a pattern synonym,
Dr. ERDI Gergo [Sun, 27 Jul 2014 16:46:50 +0000 (18:46 +0200)] 
Typecheck the wrapper definition of a pattern synonym,
after everything in the same scope is typechecked

5 years agotcLookupPatSyn: look up the PatSyn record for a given Id
Dr. ERDI Gergo [Sun, 27 Jul 2014 19:00:15 +0000 (21:00 +0200)] 
tcLookupPatSyn: look up the PatSyn record for a given Id

5 years agoAdd renamer support for explicitly-bidirectional pattern synonyms
Dr. ERDI Gergo [Mon, 7 Jul 2014 11:25:29 +0000 (19:25 +0800)] 
Add renamer support for explicitly-bidirectional pattern synonyms

5 years agoTypechecker support for explicitly-bidirectional pattern synonyms
Dr. ERDI Gergo [Sun, 6 Jul 2014 15:49:43 +0000 (23:49 +0800)] 
Typechecker support for explicitly-bidirectional pattern synonyms

5 years agoAdd parser support for explicitly bidirectional pattern synonyms
Dr. ERDI Gergo [Sun, 6 Jul 2014 14:13:50 +0000 (22:13 +0800)] 
Add parser support for explicitly bidirectional pattern synonyms

5 years agoNew parser for pattern synonym declarations:
Dr. ERDI Gergo [Sun, 6 Jul 2014 09:33:00 +0000 (17:33 +0800)] 
New parser for pattern synonym declarations:

Like splitCon for constructor definitions, the left-hand side of a
pattern declaration is parsed as a single pattern which is then split
into a ConName and argument variable names

5 years agogetCoerbileInsts: Move the two NT-unwrapping instances together
Joachim Breitner [Tue, 29 Jul 2014 07:49:34 +0000 (09:49 +0200)] 
getCoerbileInsts: Move the two NT-unwrapping instances together

and fix the numbering in the comments. Thank to SPJ for noticing.
Nothing deep in here, just a insufficent copy’n’pasting in revision
7e78faf0. Incidentially, 7e78faf0 did a better job updating the comments
than the code :-).

5 years agorts: Detab OSThreads.c
Austin Seipp [Mon, 28 Jul 2014 14:34:02 +0000 (09:34 -0500)] 
rts: Detab OSThreads.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix validate fallout
Austin Seipp [Mon, 28 Jul 2014 14:29:08 +0000 (09:29 -0500)] 
Fix validate fallout

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agobase: make System.IO.openTempFile generate less predictable names
Sergei Trofimovich [Mon, 28 Jul 2014 12:59:36 +0000 (07:59 -0500)] 
base: make System.IO.openTempFile generate less predictable names

It basically changes

    prefix ++ getpid() ++ seq_no ++ suffix

for

    prefix ++ rand() ++ rand() ++ suffix

Which make any call to 'openTempFile' finish without loops.

Bug-report: https://ghc.haskell.org/trac/ghc/ticket/9058
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoDon't clean away inplace/mingw and inplace/perl.
niklas [Thu, 24 Jul 2014 20:02:39 +0000 (22:02 +0200)] 
Don't clean away inplace/mingw and inplace/perl.

Fixes #9362.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agodriver: Fix usage of '$0' in ghcii.sh (#8873)
Austin Seipp [Mon, 28 Jul 2014 12:53:32 +0000 (07:53 -0500)] 
driver: Fix usage of '$0' in ghcii.sh (#8873)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoDo not check permissions when running find on Windows.
niklas [Thu, 24 Jul 2014 21:08:24 +0000 (23:08 +0200)] 
Do not check permissions when running find on Windows.

Fixes #9363.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd Functor, Applicative, Monad instances for First, Last
Ben Gamari [Mon, 28 Jul 2014 12:50:28 +0000 (07:50 -0500)] 
Add Functor, Applicative, Monad instances for First, Last

Summary:
This was proposed in 2011 [1] with no serious objections although wasn't
implemented until it was again mentioned in 2014 [2].

[1] http://www.haskell.org/pipermail/libraries/2011-January/015552.html
[2] http://www.haskell.org/pipermail/libraries/2014-June/023228.html

Test Plan: None

Reviewers: austin

Reviewed By: austin

Subscribers: hvr, phaskell, simonmar, relrod, carter, ekmett

Differential Revision: https://phabricator.haskell.org/D81

5 years agouse GHC-7.8.3's values for thread block reason (fixes #9333)
Jost Berthold [Mon, 28 Jul 2014 12:50:13 +0000 (07:50 -0500)] 
use GHC-7.8.3's values for thread block reason (fixes #9333)

Summary:
For now, BlockedOnMVar and BlockedOnMVarRead are not distinguished.
Making the distinction would mean to change an exported datatype
(API change). Code for this change is included but commented out.

The patch adds a test for the threadstatus, which retrieves status
BlockedOnMVar for two threads blocked on writing and reading an MVar.

Test Plan: ran validate, including the new test

Reviewers: simonmar, austin, ezyang

Reviewed By: austin, ezyang

Subscribers: phaskell, simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D83

5 years agoAvoid to pass a socket to setmode/isatty in Windows
Isamu Mogi [Mon, 28 Jul 2014 12:49:55 +0000 (07:49 -0500)] 
Avoid to pass a socket to setmode/isatty in Windows

Summary:
In Windows, a socket is not a file descriptor. So passing it to
setmode/isatty causes an error that returns EABF and triggers invalid
parameter handler.

Test Plan:
1. Add WinDbg as a postmortem debugger (C:\>windbg -I)
2. Pass a socket to GHC.IO.Device.IODevice.isTerminal / GHC.IO.FD.fdToHandle'  (Executing 'cabal update' calls each functions with the socket in cabal-install 1.20.0.1)
3. WinDbg pops up and outputs error message: "Invalid parameter passed to C runtime function."
4. Apply the patch
5. Redo step 2
6. WinDbg doesn't pop up

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D92

5 years agoadd Solaris' linker warning messages filtering into link phase
Karel Gardas [Mon, 28 Jul 2014 12:49:40 +0000 (07:49 -0500)] 
add Solaris' linker warning messages filtering into link phase

Summary:
Solaris ld emits harmless warning messages about unresolved
symbol in case of compiling into shared library when we do not
link against all the required libs. That is the case of GHC which
does not link against RTS library explicitly in order to be able to
chose the library later based on binary application linking
parameters. The warnings look like:

Undefined                       first referenced
 symbol                             in file
stg_ap_n_fast                       ./T2386_Lib.o
stg_upd_frame_info                  ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziLib_litE_closure ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziLib_appE_closure ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziLib_conE_closure ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziSyntax_mkNameGzud_closure ./T2386_Lib.o
newCAF                              ./T2386_Lib.o
stg_bh_upd_frame_info               ./T2386_Lib.o
stg_ap_ppp_fast                     ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziLib_stringL_closure ./T2386_Lib.o
stg_ap_p_fast                       ./T2386_Lib.o
stg_ap_pp_fast                      ./T2386_Lib.o
ld: warning: symbol referencing errors

this is actually coming from T2386 testcase. The emitting of those
warnings is also a reason why so many TH testcases fail on Solaris.

The patch provides filter which filters out only linker warnings.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D94

5 years agodo not link with -lrt on Solaris for threaded way
Karel Gardas [Mon, 28 Jul 2014 12:49:12 +0000 (07:49 -0500)] 
do not link with -lrt on Solaris for threaded way

Summary:
This patch removes linking with rt library on Solaris
for threaded way. The reason is simple it casuses few ffi related tests
failures and also is not needed anymore.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D95

5 years agorts: add Emacs 'Local Variables' to every .c file
Austin Seipp [Tue, 22 Jul 2014 04:08:31 +0000 (23:08 -0500)] 
rts: add Emacs 'Local Variables' to every .c file

This will hopefully help ensure some basic consistency in the forward by
overriding buffer variables. In particular, it sets the wrap length, the
offset to 4, and turns off tabs.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detab/dewhitespace WSDeque.c
Austin Seipp [Tue, 22 Jul 2014 01:38:46 +0000 (20:38 -0500)] 
rts: detab/dewhitespace WSDeque.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detab/dewhitespace WSDeque.h
Austin Seipp [Tue, 22 Jul 2014 01:38:38 +0000 (20:38 -0500)] 
rts: detab/dewhitespace WSDeque.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detab/dewhitespace ThreadPaused.c
Austin Seipp [Tue, 22 Jul 2014 01:37:16 +0000 (20:37 -0500)] 
rts: detab/dewhitespace ThreadPaused.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace ThreadLabels.c
Austin Seipp [Tue, 22 Jul 2014 01:36:35 +0000 (20:36 -0500)] 
rts: delint/detab/dewhitespace ThreadLabels.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace StgRun.h
Austin Seipp [Tue, 22 Jul 2014 01:36:05 +0000 (20:36 -0500)] 
rts: delint/detab/dewhitespace StgRun.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace RtsDllMain.h
Austin Seipp [Tue, 22 Jul 2014 01:35:35 +0000 (20:35 -0500)] 
rts: delint/detab/dewhitespace RtsDllMain.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace RtsDllMain.c
Austin Seipp [Tue, 22 Jul 2014 01:35:30 +0000 (20:35 -0500)] 
rts: delint/detab/dewhitespace RtsDllMain.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace RetainerSet.c
Austin Seipp [Tue, 22 Jul 2014 01:34:06 +0000 (20:34 -0500)] 
rts: delint/detab/dewhitespace RetainerSet.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace RetainerSet.h
Austin Seipp [Tue, 22 Jul 2014 01:32:40 +0000 (20:32 -0500)] 
rts: delint/detab/dewhitespace RetainerSet.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace PosixSource.h
Austin Seipp [Tue, 22 Jul 2014 01:32:26 +0000 (20:32 -0500)] 
rts: delint/detab/dewhitespace PosixSource.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace Papi.h
Austin Seipp [Tue, 22 Jul 2014 01:32:02 +0000 (20:32 -0500)] 
rts: delint/detab/dewhitespace Papi.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint Papi.c
Austin Seipp [Tue, 22 Jul 2014 01:31:53 +0000 (20:31 -0500)] 
rts: delint Papi.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace Papi.c
Austin Seipp [Tue, 22 Jul 2014 01:30:16 +0000 (20:30 -0500)] 
rts: delint/detab/dewhitespace Papi.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace OldARMAtomic.c
Austin Seipp [Tue, 22 Jul 2014 01:29:31 +0000 (20:29 -0500)] 
rts: delint/detab/dewhitespace OldARMAtomic.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint Messages.c
Austin Seipp [Tue, 22 Jul 2014 01:29:03 +0000 (20:29 -0500)] 
rts: delint Messages.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detab/dewhitespace Messages.c
Austin Seipp [Tue, 22 Jul 2014 01:27:41 +0000 (20:27 -0500)] 
rts: detab/dewhitespace Messages.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace Hash.c
Austin Seipp [Tue, 22 Jul 2014 01:26:26 +0000 (20:26 -0500)] 
rts: delint/detab/dewhitespace Hash.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace Globals.h
Austin Seipp [Tue, 22 Jul 2014 01:25:32 +0000 (20:25 -0500)] 
rts: delint/detab/dewhitespace Globals.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint FileLock.c
Austin Seipp [Tue, 22 Jul 2014 01:25:00 +0000 (20:25 -0500)] 
rts: delint FileLock.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detab/dewhitespace FileLock.c
Austin Seipp [Tue, 22 Jul 2014 01:24:28 +0000 (20:24 -0500)] 
rts: detab/dewhitespace FileLock.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace Arena.c
Austin Seipp [Tue, 22 Jul 2014 01:21:54 +0000 (20:21 -0500)] 
rts: delint/detab/dewhitespace Arena.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace win32/WorkQueue.c
Austin Seipp [Tue, 22 Jul 2014 00:57:32 +0000 (19:57 -0500)] 
rts: delint/detab/dewhitespace win32/WorkQueue.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace win32/WorkQueue.h
Austin Seipp [Tue, 22 Jul 2014 00:56:34 +0000 (19:56 -0500)] 
rts: delint/detab/dewhitespace win32/WorkQueue.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace win32/ThrIOManager.c
Austin Seipp [Tue, 22 Jul 2014 00:56:11 +0000 (19:56 -0500)] 
rts: delint/detab/dewhitespace win32/ThrIOManager.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace win32/OSThreads.c
Austin Seipp [Tue, 22 Jul 2014 00:55:30 +0000 (19:55 -0500)] 
rts: delint/detab/dewhitespace win32/OSThreads.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace win32/OSMem.c
Austin Seipp [Tue, 22 Jul 2014 00:55:00 +0000 (19:55 -0500)] 
rts: delint/detab/dewhitespace win32/OSMem.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace win32/IOManager.c
Austin Seipp [Tue, 22 Jul 2014 00:52:22 +0000 (19:52 -0500)] 
rts: delint/detab/dewhitespace win32/IOManager.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: delint/detab/dewhitespace win32/IOManager.h
Austin Seipp [Tue, 22 Jul 2014 00:44:23 +0000 (19:44 -0500)] 
rts: delint/detab/dewhitespace win32/IOManager.h

Signed-off-by: Austin Seipp <austin@well-typed.com>