Re: Bug: --make non-functional on GHC compiler

2007-03-10 Thread Thorkil Naur
Hello,

Try to change the line

  module CutParse(main) where

in Main.hs to

  module Main(main) where

Best regards
Thorkil
On Saturday 10 March 2007 18:08, Samuel A. Falvo II wrote:
> Required Information:
> 
> 1.  What kind of machine are you running on, and exactly what version
> of the operating system are you using? (on a Unix system, uname -a or
> cat /etc/motd will show the desired information.)
> 
> $ uname -a
> 
> Linux aldeberan 2.6.16.13-3c95x #3 PREEMPT Tue May 2 23:16:59 PDT 2006
> i686 unknown unknown GNU/Linux
> 
> 
> 2.  What version of GCC are you using? gcc -v will tell you.
> 
> bash-2.05b$ gcc -v
> Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs
> Configured with: ../gcc-3.3.4/configure --prefix=/usr --enable-shared
> --enable-threads=posix --enable-__cxa_atexit --disable-checking
> --with-gnu-ld --verbose --target=i486-slackware-linux
> --host=i486-slackware-linux
> Thread model: posix
> gcc version 3.3.4
> 
> 3.  Run the sequence of compiles/runs that caused the offending
> behaviour, capturing all the input/output in a "script" (a UNIX
> command) or in an Emacs shell window. We'd prefer to see the whole
> thing.
> 
> bash-2.05b$ cat Main.hs
> module CutParse(main) where
> 
> main :: IO ()
> main = do putStr "Hello world!"
> 
> bash-2.05b$ ghc --make -v Main
> Glasgow Haskell Compiler, Version 6.4.1, for Haskell 98, compiled by
> GHC version 6.2.2
> Using package config file: /usr/local/lib/ghc-6.4.1/package.conf
> Hsc static flags: -static
> *** Chasing dependencies:
> Chasing modules from: Main
> Stable modules:
> *** Compiling CutParse ( Main.hs, interpreted ):
> compile: input file Main.hs
> *** Checking old interface for CutParse:
> Compiling CutParse ( Main.hs, Main.o )
> *** Parser:
> *** Renamer/typechecker:
> *** Desugar:
> Result size = 30
> *** Simplify:
> Result size = 6
> *** Tidy Core:
> Result size = 6
> *** CorePrep:
> Result size = 8
> *** Stg2Stg:
> *** CodeGen:
> *** CodeOutput:
> *** Assembler
> gcc -I. -c /tmp/ghc11833.s -o Main.o
> *** Deleting temp files
> Deleting: /tmp/ghc11833.s
> Upsweep completely successful.
> *** Deleting temp files
> Deleting:
> link(batch): upsweep (partially) failed OR
>Main.main not exported; not linking.
> *** Deleting temp files
> Deleting:
> bash-2.05b$ ls
> Main.hi  Main.hs  Main.o
> 
> NOTE: I have verified this problem exists with both the GHC 6.2.2 and
> 6.4.1 compilers.  I do not yet have 6.6.x due to the hours it takes to
> compile on my box.
> 
> 5.  What is the program behaviour that is wrong, in your opinion?
> 
> According to two sources:
> 
> * http://haskell.org/ghc/docs/6.4/html/users_guide/modes.html#make-mode
> * ghc --help
> 
> I should be able to "simply" invoke the --make option to have it build
> a complete program.  The program was reduced to a simple "Hello world"
> program for the sake of demonstration in this bug.  However, nothing I
> do convinces GHC to produce an executable, as per provided
> documentation.
> 
> Folks on IRC also suggested using the --main-is= flag, as follows:
> 
> bash-2.05$ ghc --make -v --main-is=Main.main Main
> 
> however, this also produces the same result -- no executable binary.
> 
> 6.  If practical, please send enough source files for us to duplicate
> the problem.
> 
> See attached file.
> 
> I should point out that, in all honesty, I think this is a bug with
> the documentation more than a bug with GHC itself; clearly, GHC 6.2.2
> was used to *build* GHC 6.4.1, so it MUST be possible to emit
> binaries.  The trick is giving it the right options to do so.  My
> thinking is that the documentation is not correct in this area.
> 
> Alternatively, --make itself may be buggy, and that GHC 6.4.1 was
> built without using it.
> 
> Either way, there is a fundamental disconnect between docs and reality.  :)
> 
> Thank you.
> 
> -- 
> Samuel A. Falvo II
> 
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: Bug: --make non-functional on GHC compiler

2007-03-10 Thread Stefan O'Rear
On Sat, Mar 10, 2007 at 09:08:45AM -0800, Samuel A. Falvo II wrote:
> Required Information:

First, AFAIK nobody but Trac is supposed to post here - this is a
new-ticket announce list only.  All bugreports and discussions are
supposed to go through Trac. 

http://hackage.haskell.org/trac/ghc

> 1.  What kind of machine are you running on, and exactly what version
> of the operating system are you using? (on a Unix system, uname -a or
> cat /etc/motd will show the desired information.)
> 
> $ uname -a
> 
> Linux aldeberan 2.6.16.13-3c95x #3 PREEMPT Tue May 2 23:16:59 PDT 2006
> i686 unknown unknown GNU/Linux
> 
> 
> 2.  What version of GCC are you using? gcc -v will tell you.
> 
> bash-2.05b$ gcc -v
> Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs
> Configured with: ../gcc-3.3.4/configure --prefix=/usr --enable-shared
> --enable-threads=posix --enable-__cxa_atexit --disable-checking
> --with-gnu-ld --verbose --target=i486-slackware-linux
> --host=i486-slackware-linux
> Thread model: posix
> gcc version 3.3.4
> 
> 3.  Run the sequence of compiles/runs that caused the offending
> behaviour, capturing all the input/output in a "script" (a UNIX
> command) or in an Emacs shell window. We'd prefer to see the whole
> thing.
> 
> bash-2.05b$ cat Main.hs
> module CutParse(main) where
> 
> main :: IO ()
> main = do putStr "Hello world!"

Quote the Revised Report: http://haskell.org/onlinereport/modules.html

A Haskell program is a collection of modules, one of which, by
convention, must be called Main and must export the value main. The
value of the program is the value of the identifier main in module
Main, which must be a computation of type IO t for some type t (see
Chapter 7). When the program is executed, the computation main is
performed, and its result (of type t) is discarded. 

In other words, if you want to be portable off GHC you *need* to call
your main module 'Main'.  Note that the filename of the main module is
irrelevant, only the header. 

Quoth the 6.7.20070308 user guide:

  4.8.2. The main package

   Every complete Haskell program must define main in module Main in
   package main. (Omitting the -package-name flag compiles code for
   package main.) Failure to do so leads to a somewhat obscure
   link-time error of the form:

 /usr/bin/ld: Undefined symbols:
 _ZCMain_main_closure
 ___stginit_ZCMain

I can't find anything in the 6.4 ug however.

> bash-2.05b$ ghc --make -v Main
> Glasgow Haskell Compiler, Version 6.4.1, for Haskell 98, compiled by
> GHC version 6.2.2
> Using package config file: /usr/local/lib/ghc-6.4.1/package.conf
> Hsc static flags: -static
> *** Chasing dependencies:
> Chasing modules from: Main
> Stable modules:
> *** Compiling CutParse ( Main.hs, interpreted ):
> compile: input file Main.hs
> *** Checking old interface for CutParse:
> Compiling CutParse ( Main.hs, Main.o )
> *** Parser:
> *** Renamer/typechecker:
> *** Desugar:
>Result size = 30
> *** Simplify:
>Result size = 6
> *** Tidy Core:
>Result size = 6
> *** CorePrep:
>Result size = 8
> *** Stg2Stg:
> *** CodeGen:
> *** CodeOutput:
> *** Assembler
> gcc -I. -c /tmp/ghc11833.s -o Main.o
> *** Deleting temp files
> Deleting: /tmp/ghc11833.s
> Upsweep completely successful.
> *** Deleting temp files
> Deleting:
> link(batch): upsweep (partially) failed OR
>   Main.main not exported; not linking.
> *** Deleting temp files
> Deleting:
> bash-2.05b$ ls
> Main.hi  Main.hs  Main.o
> 
> NOTE: I have verified this problem exists with both the GHC 6.2.2 and
> 6.4.1 compilers.  I do not yet have 6.6.x due to the hours it takes to
> compile on my box.
> 
> 5.  What is the program behaviour that is wrong, in your opinion?
> 
> According to two sources:
> 
> * http://haskell.org/ghc/docs/6.4/html/users_guide/modes.html#make-mode
> * ghc --help
> 
> I should be able to "simply" invoke the --make option to have it build
> a complete program.  The program was reduced to a simple "Hello world"
> program for the sake of demonstration in this bug.  However, nothing I
> do convinces GHC to produce an executable, as per provided
> documentation.
> 
> Folks on IRC also suggested using the --main-is= flag, as follows:
> 
> bash-2.05$ ghc --make -v --main-is=Main.main Main
> 
> however, this also produces the same result -- no executable binary.
> 
> 6.  If practical, please send enough source files for us to duplicate
> the problem.
> 
> See attached file.
> 
> I should point out that, in all honesty, I think this is a bug with
> the documentation more than a bug with GHC itself; clearly, GHC 6.2.2
> was used to *build* GHC 6.4.1, so it MUST be possible to emit
> binaries.  The trick is giving it the right options to do so.  My
> thinking is that the documentation is not correct in this area.
> 
> Alternatively, --make itself may be buggy, and that GHC 6.4.1 was
> built without using it.
> 
> Either way, there is a fundamental disconnect between docs and reality.  :)
> 
> Thank you.
> 
> 

Bug: --make non-functional on GHC compiler

2007-03-10 Thread Samuel A. Falvo II

Required Information:

1.  What kind of machine are you running on, and exactly what version
of the operating system are you using? (on a Unix system, uname -a or
cat /etc/motd will show the desired information.)

$ uname -a

Linux aldeberan 2.6.16.13-3c95x #3 PREEMPT Tue May 2 23:16:59 PDT 2006
i686 unknown unknown GNU/Linux


2.  What version of GCC are you using? gcc -v will tell you.

bash-2.05b$ gcc -v
Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs
Configured with: ../gcc-3.3.4/configure --prefix=/usr --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-checking
--with-gnu-ld --verbose --target=i486-slackware-linux
--host=i486-slackware-linux
Thread model: posix
gcc version 3.3.4

3.  Run the sequence of compiles/runs that caused the offending
behaviour, capturing all the input/output in a "script" (a UNIX
command) or in an Emacs shell window. We'd prefer to see the whole
thing.

bash-2.05b$ cat Main.hs
module CutParse(main) where

main :: IO ()
main = do putStr "Hello world!"

bash-2.05b$ ghc --make -v Main
Glasgow Haskell Compiler, Version 6.4.1, for Haskell 98, compiled by
GHC version 6.2.2
Using package config file: /usr/local/lib/ghc-6.4.1/package.conf
Hsc static flags: -static
*** Chasing dependencies:
Chasing modules from: Main
Stable modules:
*** Compiling CutParse ( Main.hs, interpreted ):
compile: input file Main.hs
*** Checking old interface for CutParse:
Compiling CutParse ( Main.hs, Main.o )
*** Parser:
*** Renamer/typechecker:
*** Desugar:
   Result size = 30
*** Simplify:
   Result size = 6
*** Tidy Core:
   Result size = 6
*** CorePrep:
   Result size = 8
*** Stg2Stg:
*** CodeGen:
*** CodeOutput:
*** Assembler
gcc -I. -c /tmp/ghc11833.s -o Main.o
*** Deleting temp files
Deleting: /tmp/ghc11833.s
Upsweep completely successful.
*** Deleting temp files
Deleting:
link(batch): upsweep (partially) failed OR
  Main.main not exported; not linking.
*** Deleting temp files
Deleting:
bash-2.05b$ ls
Main.hi  Main.hs  Main.o

NOTE: I have verified this problem exists with both the GHC 6.2.2 and
6.4.1 compilers.  I do not yet have 6.6.x due to the hours it takes to
compile on my box.

5.  What is the program behaviour that is wrong, in your opinion?

According to two sources:

* http://haskell.org/ghc/docs/6.4/html/users_guide/modes.html#make-mode
* ghc --help

I should be able to "simply" invoke the --make option to have it build
a complete program.  The program was reduced to a simple "Hello world"
program for the sake of demonstration in this bug.  However, nothing I
do convinces GHC to produce an executable, as per provided
documentation.

Folks on IRC also suggested using the --main-is= flag, as follows:

bash-2.05$ ghc --make -v --main-is=Main.main Main

however, this also produces the same result -- no executable binary.

6.  If practical, please send enough source files for us to duplicate
the problem.

See attached file.

I should point out that, in all honesty, I think this is a bug with
the documentation more than a bug with GHC itself; clearly, GHC 6.2.2
was used to *build* GHC 6.4.1, so it MUST be possible to emit
binaries.  The trick is giving it the right options to do so.  My
thinking is that the documentation is not correct in this area.

Alternatively, --make itself may be buggy, and that GHC 6.4.1 was
built without using it.

Either way, there is a fundamental disconnect between docs and reality.  :)

Thank you.

--
Samuel A. Falvo II
module CutParse(main) where

main :: IO ()
main = do putStr "Hello world!"

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #1110: Setting PATH needed in Windows Vista

2007-03-10 Thread Bruno Martínez

This is the same problem that http://aarongiles.com/?p=199

Maybe ghc can set the path before calling mingw.

===   Banda Ancha - Hosting - Redes
www.internet.com.uy - Tel(02)7074252
===

===   Banda Ancha - Hosting - Redes
www.internet.com.uy - Tel(02)7074252
===
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #1213: typecheck/TcTyClsDecls.lhs: Non-exhaustive patterns in function tcConDecl

2007-03-10 Thread GHC
#1213: typecheck/TcTyClsDecls.lhs: Non-exhaustive patterns in function tcConDecl
-+--
Reporter:  guest |   Owner: 
Type:  bug   |  Status:  new
Priority:  normal|   Milestone: 
   Component:  Compiler  | Version:  6.6
Severity:  normal|Keywords: 
  Difficulty:  Unknown   |Testcase: 
Architecture:  Unknown   |  Os:  Unknown
-+--
The following code

 {{{
 module Main where

 newtype Test where
 T :: Int -> Test

 instance Show Test where
 show (T i) = show i

 main = putStrLn (show (T 3))
 }}}

 causes the compiler to crash with:

 {{{
 [1 of 1] Compiling Main ( test2.hs, test2.o )
 ghc-6.6: panic! (the 'impossible' happened)
   (GHC version 6.6 for powerpc-apple-darwin):
 typecheck/TcTyClsDecls.lhs:(468,0)-(524,4): Non-exhaustive
 patterns in function tcConDecl


 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

 however changing 'newtype' to 'data' compiles without errors.

 Tested with GHC and GHCi 6.6 under Mac OS X 10.4.8 running on an iMac G5.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #1212: Add IPv6 support to network library

2007-03-10 Thread GHC
#1212: Add IPv6 support to network library
+---
 Reporter:  [EMAIL PROTECTED]  |  Owner:  
 Type:  proposal| Status:  new 
 Priority:  normal  |  Milestone:  Not GHC 
Component:  libraries/network   |Version:  6.6 
 Severity:  normal  | Resolution:  
 Keywords:  | Difficulty:  Moderate (1 day)
 Testcase:  |   Architecture:  Multiple
   Os:  Multiple|  
+---
Comment (by [EMAIL PROTECTED]):

 Does 1 week seem like a reasonable timescale for consideration?

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #1212: Add IPv6 support to network library

2007-03-10 Thread GHC
#1212: Add IPv6 support to network library
+---
 Reporter:  [EMAIL PROTECTED]  |  Owner:  
 Type:  proposal| Status:  new 
 Priority:  normal  |  Milestone:  Not GHC 
Component:  libraries/network   |Version:  6.6 
 Severity:  normal  | Resolution:  
 Keywords:  | Difficulty:  Moderate (1 day)
 Testcase:  |   Architecture:  Multiple
   Os:  Multiple|  
+---
Comment (by guest):

 I should mention that there's a darcs repo available here:

 http://darcs.serpentine.com/network6

 And formatted haddocks here:

 http://darcs.serpentine.com/network6/docs/Network-BSD.html

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #1212: Add IPv6 support to network library

2007-03-10 Thread GHC
#1212: Add IPv6 support to network library
---+
Reporter:  [EMAIL PROTECTED]  |   Owner:  
Type:  proposal|  Status:  new 
Priority:  normal  |   Milestone:  Not GHC 
   Component:  libraries/network   | Version:  6.6 
Severity:  normal  |Keywords:  
  Difficulty:  Moderate (1 day)|Testcase:  
Architecture:  Multiple|  Os:  Multiple
---+
This proposal adds two standard protocol-independent functions to
 Network.BSD to allow the networking code to work with both IPv6 and IPv4
 addresses and protocols.

 `getAddrInfo` is the equivalent of `getaddrinfo` from RFC 2553.
 `getNameInfo` is the equivalent of `getnameinfo` from RFC 2553.

 These functions rely on a few new types:

 `AddrInfo`
 `AddrInfoFlags`
 `NameInfoFlags`

 Several global values provide mnemonics for query hints and flags.

 Both of these functions are available on all modern operating systems.
 They unify name and service lookup for IPv4 and IPv6.  The code has been
 autoconfiscated so that it will not be compiled if IPv6 support is not
 available.

 I have not touched existing code in any way, save to add and extend the
 smallest possible number of types and functions so that IPv6 addresses can
 be accommodated.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs