rts: detab/dewhitespace ThreadPaused.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
rts: detab/dewhitespace WSDeque.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
rts: detab/dewhitespace WSDeque.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
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>
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
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
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
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
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
Do not check permissions when running find on Windows.

Fixes #9363.

Signed-off-by: Austin Seipp <austin@well-typed.com>
driver: Fix usage of '$0' in ghcii.sh (#8873)

Signed-off-by: Austin Seipp <austin@well-typed.com>
Don't clean away inplace/mingw and inplace/perl.

Fixes #9362.

Signed-off-by: Austin Seipp <austin@well-typed.com>
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>
Fix validate fallout

Signed-off-by: Austin Seipp <austin@well-typed.com>
rts: Detab OSThreads.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
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 :-).
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
Add parser support for explicitly bidirectional pattern synonyms
Typechecker support for explicitly-bidirectional pattern synonyms
Add renamer support for explicitly-bidirectional pattern synonyms