ghc.git
4 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>
4 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>
4 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>
4 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>
4 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

4 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

4 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

4 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

4 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

4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 years agorts: delint/detab/dewhitespace win32/GetTime.c
Austin Seipp [Tue, 22 Jul 2014 00:43:56 +0000 (19:43 -0500)] 
rts: delint/detab/dewhitespace win32/GetTime.c

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

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

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

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

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

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace Select.c
Austin Seipp [Mon, 21 Jul 2014 15:45:01 +0000 (10:45 -0500)] 
rts: delint/detab/dewhitespace Select.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace Signals.c
Austin Seipp [Mon, 21 Jul 2014 15:42:20 +0000 (10:42 -0500)] 
rts: delint/detab/dewhitespace Signals.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace Signals.h
Austin Seipp [Mon, 21 Jul 2014 15:38:47 +0000 (10:38 -0500)] 
rts: delint/detab/dewhitespace Signals.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace TTY.c
Austin Seipp [Mon, 21 Jul 2014 15:38:21 +0000 (10:38 -0500)] 
rts: delint/detab/dewhitespace TTY.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace OSThreads.c
Austin Seipp [Mon, 21 Jul 2014 15:35:42 +0000 (10:35 -0500)] 
rts: delint/detab/dewhitespace OSThreads.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace OSMem.c
Austin Seipp [Mon, 21 Jul 2014 15:34:08 +0000 (10:34 -0500)] 
rts: delint/detab/dewhitespace OSMem.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace Itimer.c
Austin Seipp [Mon, 21 Jul 2014 15:31:39 +0000 (10:31 -0500)] 
rts: delint/detab/dewhitespace Itimer.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace GetTime.c
Austin Seipp [Mon, 21 Jul 2014 15:31:15 +0000 (10:31 -0500)] 
rts: delint/detab/dewhitespace GetTime.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace GetEnv.c
Austin Seipp [Mon, 21 Jul 2014 15:29:04 +0000 (10:29 -0500)] 
rts: delint/detab/dewhitespace GetEnv.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agorts: delint/detab/dewhitespace EventLog.c
Austin Seipp [Mon, 21 Jul 2014 15:28:02 +0000 (10:28 -0500)] 
rts: delint/detab/dewhitespace EventLog.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoDon't call installed package IDs 'package IDs'; they're different.
Edward Z. Yang [Mon, 28 Jul 2014 14:26:07 +0000 (15:26 +0100)] 
Don't call installed package IDs 'package IDs'; they're different.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoAdd reexported modules to the list of IPID fields.
Edward Z. Yang [Mon, 28 Jul 2014 10:55:05 +0000 (03:55 -0700)] 
Add reexported modules to the list of IPID fields.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoSupport ghc-pkg --ipid to query package ID.
Edward Z. Yang [Sat, 26 Jul 2014 23:19:28 +0000 (00:19 +0100)] 
Support ghc-pkg --ipid to query package ID.

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

Test Plan: validate

Reviewers: hvr, simonmar, austin

Subscribers: simonmar, relrod, carter

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

4 years agoIncrease precision of timings reported by RTS
Herbert Valerio Riedel [Sat, 26 Jul 2014 09:05:22 +0000 (11:05 +0200)] 
Increase precision of timings reported by RTS

Summary:
Today's hardware is much faster, so it makes sense to report timings
with more precision, and possibly help reduce rounding-induced
fluctuations in the nofib statistics.

This commit increases the precision of all timings previously reported
with a granularity of 10ms to 1ms. For instance, the `+RTS -S` output is
now rendered as:

    Alloc    Copied     Live     GC     GC      TOT      TOT  Page Flts
    bytes     bytes     bytes   user   elap     user     elap
   641936     59944    158120  0.000  0.000    0.013    0.001    0    0  (Gen:  0)
   517672     60840    158464  0.000  0.000    0.013    0.002    0    0  (Gen:  0)
   517256     58800    156424  0.005  0.005    0.019    0.007    0    0  (Gen:  1)
   670208      9520    158728  0.000  0.000    0.019    0.008    0    0  (Gen:  0)

  ...

                                     Tot time (elapsed)  Avg pause  Max pause
  Gen  0        24 colls,     0 par    0.002s   0.002s     0.0001s    0.0002s
  Gen  1         3 colls,     0 par    0.011s   0.011s     0.0038s    0.0055s

  TASKS: 4 (1 bound, 3 peak workers (3 total), using -N1)

  SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)

  INIT    time    0.001s  (  0.001s elapsed)
  MUT     time    0.005s  (  0.006s elapsed)
  GC      time    0.014s  (  0.014s elapsed)
  EXIT    time    0.001s  (  0.001s elapsed)
  Total   time    0.032s  (  0.020s elapsed)

Note that this change also requires associated changes in the nofib
submodule.

Test Plan: tested with modified nofib

Reviewers: simonmar, nomeata, austin

Subscribers: simonmar, relrod, carter

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

4 years agoComments only
Jan Stolarek [Mon, 28 Jul 2014 06:11:58 +0000 (08:11 +0200)] 
Comments only

4 years agoImplement OVERLAPPING and OVERLAPPABLE pragmas (see #9242)
Iavor S. Diatchki [Sun, 27 Jul 2014 20:02:37 +0000 (13:02 -0700)] 
Implement OVERLAPPING and OVERLAPPABLE pragmas (see #9242)

This also removes the short-lived NO_OVERLAP pragama, and renames
OVERLAP to OVERLAPS.

An instance may be annotated with one of 4 pragams, to control its
interaction with other overlapping instances:

  * OVERLAPPABLE:
    this instance is ignored if a more specific candidate exists

  * OVERLAPPING:
    this instance is preferred over more general candidates

  * OVERLAPS:
    both OVERLAPPING and OVERLAPPABLE (i.e., the previous GHC behavior).
    When compiling with -XOverlappingInstances, all instance are OVERLAPS.

  * INCOHERENT:
    same as before (see manual for details).
    When compiling with -XIncoherentInstances, all instances are INCOHERENT.

4 years agoFix build on OS X due to macro-like string in comment
Edward Z. Yang [Sat, 26 Jul 2014 09:41:28 +0000 (10:41 +0100)] 
Fix build on OS X due to macro-like string in comment

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoModule reexports, fixing #8407.
Edward Z. Yang [Fri, 4 Jul 2014 16:01:08 +0000 (17:01 +0100)] 
Module reexports, fixing #8407.

The general approach is to add a new field to the package database,
reexported-modules, which considered by the module finder as possible
module declarations.  Unlike declaring stub module files, multiple
reexports of the same physical package at the same name do not
result in an ambiguous import.

Has submodule updates for Cabal and haddock.

NB: When a reexport renames a module, that renaming is *not* accessible
from inside the package.  This is not so much a deliberate design choice
as for implementation expediency (reexport resolution happens only when
a package is in the package database.)

TODO: Error handling when there are duplicate reexports/etc is not very
well tested.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Conflicts:
compiler/main/HscTypes.lhs
testsuite/.gitignore
utils/haddock

4 years agoUpdate test suite output
Joachim Breitner [Fri, 25 Jul 2014 21:01:47 +0000 (23:01 +0200)] 
Update test suite output

after changes in 92587bf.

This problem was noticed on ghcspeed (although only by accident,
unfortunately, as a change from 0 to 1 is not reported in the summary).

4 years agoRefactor FFI error messages
Simon Peyton Jones [Fri, 25 Jul 2014 15:22:21 +0000 (16:22 +0100)] 
Refactor FFI error messages

This patch was provoked by Trac #5610, which I finally got a moment to look at.

In the end I added a new data type ErrUtils.Validity,

  data Validity
    = IsValid            -- Everything is fine
    | NotValid MsgDoc    -- A problem, and some indication of why

with some suitable combinators, and used it where appropriate (which touches
quite a few modules).  The main payoff is that error messages improve for
FFI type validation.

4 years ago[backpack] Rewrite compilation to be cleaner.
Edward Z. Yang [Fri, 25 Jul 2014 11:56:33 +0000 (12:56 +0100)] 
[backpack] Rewrite compilation to be cleaner.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoCheck for boxed tau types in the LHS of type family instances
Simon Peyton Jones [Fri, 25 Jul 2014 09:29:35 +0000 (10:29 +0100)] 
Check for boxed tau types in the LHS of type family instances

Fixes Trac #9357

4 years agoUse the right kinds on the LHS in 'deriving' clauses
Simon Peyton Jones [Thu, 24 Jul 2014 11:49:04 +0000 (12:49 +0100)] 
Use the right kinds on the LHS in 'deriving' clauses

This patch fixes Trac #9359

4 years agoFixed issue with detection of duplicate record fields
Gintautas Miliauskas [Thu, 24 Jul 2014 12:45:26 +0000 (14:45 +0200)] 
Fixed issue with detection of duplicate record fields

Duplicate record fields would not be detected when given a type
with multiple data constructors, and the first data constructor
had a record field r1 and any consecutive data constructors
had multiple fields named r1.

This fixes #9156 and was reviewed in https://phabricator.haskell.org/D87

4 years agoAdd missing memory fence to atomicWriteIntArray#
Johan Tibell [Wed, 23 Jul 2014 11:12:10 +0000 (13:12 +0200)] 
Add missing memory fence to atomicWriteIntArray#

4 years agoFix test for fetchNandIntArray#
Johan Tibell [Wed, 23 Jul 2014 11:11:15 +0000 (13:11 +0200)] 
Fix test for fetchNandIntArray#

The test was incorrectly testing that NAND is associative, which it
isn't.

4 years agoX86 codegen: make LOCK a real instruction prefix
Johan Tibell [Wed, 23 Jul 2014 10:22:37 +0000 (12:22 +0200)] 
X86 codegen: make LOCK a real instruction prefix

Before LOCK was a separate instruction and this led to the register
allocator separating it from the instruction it was supposed to be a
prefix of, leading to illegal assembly such as

    lock mov

Fix contributed by PÁLI Gábor János.

4 years agoDuplicate word
Gabor Greif [Wed, 23 Jul 2014 18:32:56 +0000 (20:32 +0200)] 
Duplicate word

4 years agoIgnore tix files.
Edward Z. Yang [Wed, 23 Jul 2014 15:54:38 +0000 (16:54 +0100)] 
Ignore tix files.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoWrite up rename on entry
Edward Z. Yang [Wed, 23 Jul 2014 15:34:07 +0000 (16:34 +0100)] 
Write up rename on entry

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoDefinite compilation is a go
Edward Z. Yang [Wed, 23 Jul 2014 14:29:27 +0000 (15:29 +0100)] 
Definite compilation is a go

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoAdd a summary section.
Edward Z. Yang [Tue, 22 Jul 2014 15:21:35 +0000 (16:21 +0100)] 
Add a summary section.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoRewrite package/module identity section
Edward Z. Yang [Tue, 22 Jul 2014 14:55:59 +0000 (15:55 +0100)] 
Rewrite package/module identity section

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoMake last a good consumer
Joachim Breitner [Tue, 22 Jul 2014 09:21:01 +0000 (11:21 +0200)] 
Make last a good consumer

Summary:
Make last a good consumer simply by implementing it as foldl. This fixes Trac: #9339.
Thanks to David Feuer for bringing it up.

Test Plan: perf/should_run/T9339 + general validation

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, carter

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

Trac Issues: #9339

4 years agoUnbreak the build on FreeBSD/i386, where the default target arch is i486.
Gabor Pali [Mon, 21 Jul 2014 20:13:24 +0000 (22:13 +0200)] 
Unbreak the build on FreeBSD/i386, where the default target arch is i486.

The recent version of ghc-prim assumes a more modern processor as it
exploits built-in atomic operations, and some of them are not yet
present on i486.  Hence the -march flag is explicitly set to i686 for the
C compiler -- just to be in sync with the default of other distributions.

4 years agoAlways qualify on hi interface mismatch.
Edward Z. Yang [Mon, 21 Jul 2014 16:21:10 +0000 (17:21 +0100)] 
Always qualify on hi interface mismatch.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoUpdate Cabal submodule to HEAD (1.21)
Edward Z. Yang [Mon, 21 Jul 2014 15:51:45 +0000 (08:51 -0700)] 
Update Cabal submodule to HEAD (1.21)

This reverts commit f23b2129aca24beb4ece0d5915f67c448dc64ae4.

4 years agoDocumentation for substringCheck.
Edward Z. Yang [Mon, 21 Jul 2014 15:22:13 +0000 (16:22 +0100)] 
Documentation for substringCheck.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
4 years agoRename PackageId to PackageKey, distinguishing it from Cabal's PackageId.
Edward Z. Yang [Sat, 19 Jul 2014 16:11:08 +0000 (17:11 +0100)] 
Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId.

Summary:
Previously, both Cabal and GHC defined the type PackageId, and we expected
them to be roughly equivalent (but represented differently).  This refactoring
separates these two notions.

A package ID is a user-visible identifier; it's the thing you write in a
Cabal file, e.g. containers-0.9.  The components of this ID are semantically
meaningful, and decompose into a package name and a package vrsion.

A package key is an opaque identifier used by GHC to generate linking symbols.
Presently, it just consists of a package name and a package version, but
pursuant to #9265 we are planning to extend it to record other information.
Within a single executable, it uniquely identifies a package.  It is *not* an
InstalledPackageId, as the choice of a package key affects the ABI of a package
(whereas an InstalledPackageId is computed after compilation.)  Cabal computes
a package key for the package and passes it to GHC using -package-name (now
*extremely* misnamed).

As an added bonus, we don't have to worry about shadowing anymore.

As a follow on, we should introduce -current-package-key having the same role as
-package-name, and deprecate the old flag.  This commit is just renaming.

The haddock submodule needed to be updated.

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/D79

Conflicts:
compiler/main/HscTypes.lhs
compiler/main/Packages.lhs
utils/haddock

4 years agodocs: Delete old docbook cheat sheet
Austin Seipp [Mon, 21 Jul 2014 09:45:26 +0000 (04:45 -0500)] 
docs: Delete old docbook cheat sheet

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agodocs: Remove obsolete Visual Haskell document
Austin Seipp [Mon, 21 Jul 2014 09:37:26 +0000 (04:37 -0500)] 
docs: Remove obsolete Visual Haskell document

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoarclint: update linting configuration
Austin Seipp [Mon, 21 Jul 2014 09:33:27 +0000 (04:33 -0500)] 
arclint: update linting configuration

Signed-off-by: Austin Seipp <austin@well-typed.com>
4 years agoUpdate upstream Git repo url for `time` package
Herbert Valerio Riedel [Mon, 21 Jul 2014 14:10:32 +0000 (16:10 +0200)] 
Update upstream Git repo url for `time` package

The `time` package has recently moved its primary upstream location
to https://github.com/haskell/time.

This leaves `transformers` the only package used by GHC still requiring
darcs2git mirroring machinery.

4 years ago[ghc-pkg] Fix #5442 by using the flag db stack to modify packages.
Edward Z. Yang [Mon, 21 Jul 2014 12:50:19 +0000 (05:50 -0700)] 
[ghc-pkg] Fix #5442 by using the flag db stack to modify packages.

Summary:
Previously, the full database stack was used for ghc-pkg to
modify packages, which meant that commands like
'ghc-pkg unregister --user' worked the same as 'ghc-pkg unregister'.
Since package modification is a "read and write" operation, we
should use the flag db stack (which is currently used for reads)
to determine which database to update.

There is also a new flag --user-package-db, which lets you explicitly
set the user database (as seen by --user).  This was mostly added
to aid in testing, but could be useful for end users as well.

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

Reviewers: simonmar, hvr, austin

Subscribers: simonmar, relrod, carter

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

4 years agoMake 'ghc' a wired in package.
Edward Z. Yang [Sat, 19 Jul 2014 15:24:59 +0000 (16:24 +0100)] 
Make 'ghc' a wired in package.

Summary:
Previously, the GHC API was "semi" wired-in: it was installed with a
version number, but that version number was hard-coded into the compiler
and it wasn't really possible to install other copies of the GHC API.
This patch makes the GHC API more similar to existing wired-in packages
such as ghc-prim, and will be helpful when we start extending the amount
of information passed to -package-name.

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

Reviewers: simonmar, simonpj, hvr, austin

Subscribers: simonmar, relrod, carter

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

4 years agoTypos in note
Gabor Greif [Mon, 21 Jul 2014 08:39:35 +0000 (10:39 +0200)] 
Typos in note

4 years agoRevert "travis: Install process via cabal"
Joachim Breitner [Mon, 21 Jul 2014 07:21:48 +0000 (09:21 +0200)] 
Revert "travis: Install process via cabal"

This reverts commit c41b716d82b1722f909979d02a76e21e9b68886c.

With the Cabal bump reverted, this should build again, and we aim to
keep it buildable like this.

5 years agovagrant: move files around
Austin Seipp [Sun, 20 Jul 2014 23:27:46 +0000 (18:27 -0500)] 
vagrant: move files around

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoutils: remove old pvm scripts
Austin Seipp [Sun, 20 Jul 2014 23:25:49 +0000 (18:25 -0500)] 
utils: remove old pvm scripts

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoutils: delete obsolete heap-view program
Austin Seipp [Sun, 20 Jul 2014 23:24:11 +0000 (18:24 -0500)] 
utils: delete obsolete heap-view program

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agodriver: use absolute paths in ld scripts (#7452)
Austin Seipp [Sun, 20 Jul 2014 15:13:15 +0000 (10:13 -0500)] 
driver: use absolute paths in ld scripts (#7452)

Patch contributed by slowmo.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoData.List: Unterse/Obvious comment regarding CPP
Alexander Berntsen [Sat, 19 Jul 2014 04:56:00 +0000 (23:56 -0500)] 
Data.List: Unterse/Obvious comment regarding CPP

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, carter

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

5 years agorts: drop unused 'SpinLockCount' typedef
Sergei Trofimovich [Sat, 19 Jul 2014 04:55:46 +0000 (23:55 -0500)] 
rts: drop unused 'SpinLockCount' typedef

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

Test Plan: git grep, git log -SSpinLockCount, build test

Reviewers: austin, simonmar

Reviewed By: austin, simonmar

Subscribers: phaskell, simonmar, relrod, carter

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

5 years agoMake GHCi permissions checks ignore root user.
Mathieu Boespflug [Sat, 19 Jul 2014 04:55:18 +0000 (23:55 -0500)] 
Make GHCi permissions checks ignore root user.

Summary:
As a security precaution, GHCi helpfully refuses to run a .ghci file if it is owned by another user. But if the that other user is root, then arguably GHCi should not refuse to interpret the file, because if root really was malicious, then the user would be having a bad day anyways.
This means that .ghci files installed in a global location, say under /usr/local/, can now be read.

Fixes #9324

Test Plan:
```
$ sudo touch .ghci
$ ghci
```
Notice that the warning about the file being owned by someone else is now gone.

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, carter, nomeata, relrod

Projects: #ghc

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

5 years agofix inconsistency in exported functions from TcSplice.lhs/lhs-boot files when GHCI...
Karel Gardas [Sat, 19 Jul 2014 04:54:52 +0000 (23:54 -0500)] 
fix inconsistency in exported functions from TcSplice.lhs/lhs-boot files when GHCI is not defined

Summary:
This patch fixes inconsistency in exported functions from TcSplice.lhs and TcSplice.lhs-boot
files. It looks like only GHC HEAD is sensitive to it and complains about it while bootstraping
another HEAD. At least this is what happening on Solaris/AMD64 builder machine where GHC 7.9.20140620
is used as a boostrap compiler. The failure does not happen on another builders.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, carter

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

5 years agoAdding more parser exports and some documentation.
Andrew Gibiansky [Sat, 19 Jul 2014 04:54:26 +0000 (23:54 -0500)] 
Adding more parser exports and some documentation.

Summary: Add a few exports to be generated by the Happy parser module. Add documentation showing how to use the Happy parser.

Test Plan: Validate

Reviewers: carter, austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, carter

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